biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / build-managers / scons / setup-hook.sh
blobbfd8f3cc07b92629740a7403e91d39acb506a83f
1 # shellcheck shell=bash disable=SC2206
3 sconsBuildPhase() {
4 runHook preBuild
6 if [ -n "$prefix" ]; then
7 mkdir -p "$prefix"
8 fi
10 if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
11 buildFlags="${prefixKey:-prefix=}$prefix $buildFlags"
14 local flagsArray=(
15 ${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
16 $sconsFlags ${sconsFlagsArray[@]}
17 $buildFlags ${buildFlagsArray[@]}
20 echoCmd 'scons build flags' "${flagsArray[@]}"
21 scons "${flagsArray[@]}"
23 runHook postBuild
26 sconsInstallPhase() {
27 runHook preInstall
29 if [ -n "$prefix" ]; then
30 mkdir -p "$prefix"
33 if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
34 installFlags="${prefixKey:-prefix=}$prefix $installFlags"
37 local flagsArray=(
38 ${enableParallelInstalling:+-j${NIX_BUILD_CORES}}
39 $sconsFlags ${sconsFlagsArray[@]}
40 $installFlags ${installFlagsArray[@]}
41 ${installTargets:-install}
44 echoCmd 'scons install flags' "${flagsArray[@]}"
45 scons "${flagsArray[@]}"
47 runHook postInstall
50 sconsCheckPhase() {
51 runHook preCheck
53 if [ -z "${checkTarget:-}" ]; then
54 if scons -n check >/dev/null 2>&1; then
55 checkTarget="check"
56 elif scons -n test >/dev/null 2>&1; then
57 checkTarget="test"
61 if [ -z "${checkTarget:-}" ]; then
62 echo "no check/test target found, doing nothing"
63 else
64 local flagsArray=(
65 ${enableParallelChecking:+-j${NIX_BUILD_CORES}}
66 $sconsFlags ${sconsFlagsArray[@]}
67 ${checkFlagsArray[@]}
70 echoCmd 'scons check flags' "${flagsArray[@]}"
71 scons "${flagsArray[@]}"
74 runHook postCheck
77 if [ -z "${dontUseSconsBuild-}" ] && [ -z "${buildPhase-}" ]; then
78 buildPhase=sconsBuildPhase
81 if [ -z "${dontUseSconsCheck-}" ] && [ -z "${checkPhase-}" ]; then
82 checkPhase=sconsCheckPhase
85 if [ -z "${dontUseSconsInstall-}" ] && [ -z "${installPhase-}" ]; then
86 installPhase=sconsInstallPhase