2023-10-09 19:29:22 +00:00
|
|
|
{ callPackage, stdenvNoCC, lib, writeTextDir, php, makeBinaryWrapper, fetchFromGitHub, fetchurl }:
|
|
|
|
|
|
|
|
let
|
|
|
|
buildComposerProjectOverride = finalAttrs: previousAttrs:
|
|
|
|
|
|
|
|
let
|
|
|
|
phpDrv = finalAttrs.php or php;
|
|
|
|
composer = finalAttrs.composer or phpDrv.packages.composer;
|
|
|
|
composer-local-repo-plugin = callPackage ./pkgs/composer-local-repo-plugin.nix { };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
composerLock = previousAttrs.composerLock or null;
|
|
|
|
composerNoDev = previousAttrs.composerNoDev or true;
|
|
|
|
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
|
|
|
composerNoScripts = previousAttrs.composerNoScripts or true;
|
2023-11-16 04:20:00 +00:00
|
|
|
composerStrictValidation = previousAttrs.composerStrictValidation or true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [
|
|
|
|
composer
|
|
|
|
composer-local-repo-plugin
|
2023-10-19 13:55:26 +00:00
|
|
|
phpDrv
|
2023-10-09 19:29:22 +00:00
|
|
|
phpDrv.composerHooks.composerInstallHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = (previousAttrs.buildInputs or [ ]) ++ [
|
|
|
|
phpDrv
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = previousAttrs.patches or [ ];
|
|
|
|
strictDeps = previousAttrs.strictDeps or true;
|
|
|
|
|
|
|
|
# Should we keep these empty phases?
|
|
|
|
configurePhase = previousAttrs.configurePhase or ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = previousAttrs.buildPhase or ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = previousAttrs.doCheck or true;
|
|
|
|
checkPhase = previousAttrs.checkPhase or ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = previousAttrs.installPhase or ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
doInstallCheck = previousAttrs.doInstallCheck or false;
|
|
|
|
installCheckPhase = previousAttrs.installCheckPhase or ''
|
|
|
|
runHook preCheckInstall
|
|
|
|
|
|
|
|
runHook postCheckInstall
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
composerRepository = phpDrv.mkComposerRepository {
|
|
|
|
inherit composer composer-local-repo-plugin;
|
|
|
|
inherit (finalAttrs) patches pname src vendorHash version;
|
|
|
|
|
|
|
|
composerLock = previousAttrs.composerLock or null;
|
|
|
|
composerNoDev = previousAttrs.composerNoDev or true;
|
|
|
|
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
|
|
|
composerNoScripts = previousAttrs.composerNoScripts or true;
|
2023-11-16 04:20:00 +00:00
|
|
|
composerStrictValidation = previousAttrs.composerStrictValidation or true;
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
COMPOSER_CACHE_DIR="/dev/null";
|
|
|
|
COMPOSER_DISABLE_NETWORK="1";
|
|
|
|
COMPOSER_MIRROR_PATH_REPOS="1";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = previousAttrs.meta or { } // {
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
args: (stdenvNoCC.mkDerivation args).overrideAttrs buildComposerProjectOverride
|