Skip to content

Commit

Permalink
treewide: *Phase(s)? variables are optional
Browse files Browse the repository at this point in the history
If these aren't defined, the stdenv defaults are used in the `*Phase`
case, or no extra phases are done, in the `*Phases` case.
  • Loading branch information
Ericson2314 committed Oct 31, 2019
1 parent 0d6f2ce commit 7fe5b45
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ flitBuildPhase () {
echo "Finished executing flitBuildPhase"
}

if [ -z "${dontUseFlitBuild-}" ] && [ -z "$buildPhase" ]; then
if [ -z "${dontUseFlitBuild-}" ] && [ -z "${buildPhase-}" ]; then
echo "Using flitBuildPhase"
buildPhase=flitBuildPhase
fi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pipShellHook() {
echo "Finished executing pipShellHook"
}

if [ -z "${dontUsePipBuild-}" ] && [ -z "$buildPhase" ]; then
if [ -z "${dontUsePipBuild-}" ] && [ -z "${buildPhase-}" ]; then
echo "Using pipBuildPhase"
buildPhase=pipBuildPhase
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipInstallPhase() {
echo "Finished executing pipInstallPhase"
}

if [ -z "${dontUsePipInstall-}" ] && [ -z "$installPhase" ]; then
if [ -z "${dontUsePipInstall-}" ] && [ -z "${installPhase-}" ]; then
echo "Using pipInstallPhase"
installPhase=pipInstallPhase
fi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function pytestCheckPhase() {
echo "Finished executing pytestCheckPhase"
}

if [ -z "${dontUsePytestCheck-}" ] && [ -z "$installCheckPhase" ]; then
if [ -z "${dontUsePytestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using pytestCheckPhase"
preDistPhases+=" pytestCheckPhase"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ setuptoolsShellHook() {
echo "Finished executing setuptoolsShellHook"
}

if [ -z "${dontUseSetuptoolsBuild-}" ] && [ -z "$buildPhase" ]; then
if [ -z "${dontUseSetuptoolsBuild-}" ] && [ -z "${buildPhase-}" ]; then
echo "Using setuptoolsBuildPhase"
buildPhase=setuptoolsBuildPhase
fi

if [ -z "${dontUseSetuptoolsShellHook-}" ] && [ -z "$shellHook" ]; then
if [ -z "${dontUseSetuptoolsShellHook-}" ] && [ -z "${shellHook-}" ]; then
echo "Using setuptoolsShellHook"
shellHook=setuptoolsShellHook
fi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setuptoolsCheckPhase() {
echo "Finished executing setuptoolsCheckPhase"
}

if [ -z "${dontUseSetuptoolsCheck-}" ] && [ -z "$installCheckPhase" ]; then
if [ -z "${dontUseSetuptoolsCheck-}" ] && [ -z "${installCheckPhase-}" ]; then
echo "Using setuptoolsCheckPhase"
preDistPhases+=" setuptoolsCheckPhase"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ wheelUnpackPhase(){
echo "Finished executing wheelUnpackPhase"
}

if [ -z "${dontUseWheelUnpack-}" ] && [ -z "$unpackPhase" ]; then
if [ -z "${dontUseWheelUnpack-}" ] && [ -z "${unpackPhase-}" ]; then
echo "Using wheelUnpackPhase"
unpackPhase=wheelUnpackPhase
fi
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dropIconThemeCache() {
fi
}

preFixupPhases="$preFixupPhases dropIconThemeCache"
preFixupPhases="${preFixupPhases-} dropIconThemeCache"
2 changes: 1 addition & 1 deletion pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ qmakeConfigurePhase() {
runHook postConfigure
}

if [ -z "${dontUseQmakeConfigure-}" -a -z "$configurePhase" ]; then
if [ -z "${dontUseQmakeConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=qmakeConfigurePhase
fi
4 changes: 2 additions & 2 deletions pkgs/development/tools/build-managers/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ cmakeConfigurePhase() {
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON $cmakeFlags"

if [ "$buildPhase" = ninjaBuildPhase ]; then
if [ "${buildPhase-}" = ninjaBuildPhase ]; then
cmakeFlags="-GNinja $cmakeFlags"
fi

Expand All @@ -115,7 +115,7 @@ cmakeConfigurePhase() {
runHook postConfigure
}

if [ -z "${dontUseCmakeConfigure-}" -a -z "$configurePhase" ]; then
if [ -z "${dontUseCmakeConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/build-managers/gn/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ gnConfigurePhase() {
runHook postConfigure
}

if [ -z "${dontUseGnConfigure-}" -a -z "$configurePhase" ]; then
if [ -z "${dontUseGnConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=gnConfigurePhase
fi
2 changes: 1 addition & 1 deletion pkgs/development/tools/build-managers/meson/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mesonConfigurePhase() {
runHook postConfigure
}

if [ -z "${dontUseMesonConfigure-}" -a -z "$configurePhase" ]; then
if [ -z "${dontUseMesonConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=mesonConfigurePhase
fi
6 changes: 3 additions & 3 deletions pkgs/development/tools/build-managers/ninja/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ninjaBuildPhase() {
runHook postBuild
}

if [ -z "$[dontUseNinjaBuild-}" -a -z "$buildPhase" ]; then
if [ -z "${dontUseNinjaBuild-}" -a -z "${buildPhase-}" ]; then
buildPhase=ninjaBuildPhase
fi

Expand All @@ -38,7 +38,7 @@ ninjaInstallPhase() {
runHook postInstall
}

if [ -z "${dontUseNinjaInstall-}" -a -z "$installPhase" ]; then
if [ -z "${dontUseNinjaInstall-}" -a -z "${installPhase-}" ]; then
installPhase=ninjaInstallPhase
fi

Expand Down Expand Up @@ -73,6 +73,6 @@ ninjaCheckPhase() {
runHook postCheck
}

if [ -z "${dontUseNinjaCheck-}" -a -z "$checkPhase" ]; then
if [ -z "${dontUseNinjaCheck-}" -a -z "${checkPhase-}" ]; then
checkPhase=ninjaCheckPhase
fi
6 changes: 3 additions & 3 deletions pkgs/development/tools/build-managers/scons/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ sconsCheckPhase() {
runHook postCheck
}

if [ -z "$buildPhase" ]; then
if [ -z "${buildPhase-}" ]; then
buildPhase=sconsBuildPhase
fi

if [ -z "${dontUseSconsInstall-}" -a -z "$installPhase" ]; then
if [ -z "${dontUseSconsInstall-}" -a -z "${installPhase-}" ]; then
installPhase=sconsInstallPhase
fi

if [ -z "$checkPhase" ]; then
if [ -z "${checkPhase-}" ]; then
checkPhase=sconsCheckPhase
fi
2 changes: 1 addition & 1 deletion pkgs/development/tools/misc/premake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ premakeConfigurePhase() {
runHook postConfigure
}

if [ -z "$configurePhase" ]; then
if [ -z "${configurePhase-}" ]; then
configurePhase=premakeConfigurePhase
fi
2 changes: 1 addition & 1 deletion pkgs/development/tools/xcbuild/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ xcbuildInstallPhase () {
}

buildPhase=xcbuildBuildPhase
if [ -z "$installPhase" ]; then
if [ -z "${installPhase-}" ]; then
installPhase=xcbuildInstallPhase
fi

Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/x11/xorg/imake-setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ imakeConfigurePhase() {
runHook postConfigure
}

if [ -z "${dontUseImakeConfigure-}" -a -z "$configurePhase" ]; then
if [ -z "${dontUseImakeConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=imakeConfigurePhase
fi
2 changes: 1 addition & 1 deletion pkgs/tools/misc/desktop-file-utils/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mimeinfoPreFixupPhase() {
rm -f $out/share/applications/mimeinfo.cache
}

preFixupPhases="$preFixupPhases mimeinfoPreFixupPhase"
preFixupPhases="${preFixupPhases-} mimeinfoPreFixupPhase"

0 comments on commit 7fe5b45

Please sign in to comment.