1 # shellcheck shell=bash disable=SC2086,SC2154,SC2206
5 export MANDIR
="${!outputMan}/share/man"
15 ${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
18 concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray
20 nixInfoLog
"${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
21 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
29 if [ -z "${checkTarget:-}" ]; then
30 #TODO(@oxij): should flagsArray influence make -n?
31 if bmake
-n ${makefile:+-f $makefile} check
>/dev
/null
2>&1; then
33 elif bmake
-n ${makefile:+-f $makefile} test >/dev
/null
2>&1; then
38 if [ -z "${checkTarget:-}" ]; then
39 nixInfoLog
"${FUNCNAME[0]}: no test target found in bmake, doing nothing"
42 ${enableParallelChecking:+-j${NIX_BUILD_CORES}}
45 concatTo flagsArray makeFlags makeFlagsArray checkFlags
=VERBOSE
=y checkFlagsArray checkTarget
47 nixInfoLog
"${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
48 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
57 if [ -n "$prefix" ]; then
62 ${enableParallelInstalling:+-j${NIX_BUILD_CORES}}
65 concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets
=install
67 nixInfoLog
"${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
68 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
76 if [ -n "$prefix" ]; then
81 concatTo flagsArray distFlags distFlagsArray distTarget
=dist
83 nixInfoLog
"${FUNCNAME[0]}: flagsArray: ${flagsArray[@]}"
84 bmake
${makefile:+-f $makefile} "${flagsArray[@]}"
86 if [ "${dontCopyDist:-0}" != 1 ]; then
87 mkdir
-p "$out/tarballs"
89 # Note: don't quote $tarballs, since we explicitly permit
91 cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs"
97 preConfigureHooks
+=(addMakeFlags
)
99 if [ -z "${dontUseBmakeBuild-}" ] && [ -z "${buildPhase-}" ]; then
100 buildPhase
=bmakeBuildPhase
101 nixInfoLog
"${FUNCNAME[0]}: set buildPhase to bmakeBuildPhase"
104 if [ -z "${dontUseBmakeCheck-}" ] && [ -z "${checkPhase-}" ]; then
105 checkPhase
=bmakeCheckPhase
106 nixInfoLog
"${FUNCNAME[0]}: set checkPhase to bmakeCheckPhase"
109 if [ -z "${dontUseBmakeInstall-}" ] && [ -z "${installPhase-}" ]; then
110 installPhase
=bmakeInstallPhase
111 nixInfoLog
"${FUNCNAME[0]}: set installPhase to bmakeInstallPhase"
114 if [ -z "${dontUseBmakeDist-}" ] && [ -z "${distPhase-}" ]; then
115 distPhase
=bmakeDistPhase
116 nixInfoLog
"${FUNCNAME[0]}: set distPhase to bmakeDistPhase"