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";
postPhases = "finalPhase";
postPhases = [ "finalPhase" ];
}
// args //

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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