From 4c790d6b399ead5dd70c627323b49a0f94f96d19 Mon Sep 17 00:00:00 2001 From: Kaiyang Wu Date: Sun, 13 Sep 2026 01:22:15 +0800 Subject: [PATCH] templates/qtproj: use QMAKEVER to select qmake version The qtproj template did not allow building with Qt 6's qmake. Remove the unused `QT_SELECT` variable since we no longer ship `qtchooser`. Introduce a new variable `QMAKEVER` to specify the `qmake` version. Require `QMAKEVER` to be set to avoid ambiguity. Signed-off-by: Kaiyang Wu --- sets/exports.json | 1 - templates/20-qtproj.sh | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/sets/exports.json b/sets/exports.json index 27d4b9b..99b4f34 100644 --- a/sets/exports.json +++ b/sets/exports.json @@ -1,5 +1,4 @@ { - "build_qtproj": ["QT_SELECT"], "compilers": ["USECLANG"], "default": [ "PKGNAME", diff --git a/templates/20-qtproj.sh b/templates/20-qtproj.sh index 7d6d43e..1f3ab11 100644 --- a/templates/20-qtproj.sh +++ b/templates/20-qtproj.sh @@ -12,24 +12,22 @@ build_qtproj_probe() { } build_qtproj_configure() { - export QT_SELECT - [ "$QT_SELECT" ] || - if bool "$USEQT5"; then - abwarn "\$USEQT5 is now deprecated. Use QT_SELECT=5." - QT_SELECT=5 - elif bool "$USEQT4"; then - abwarn "\$USEQT4 is now deprecated. Use QT_SELECT=4." - QT_SELECT=4 + BUILD_START + [[ -v "QMAKEVER" ]] || abdie "qmake version unspecified. Set QMAKEVER= to the corresponding Qt version." + export QMAKE + if [ "$QMAKEVER" -eq 6 ]; then + QMAKE="qmake-qt6" + elif [ "$QMAKEVER" -eq 5 ]; then + QMAKE="qmake-qt5" + elif [ "$QMAKEVER" -eq 4 ]; then + QMAKE="qmake-qt4" else - abicu "Qt version unspecified => default." - QT_SELECT=default + abdie "Unknown qmake version: ${QMAKEVER}." fi - - BUILD_START ab_tostringarray QTPROJ_AFTER ab_typecheck -a QTPROJ_DEF - abinfo "Running qmake to generate Makefile ..." - "$QTPREFIX/bin/qmake" "${QTPROJ_DEF[@]}" "${QTPROJ_AFTER[@]}" \ + abinfo "Running ${QMAKE} to generate Makefile ..." + "/usr/bin/${QMAKE}" "${QTPROJ_DEF[@]}" "${QTPROJ_AFTER[@]}" \ || abdie "Failed while running qmake to generate Makefile: $?." }