php.buildEnv: Add phpIni attribute for easy access to the php.ini

This commit is contained in:
talyz 2020-04-24 19:34:34 +02:00
parent d61040716e
commit c3d5d92f4a
No known key found for this signature in database
GPG Key ID: 2DED2151F4671A2B
2 changed files with 4 additions and 3 deletions

View File

@ -338,7 +338,7 @@ let
}
''
cat ${php}/etc/php.ini > $out
cat ${php}/lib/custom-php.ini > $out
cat ${php.phpIni} > $out
echo "$options" >> $out
'';

View File

@ -105,7 +105,7 @@ let
(enabledExtensions ++ (getDepsRecursively enabledExtensions)));
extNames = map getExtName enabledExtensions;
extraInit = writeText "custom-php.ini" ''
extraInit = writeText "php.ini" ''
${lib.concatStringsSep "\n"
(lib.textClosureList extensionTexts extNames)}
${extraConfig}
@ -118,11 +118,12 @@ let
passthru = {
buildEnv = mkBuildEnv allArgs allExtensionFunctions;
withExtensions = mkWithExtensions allArgs allExtensionFunctions;
phpIni = "${phpWithExtensions}/lib/php.ini";
inherit (php-packages) packages extensions;
};
paths = [ php ];
postBuild = ''
cp ${extraInit} $out/lib/custom-php.ini
cp ${extraInit} $out/lib/php.ini
wrapProgram $out/bin/php --set PHP_INI_SCAN_DIR $out/lib