From a149fe969ced4049edc54c7630c19bce8234b04e Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Sun, 11 Oct 2020 16:37:09 +0200 Subject: [PATCH] phpPackages.composer: Move to separate directory --- .../php-packages/composer/default.nix | 32 +++++++++++++++++++ pkgs/top-level/php-packages.nix | 29 +---------------- 2 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 pkgs/development/php-packages/composer/default.nix diff --git a/pkgs/development/php-packages/composer/default.nix b/pkgs/development/php-packages/composer/default.nix new file mode 100644 index 000000000000..4f6cbe4c7d3e --- /dev/null +++ b/pkgs/development/php-packages/composer/default.nix @@ -0,0 +1,32 @@ +{ mkDerivation, fetchurl, pkgs, lib, php }: +let + pname = "composer"; + version = "1.10.13"; +in +mkDerivation { + inherit pname version; + + src = fetchurl { + url = "https://getcomposer.org/download/${version}/composer.phar"; + sha256 = "13vhfdlkmpvmk1h30f1i688xk7sdgfj0b82am32jgpa8zmf499sw"; + }; + + dontUnpack = true; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin + install -D $src $out/libexec/composer/composer.phar + makeWrapper ${php}/bin/php $out/bin/composer \ + --add-flags "$out/libexec/composer/composer.phar" \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.unzip ]} + ''; + + meta = with pkgs.lib; { + description = "Dependency Manager for PHP"; + license = licenses.mit; + homepage = "https://getcomposer.org/"; + maintainers = with maintainers; [ offline ] ++ teams.php.members; + }; +} diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 1713d1b777f1..7ba2c2d86aa2 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -35,34 +35,7 @@ in packages = { box = callPackage ../development/php-packages/box { }; - composer = mkDerivation rec { - version = "1.10.13"; - pname = "composer"; - - src = pkgs.fetchurl { - url = "https://getcomposer.org/download/${version}/composer.phar"; - sha256 = "13vhfdlkmpvmk1h30f1i688xk7sdgfj0b82am32jgpa8zmf499sw"; - }; - - dontUnpack = true; - - nativeBuildInputs = [ pkgs.makeWrapper ]; - - installPhase = '' - mkdir -p $out/bin - install -D $src $out/libexec/composer/composer.phar - makeWrapper ${php}/bin/php $out/bin/composer \ - --add-flags "$out/libexec/composer/composer.phar" \ - --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.unzip ]} - ''; - - meta = with pkgs.lib; { - description = "Dependency Manager for PHP"; - license = licenses.mit; - homepage = "https://getcomposer.org/"; - maintainers = with maintainers; [ offline ] ++ teams.php.members; - }; - }; + composer = callPackage ../development/php-packages/composer { }; composer2 = mkDerivation rec { version = "2.0.0-RC1";