8 mkComposerVendorOverride =
10 We cannot destruct finalAttrs since the attrset below is used to construct it
11 and Nix currently does not support lazy attribute names.
15 composerLock ? "composer.lock",
21 finalAttrs: previousAttrs:
24 phpDrv = finalAttrs.php or php;
25 composer = finalAttrs.composer or phpDrv.packages.composer;
27 assert (lib.assertMsg (previousAttrs ? src) "mkComposerVendor expects src argument.");
28 assert (lib.assertMsg (previousAttrs ? vendorHash) "mkComposerVendor expects vendorHash argument.");
29 assert (lib.assertMsg (previousAttrs ? version) "mkComposerVendor expects version argument.");
30 assert (lib.assertMsg (previousAttrs ? pname) "mkComposerVendor expects pname argument.");
32 composerNoDev = previousAttrs.composerNoDev or true;
33 composerNoPlugins = previousAttrs.composerNoPlugins or true;
34 composerNoScripts = previousAttrs.composerNoScripts or true;
35 composerStrictValidation = previousAttrs.composerStrictValidation or true;
37 name = "${previousAttrs.pname}-${previousAttrs.version}-composer-repository";
39 # See https://github.com/NixOS/nix/issues/6660
40 dontPatchShebangs = previousAttrs.dontPatchShebangs or true;
42 nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [
45 phpDrv.composerHooks2.composerVendorHook
48 buildInputs = previousAttrs.buildInputs or [ ];
50 strictDeps = previousAttrs.strictDeps or true;
52 # Should we keep these empty phases?
54 previousAttrs.configurePhase or ''
61 previousAttrs.buildPhase or ''
67 doCheck = previousAttrs.doCheck or true;
69 previousAttrs.checkPhase or ''
76 previousAttrs.installPhase or ''
82 doInstallCheck = previousAttrs.doInstallCheck or false;
84 previousAttrs.installCheckPhase or ''
85 runHook preInstallCheck
87 runHook postInstallCheck
90 outputHashMode = "recursive";
92 if (finalAttrs ? vendorHash && finalAttrs.vendorHash != "") then null else "sha256";
93 outputHash = finalAttrs.vendorHash or "";
96 args: (stdenvNoCC.mkDerivation args).overrideAttrs mkComposerVendorOverride