about summary refs log tree commit diff
path: root/pkgs/development/php-packages/composer
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2020-10-11 16:37:09 +0200
committerElis Hirwing <elis@hirwing.se>2020-10-11 17:03:40 +0200
commita149fe969ced4049edc54c7630c19bce8234b04e (patch)
tree1257e49fe9fa923b1622e5727af1f76309025b04 /pkgs/development/php-packages/composer
parent5c8e29da49a08631c2bda58d35df2f4da53e2f89 (diff)
phpPackages.composer: Move to separate directory
Diffstat (limited to 'pkgs/development/php-packages/composer')
-rw-r--r--pkgs/development/php-packages/composer/default.nix32
1 files changed, 32 insertions, 0 deletions
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;
+  };
+}