qt: support structuredAttrs in qmake hook

Tested qbs with and without __structuredAttrs.
This commit is contained in:
Wolfgang Walther 2024-06-12 18:31:45 +02:00
parent 5b370227d1
commit 1bcca7d66b
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
3 changed files with 29 additions and 37 deletions

View File

@ -1,40 +1,36 @@
. @fix_qmake_libtool@
qmakeFlags=( ${qmakeFlags-} )
qmakePrePhase() {
qmakeFlags_orig=( "${qmakeFlags[@]}" )
# These flags must be added _before_ the flags specified in the derivation.
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:?}" \
)
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
qmakeFlags+=( "CONFIG+=debug" )
prependToVar qmakeFlags "CONFIG+=debug"
else
qmakeFlags+=( "CONFIG+=release" )
prependToVar qmakeFlags "CONFIG+=release"
fi
# do the stripping ourselves (needed for separateDebugInfo)
qmakeFlags+=( "CONFIG+=nostrip" )
qmakeFlags+=( "${qmakeFlags_orig[@]}" )
prependToVar qmakeFlags "CONFIG+=nostrip"
}
prePhases+=" qmakePrePhase"
qmakeConfigurePhase() {
runHook preConfigure
local flagsArray=()
concatTo flagsArray qmakeFlags
echo "QMAKEPATH=$QMAKEPATH"
echo qmake "${qmakeFlags[@]}"
qmake "${qmakeFlags[@]}"
echo qmake "${flagsArray[@]}"
qmake "${flagsArray[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1

View File

@ -1 +1 @@
qmakeFlags+=( "QMAKE_LRELEASE=@dev@/bin/lrelease" )
appendToVar qmakeFlags "QMAKE_LRELEASE=@dev@/bin/lrelease"

View File

@ -1,33 +1,29 @@
. @fix_qmake_libtool@
qmakeFlags=(${qmakeFlags-})
qmakePrePhase() {
qmakeFlags_orig=("${qmakeFlags[@]}")
# These flags must be added _before_ the flags specified in the derivation.
# TODO: these flags also need a patch which isn't applied
# can we either remove these flags or update the qt5 patch?
# "NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
qmakeFlags=(
"PREFIX=$out"
"NIX_OUTPUT_OUT=$out"
"NIX_OUTPUT_DEV=${!outputDev}"
"NIX_OUTPUT_BIN=${!outputBin}"
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}"
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}"
)
qmakeFlags+=("${qmakeFlags_orig[@]}")
prependToVar qmakeFlags \
"PREFIX=$out" \
"NIX_OUTPUT_OUT=$out" \
"NIX_OUTPUT_DEV=${!outputDev}" \
"NIX_OUTPUT_BIN=${!outputBin}" \
"NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
"NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}"
}
prePhases+=" qmakePrePhase"
qmakeConfigurePhase() {
runHook preConfigure
local flagsArray=()
concatTo flagsArray qmakeFlags
echo "QMAKEPATH=$QMAKEPATH"
echo qmake "${qmakeFlags[@]}"
qmake "${qmakeFlags[@]}"
echo qmake "${flagsArray[@]}"
qmake "${flagsArray[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1