about summary refs log tree commit diff
path: root/pkgs/development/php-packages
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2023-10-06 19:58:12 +0200
committerElis Hirwing <elis@hirwing.se>2023-10-06 20:09:48 +0200
commitf0987a05a964772c4b45a1a6c35b60091637ef81 (patch)
treea84a858893fa849373160c52e25511ccf90e960e /pkgs/development/php-packages
parent13441fc1f5257c92ca09a3498f9f40b0ed70dff6 (diff)
downloadnixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar.gz
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar.bz2
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar.lz
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar.xz
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.tar.zst
nixlib-f0987a05a964772c4b45a1a6c35b60091637ef81.zip
php.packages.composer: Make sure that both composers use the same version
So in php we have a bootstrapping composer (that lives in
composer-phar.nix) that downloads the binary distribution of composer
to be able to bootstrap and build a composer built from source.

However, it's desirable to keep composer updated at all time, and this
includes the phar one that isn't used by users directly. So this makes
sure we don't "forget" about the phar one since it now borrows the
version from the source version. However, then it also made sense to
move the hash for the phar to the same file as the source
composer. Then we can control the full upgrade life cycle of both the
phar and source versions of composer from the same file.
Diffstat (limited to 'pkgs/development/php-packages')
-rw-r--r--pkgs/development/php-packages/composer/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/php-packages/composer/default.nix b/pkgs/development/php-packages/composer/default.nix
index 8a78102876d2..40c6dc80fadf 100644
--- a/pkgs/development/php-packages/composer/default.nix
+++ b/pkgs/development/php-packages/composer/default.nix
@@ -1,7 +1,16 @@
 { lib, callPackage, fetchFromGitHub, php, unzip, _7zz, xz, git, curl, cacert, makeBinaryWrapper }:
 
 php.buildComposerProject (finalAttrs: {
-  composer = callPackage ../../../build-support/php/pkgs/composer-phar.nix { };
+  # Hash used by ../../../build-support/php/pkgs/composer-phar.nix to
+  # use together with the version from this package to keep the
+  # bootstrap phar file up-to-date together with the end user composer
+  # package.
+  passthru.pharHash = "sha256-mhjho6rby5TBuv1sSpj/kx9LQ6RW70hXUTBGbhnwXdY=";
+
+  composer = callPackage ../../../build-support/php/pkgs/composer-phar.nix {
+    inherit (finalAttrs) version;
+    inherit (finalAttrs.passthru) pharHash;
+  };
 
   pname = "composer";
   version = "2.6.5";