treewide: handle prePhases __structuredAttrs-agnostically

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

Append elements to the prePhases 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 e2fffc8362
commit 21c0129841
10 changed files with 11 additions and 11 deletions

View File

@ -17,7 +17,7 @@ let
pluginDerivation = attrs: let
name = attrs.name or "${attrs.pname}-${attrs.version}";
in stdenv.mkDerivation ({
prePhases = "extraLib";
prePhases = [ "extraLib" ];
extraLib = ''
installScripts(){
mkdir -p $out/${gimp.targetScriptDir}/${name};
@ -54,7 +54,7 @@ let
});
scriptDerivation = {src, ...}@attrs : pluginDerivation ({
prePhases = "extraLib";
prePhases = [ "extraLib" ];
dontUnpack = true;
installPhase = ''
runHook preInstall

View File

@ -18,7 +18,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
prefix = "/usr";
prePhases = "installExtraDebsPhase sysInfoPhase";
prePhases = [ "installExtraDebsPhase" "sysInfoPhase" ];
}
// removeAttrs args ["vmTools" "lib"] //

View File

@ -1,4 +1,4 @@
prePhases+=" moveBuildDir"
appendToVar prePhases moveBuildDir
moveBuildDir() {
mkdir -p $out/.build

View File

@ -1,4 +1,4 @@
prePhases+=" moveBuildDir"
appendToVar prePhases moveBuildDir
moveBuildDir() {
mkdir -p $out/.build

View File

@ -18,7 +18,7 @@ echoCmd "HAREPATH" "$HAREPATH"
echoCmd "hare" "$(command -v hare)"
echoCmd "hare-native" "$(command -v hare-native)"
'
prePhases+=("hareSetStdlibPhase" "hareInfoPhase")
appendToVar prePhases hareSetStdlibPhase hareInfoPhase
readonly hare_unconditional_flags="@hare_unconditional_flags@"
case "${hareBuildType:-"release"}" in

View File

@ -73,6 +73,6 @@ configureNuget() {
}
if [[ -z ${dontConfigureNuget-} ]]; then
prePhases+=(createNugetDirs)
appendToVar prePhases createNugetDirs
preConfigurePhases+=(configureNuget)
fi

View File

@ -20,7 +20,7 @@ qmakePrePhase() {
# do the stripping ourselves (needed for separateDebugInfo)
prependToVar qmakeFlags "CONFIG+=nostrip"
}
prePhases+=" qmakePrePhase"
appendToVar prePhases qmakePrePhase
qmakeConfigurePhase() {
runHook preConfigure

View File

@ -107,6 +107,6 @@ qtPreHook() {
exit 1
fi
}
prePhases+=" qtPreHook"
appendToVar prePhases qtPreHook
fi

View File

@ -13,7 +13,7 @@ qmakePrePhase() {
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}"
}
prePhases+=" qmakePrePhase"
appendToVar prePhases qmakePrePhase
qmakeConfigurePhase() {
runHook preConfigure

View File

@ -81,7 +81,7 @@ else # Only set up Qt once.
exit 1
fi
}
prePhases+=" qtPreHook"
appendToVar prePhases qtPreHook
addQtModulePrefix() {
addToSearchPath QT_ADDITIONAL_PACKAGES_PREFIX_PATH $1