evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sc / scons / setup-hook.sh
blob3cdb7da42453ba0980b5daca6972d771244335da
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 prependToVar buildFlags "${prefixKey:-prefix=}$prefix"
14 local flagsArray=(
15 ${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
17 concatTo flagsArray sconsFlags sconsFlagsArray buildFlags buildFlagsArray
19 echoCmd 'scons build flags' "${flagsArray[@]}"
20 scons "${flagsArray[@]}"
22 runHook postBuild
25 sconsInstallPhase() {
26 runHook preInstall
28 if [ -n "$prefix" ]; then
29 mkdir -p "$prefix"
32 if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
33 prependToVar installFlags "${prefixKey:-prefix=}$prefix"
36 local flagsArray=(
37 ${enableParallelInstalling:+-j${NIX_BUILD_CORES}}
39 concatTo flagsArray sconsFlags sconsFlagsArray installFlags installFlagsArray installTargets=install
41 echoCmd 'scons install flags' "${flagsArray[@]}"
42 scons "${flagsArray[@]}"
44 runHook postInstall
47 sconsCheckPhase() {
48 runHook preCheck
50 if [ -z "${checkTarget:-}" ]; then
51 if scons -n check >/dev/null 2>&1; then
52 checkTarget="check"
53 elif scons -n test >/dev/null 2>&1; then
54 checkTarget="test"
58 if [ -z "${checkTarget:-}" ]; then
59 echo "no check/test target found, doing nothing"
60 else
61 local flagsArray=(
62 ${enableParallelChecking:+-j${NIX_BUILD_CORES}}
64 concatTo flagsArray sconsFlags sconsFlagsArray checkFlagsArray checkTarget
66 echoCmd 'scons check flags' "${flagsArray[@]}"
67 scons "${flagsArray[@]}"
70 runHook postCheck
73 if [ -z "${dontUseSconsBuild-}" ] && [ -z "${buildPhase-}" ]; then
74 buildPhase=sconsBuildPhase
77 if [ -z "${dontUseSconsCheck-}" ] && [ -z "${checkPhase-}" ]; then
78 checkPhase=sconsCheckPhase
81 if [ -z "${dontUseSconsInstall-}" ] && [ -z "${installPhase-}" ]; then
82 installPhase=sconsInstallPhase