Merge pull request #309314 from drupol/php/build-support/minor-changes

build-support/php: minor refactoring
This commit is contained in:
Pol Dellaiera 2024-05-05 19:06:37 +02:00 committed by GitHub
commit c5a8fd5df4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 35 additions and 31 deletions

View File

@ -2,11 +2,8 @@
callPackage,
stdenvNoCC,
lib,
writeTextDir,
php,
makeBinaryWrapper,
fetchFromGitHub,
fetchurl,
}:
let
@ -75,27 +72,30 @@ let
runHook postInstallCheck
'';
composerRepository = phpDrv.mkComposerRepository {
inherit composer composer-local-repo-plugin;
inherit (finalAttrs)
patches
pname
src
vendorHash
version
;
composerRepository =
previousAttrs.composerRepository or (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;
composerStrictValidation = previousAttrs.composerStrictValidation or true;
composerLock = previousAttrs.composerLock or null;
composerNoDev = previousAttrs.composerNoDev or true;
composerNoPlugins = previousAttrs.composerNoPlugins or true;
composerNoScripts = previousAttrs.composerNoScripts or true;
composerStrictValidation = previousAttrs.composerStrictValidation or true;
});
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_DISABLE_NETWORK = "1";
COMPOSER_MIRROR_PATH_REPOS = "1";
};
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_DISABLE_NETWORK = "1";
COMPOSER_MIRROR_PATH_REPOS = "1";
meta = previousAttrs.meta or { } // {
platforms = lib.platforms.all;
};

View File

@ -2,7 +2,6 @@
callPackage,
stdenvNoCC,
lib,
writeTextDir,
fetchFromGitHub,
php,
}:
@ -107,10 +106,12 @@ let
runHook postInstallCheck
'';
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "0";
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "0";
};
outputHashMode = "recursive";
outputHashAlgo =

View File

@ -43,10 +43,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
hash = "sha256-edbn07r/Uc1g0qOuVBZBs6N1bMN5kIfA1b4FCufdw5M=";
};
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "1";
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "1";
};
nativeBuildInputs = [ makeBinaryWrapper ];

View File

@ -32,7 +32,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
mkdir -p $out/bin
install -D $src $out/libexec/composer/composer.phar
makeWrapper ${php}/bin/php $out/bin/composer \
makeWrapper ${lib.getExe php} $out/bin/composer \
--add-flags "$out/libexec/composer/composer.phar" \
--prefix PATH : ${
lib.makeBinPath [
@ -53,6 +53,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
description = "Dependency Manager for PHP, shipped from the PHAR file";
homepage = "https://getcomposer.org/";
license = lib.licenses.mit;
mainProgram = "composer";
maintainers = with lib.maintainers; [ drupol ];
platforms = lib.platforms.all;
};