depot/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

50 lines
1.3 KiB
Bash

. @fix_qmake_libtool@
qmakePrePhase() {
# These flags must be added _before_ the flags specified in the derivation.
prependToVar qmakeFlags \
"PREFIX=$out" \
"NIX_OUTPUT_OUT=$out" \
"NIX_OUTPUT_DEV=${!outputDev}" \
"NIX_OUTPUT_BIN=${!outputBin}" \
"NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}"
if [ -n "@debug@" ]; then
prependToVar qmakeFlags "CONFIG+=debug"
else
prependToVar qmakeFlags "CONFIG+=release"
fi
# do the stripping ourselves (needed for separateDebugInfo)
prependToVar qmakeFlags "CONFIG+=nostrip"
}
appendToVar prePhases qmakePrePhase
qmakeConfigurePhase() {
runHook preConfigure
local flagsArray=()
concatTo flagsArray qmakeFlags
echo "QMAKEPATH=$QMAKEPATH"
echo qmake "${flagsArray[@]}"
qmake "${flagsArray[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "qmake: enabled parallel building"
fi
if ! [[ -v enableParallelInstalling ]]; then
enableParallelInstalling=1
echo "qmake: enabled parallel installing"
fi
runHook postConfigure
}
if [ -z "${dontUseQmakeConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=qmakeConfigurePhase
fi