2023-08-09 19:07:30 +00:00
|
|
|
{ callPackage, stdenvNoCC, lib, writeTextDir, php, makeBinaryWrapper, fetchFromGitHub, fetchurl }:
|
2023-04-09 09:53:42 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
buildComposerProjectOverride = finalAttrs: previousAttrs:
|
|
|
|
|
|
|
|
let
|
|
|
|
phpDrv = finalAttrs.php or php;
|
|
|
|
composer = finalAttrs.composer or phpDrv.packages.composer;
|
2023-08-10 07:10:00 +00:00
|
|
|
composer-local-repo-plugin = callPackage ./pkgs/composer-local-repo-plugin.nix { };
|
2023-04-09 09:53:42 +00:00
|
|
|
in
|
|
|
|
{
|
2023-08-21 10:19:17 +00:00
|
|
|
composerLock = previousAttrs.composerLock or null;
|
|
|
|
composerNoDev = previousAttrs.composerNoDev or true;
|
|
|
|
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
|
|
|
composerNoScripts = previousAttrs.composerNoScripts or true;
|
2023-10-20 21:36:26 +00:00
|
|
|
composerStrictValidation = previousAttrs.composerStrictValidation or true;
|
2023-08-21 10:19:17 +00:00
|
|
|
|
2023-04-09 09:53:42 +00:00
|
|
|
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [
|
|
|
|
composer
|
|
|
|
composer-local-repo-plugin
|
2023-10-17 09:08:10 +00:00
|
|
|
phpDrv
|
2023-04-09 09:53:42 +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-16 20:07:52 +00:00
|
|
|
doInstallCheck = previousAttrs.doInstallCheck or false;
|
2023-10-16 15:13:34 +00:00
|
|
|
installCheckPhase = previousAttrs.installCheckPhase or ''
|
2024-02-15 21:26:18 +00:00
|
|
|
runHook preInstallCheck
|
2023-10-16 15:13:34 +00:00
|
|
|
|
2024-02-15 21:26:18 +00:00
|
|
|
runHook postInstallCheck
|
2023-10-16 15:13:34 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-09 09:53:42 +00:00
|
|
|
composerRepository = phpDrv.mkComposerRepository {
|
2023-08-21 10:19:17 +00:00
|
|
|
inherit composer composer-local-repo-plugin;
|
2023-04-09 09:53:42 +00:00
|
|
|
inherit (finalAttrs) patches pname src vendorHash version;
|
2023-08-21 10:19:17 +00:00
|
|
|
|
|
|
|
composerLock = previousAttrs.composerLock or null;
|
|
|
|
composerNoDev = previousAttrs.composerNoDev or true;
|
|
|
|
composerNoPlugins = previousAttrs.composerNoPlugins or true;
|
|
|
|
composerNoScripts = previousAttrs.composerNoScripts or true;
|
2023-10-20 21:36:26 +00:00
|
|
|
composerStrictValidation = previousAttrs.composerStrictValidation or true;
|
2023-04-09 09:53:42 +00:00
|
|
|
};
|
|
|
|
|
2023-10-17 06:48:58 +00:00
|
|
|
COMPOSER_CACHE_DIR="/dev/null";
|
|
|
|
COMPOSER_DISABLE_NETWORK="1";
|
|
|
|
COMPOSER_MIRROR_PATH_REPOS="1";
|
|
|
|
|
2023-04-09 09:53:42 +00:00
|
|
|
meta = previousAttrs.meta or { } // {
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
args: (stdenvNoCC.mkDerivation args).overrideAttrs buildComposerProjectOverride
|