1 # shellcheck shell=bash disable=SC2086,SC2154,SC2206
5 export MANDIR
="${!outputMan}/share/man"
15 ${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
17 $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
18 $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"}
21 echoCmd
'build flags' "${flagsArray[@]}"
22 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
30 if [ -z "${checkTarget:-}" ]; then
31 #TODO(@oxij): should flagsArray influence make -n?
32 if bmake
-n ${makefile:+-f $makefile} check
>/dev
/null
2>&1; then
34 elif bmake
-n ${makefile:+-f $makefile} test >/dev
/null
2>&1; then
39 if [ -z "${checkTarget:-}" ]; then
40 echo "no test target found in bmake, doing nothing"
43 ${enableParallelChecking:+-j${NIX_BUILD_CORES}}
45 # Old bash empty array hack
46 $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
47 ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"}
51 echoCmd
'check flags' "${flagsArray[@]}"
52 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
61 if [ -n "$prefix" ]; then
66 ${enableParallelInstalling:+-j${NIX_BUILD_CORES}}
68 # Old bash empty array hack
69 $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
70 $installFlags ${installFlagsArray+"${installFlagsArray[@]}"}
71 ${installTargets:-install}
74 echoCmd
'install flags' "${flagsArray[@]}"
75 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
83 if [ -n "$prefix" ]; then
87 # Old bash empty array hack
89 $distFlags ${distFlagsArray+"${distFlagsArray[@]}"} ${distTarget:-dist}
92 echo 'dist flags: %q' "${flagsArray[@]}"
93 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
95 if [ "${dontCopyDist:-0}" != 1 ]; then
96 mkdir
-p "$out/tarballs"
98 # Note: don't quote $tarballs, since we explicitly permit
100 cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs"
106 preConfigureHooks
+=(addMakeFlags
)
108 if [ -z "${dontUseBmakeBuild-}" ] && [ -z "${buildPhase-}" ]; then
109 buildPhase
=bmakeBuildPhase
112 if [ -z "${dontUseBmakeCheck-}" ] && [ -z "${checkPhase-}" ]; then
113 checkPhase
=bmakeCheckPhase
116 if [ -z "${dontUseBmakeInstall-}" ] && [ -z "${installPhase-}" ]; then
117 installPhase
=bmakeInstallPhase
120 if [ -z "${dontUseBmakeDist-}" ] && [ -z "${distPhase-}" ]; then
121 distPhase
=bmakeDistPhase