build-support/php: fix environment variables for Composer

This commit is contained in:
Pol Dellaiera 2024-09-23 09:20:42 +02:00
parent 3bcaabbb71
commit 07e6929c81
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
9 changed files with 17 additions and 32 deletions

View File

@ -94,12 +94,6 @@ let
or (if finalAttrs.composerRepository.composerLock == null then nix-update-script { } else null);
};
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_DISABLE_NETWORK = "1";
COMPOSER_MIRROR_PATH_REPOS = "1";
};
meta = previousAttrs.meta or { } // {
platforms = lib.platforms.all;
};

View File

@ -102,13 +102,6 @@ let
runHook postInstallCheck
'';
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "0";
};
outputHashMode = "recursive";
outputHashAlgo =
if (finalAttrs ? vendorHash && finalAttrs.vendorHash != "") then null else "sha256";

View File

@ -149,12 +149,6 @@ let
or (if finalAttrs.vendor.composerLock == null then nix-update-script { } else null);
};
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_DISABLE_NETWORK = "1";
COMPOSER_MIRROR_PATH_REPOS = "1";
};
meta = previousAttrs.meta or composer.meta;
};
in

View File

@ -100,6 +100,7 @@ composerInstallInstallHook() {
echo "Executing composerInstallInstallHook"
setComposeRootVersion
setComposeEnvVariables
# Finally, run `composer install` to install the dependencies and generate
# the autoloader.

View File

@ -13,6 +13,13 @@ setComposeRootVersion() {
set -e
}
setComposeEnvVariables() {
echo -e "\e[32mSetting some required environment variables for Composer...\e[0m"
export COMPOSER_MIRROR_PATH_REPOS=1
export COMPOSER_CACHE_DIR=/dev/null
export COMPOSER_HTACCESS_PROTECT=0
}
checkComposerValidate() {
setComposeRootVersion

View File

@ -94,12 +94,6 @@ let
or (if finalAttrs.composerVendor.composerLock == null then nix-update-script { } else null);
};
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_DISABLE_NETWORK = "1";
COMPOSER_MIRROR_PATH_REPOS = "1";
};
meta = previousAttrs.meta or { } // {
platforms = lib.platforms.all;
};

View File

@ -87,13 +87,6 @@ let
runHook postInstallCheck
'';
env = {
COMPOSER_CACHE_DIR = "/dev/null";
COMPOSER_MIRROR_PATH_REPOS = "1";
COMPOSER_HTACCESS_PROTECT = "0";
COMPOSER_DISABLE_NETWORK = "0";
};
outputHashMode = "recursive";
outputHashAlgo =
if (finalAttrs ? vendorHash && finalAttrs.vendorHash != "") then null else "sha256";

View File

@ -59,6 +59,8 @@ composerVendorConfigureHook() {
composerVendorBuildHook() {
echo "Executing composerVendorBuildHook"
setComposeEnvVariables
composer \
`# The acpu-autoloader is not reproducible and has to be disabled.` \
`# Upstream PR: https://github.com/composer/composer/pull/12090` \

View File

@ -13,6 +13,13 @@ setComposeRootVersion() {
set -e
}
setComposeEnvVariables() {
echo -e "\e[32mSetting some required environment variables for Composer...\e[0m"
export COMPOSER_MIRROR_PATH_REPOS=1
export COMPOSER_CACHE_DIR=/dev/null
export COMPOSER_HTACCESS_PROTECT=0
}
checkComposerValidate() {
if [ "1" == "${composerGlobal-}" ]; then
global="global";