treewide: handle postPhases __structuredAttrs-agnostically

Always specify the postPhases attribute as a list instead of a string.

Append elements to the postPhases Bash variable using appendToVar
instead of string or Bash array concatenation.
This commit is contained in:
Yueh-Shun Li 2024-09-03 04:14:28 +08:00
parent 054c5f0e10
commit 758056dac7
8 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation (
prefix = "/usr/local"; prefix = "/usr/local";
postPhases = "finalPhase"; postPhases = [ "finalPhase" ];
} }
// args // // args //

View File

@ -32,7 +32,7 @@ stdenv.mkDerivation (
showBuildStats = true; showBuildStats = true;
preConfigurePhases = [ "autoconfPhase" ]; preConfigurePhases = [ "autoconfPhase" ];
postPhases = "finalPhase"; postPhases = [ "finalPhase" ];
# Autoconfiscate the sources. # Autoconfiscate the sources.
autoconfPhase = '' autoconfPhase = ''

View File

@ -1,4 +1,4 @@
postPhases+=" cleanupBuildDir" appendToVar postPhases cleanupBuildDir
# Force GCC to build with coverage instrumentation. Also disable # Force GCC to build with coverage instrumentation. Also disable
# optimisation, since it may confuse things. # optimisation, since it may confuse things.

View File

@ -1,4 +1,4 @@
postPhases+=" coverageReportPhase" appendToVar postPhases coverageReportPhase
coverageReportPhase() { coverageReportPhase() {
lcov --directory . --capture --output-file app.info lcov --directory . --capture --output-file app.info

View File

@ -5,7 +5,7 @@ moveBuildDir() {
cd $out/.build cd $out/.build
} }
postPhases+=" removeBuildDir" appendToVar postPhases removeBuildDir
removeBuildDir() { removeBuildDir() {
rm -rf $out/.build rm -rf $out/.build

View File

@ -20,5 +20,5 @@ pythonRecompileBytecodePhase () {
} }
if [ -z "${dontUsePythonRecompileBytecode-}" ]; then if [ -z "${dontUsePythonRecompileBytecode-}" ]; then
postPhases+=" pythonRecompileBytecodePhase" appendToVar postPhases pythonRecompileBytecodePhase
fi fi

View File

@ -97,7 +97,7 @@ postPatchMkspecs() {
fi fi
} }
if [ -z "${dontPatchMkspecs-}" ]; then if [ -z "${dontPatchMkspecs-}" ]; then
postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs" appendToVar postPhases postPatchMkspecs
fi fi
qtPreHook() { qtPreHook() {

View File

@ -71,7 +71,7 @@ else # Only set up Qt once.
fi fi
} }
if [ -z "${dontPatchMkspecs-}" ]; then if [ -z "${dontPatchMkspecs-}" ]; then
postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs" appendToVar postPhases postPatchMkspecs
fi fi
qtPreHook() { qtPreHook() {