diff --git a/pkgs/development/php-packages/composer/default.nix b/pkgs/development/php-packages/composer/default.nix index d9d431aeccc..fd26cc0e484 100644 --- a/pkgs/development/php-packages/composer/default.nix +++ b/pkgs/development/php-packages/composer/default.nix @@ -1,4 +1,4 @@ -{ lib, callPackage, fetchFromGitHub, php, unzip, _7zz, xz, git, curl, cacert, makeBinaryWrapper }: +{ lib, callPackage, fetchgit, php, unzip, _7zz, xz, git, curl, cacert, makeBinaryWrapper }: php.buildComposerProject (finalAttrs: { composer = callPackage ../../../build-support/php/pkgs/composer-phar.nix { }; @@ -6,11 +6,14 @@ php.buildComposerProject (finalAttrs: { pname = "composer"; version = "2.6.4"; - src = fetchFromGitHub { - owner = "composer"; - repo = "composer"; + + # We use `fetchgit` instead of `fetchFromGitHub` to ensure the existence + # of the `composer.lock` file, which is omitted in the archive downloaded + # via `fetchFromGitHub`. + src = fetchgit { + url = "https://github.com/composer/composer.git"; rev = finalAttrs.version; - hash = "sha256-o7z2GBiYjTwDQR9ZFuOOV8zsKUuGqyA52dvwTzo4hVA="; + hash = "sha256-8lylMfTARff+gBZpIRqttmE0jeXdJnLHZKVmqHY3p+s="; }; nativeBuildInputs = [ makeBinaryWrapper ]; @@ -20,7 +23,7 @@ php.buildComposerProject (finalAttrs: { --prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]} ''; - vendorHash = "sha256-S6LprixkLIbD+qqvg+eYjWsDe+jFl9NO1qWztWYKPXs="; + vendorHash = "sha256-SG5RsKaP7zqJY2vjvULuNdf7w6tAGh7/dlxx2Pkfj2A="; meta = { changelog = "https://github.com/composer/composer/releases/tag/${finalAttrs.version}";