From 8ad4185c292890ecc55eaba992eb80b4bca657be Mon Sep 17 00:00:00 2001 From: John Date: Sun, 24 Aug 2025 02:01:25 +0200 Subject: [PATCH] common/build-helper/qmake*: allow parallel usage of qmake 5 and 6 --- common/build-helper/qmake.sh | 23 +++++++++++++---------- common/build-helper/qmake6.sh | 22 ++++++++++++---------- common/environment/setup/sourcepkg.sh | 1 + 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/common/build-helper/qmake.sh b/common/build-helper/qmake.sh index bdda2de2310..f96f598fe0f 100644 --- a/common/build-helper/qmake.sh +++ b/common/build-helper/qmake.sh @@ -5,8 +5,8 @@ # respectively. if [ "$CROSS_BUILD" ]; then - mkdir -p "${XBPS_WRAPPERDIR}/target-spec/linux-g++" - cat > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qmake.conf" <<_EOF + mkdir -p "${XBPS_WRAPPERDIR}/qt5/target-spec/linux-g++" + cat > "${XBPS_WRAPPERDIR}/qt5/target-spec/linux-g++/qmake.conf" <<_EOF MAKEFILE_GENERATOR = UNIX CONFIG += incremental no_qt_rpath QMAKE_INCREMENTAL_STYLE = sublib @@ -34,9 +34,9 @@ QMAKE_CXXFLAGS = ${CXXFLAGS} QMAKE_LFLAGS = ${LDFLAGS} load(qt_config) _EOF - echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qplatformdefs.h" + echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/qt5/target-spec/linux-g++/qplatformdefs.h" - cat > "${XBPS_WRAPPERDIR}/qt.conf" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qt5.conf" <<_EOF [Paths] Sysroot=${XBPS_CROSS_BASE} Prefix=${XBPS_CROSS_BASE}/usr @@ -59,7 +59,7 @@ HostData=/usr/lib/qt5 HostBinaries=/usr/lib/qt5/bin HostLibraries=/usr/lib Spec=linux-g++ -TargetSpec=$XBPS_WRAPPERDIR/target-spec/linux-g++ +TargetSpec=$XBPS_WRAPPERDIR/qt5/target-spec/linux-g++ _EOF # create the qmake-wrapper here because it only @@ -68,15 +68,15 @@ _EOF # # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS # + hardening flags will be picked up from environment variables - cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qmake5" <<_EOF #!/bin/sh -exec /usr/lib/qt5/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\ +exec /usr/lib/qt5/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt5.conf" \\ QMAKE_CFLAGS+="\${CFLAGS}" \\ QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\ QMAKE_LFLAGS+="\${LDFLAGS}" _EOF else - cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qmake5" <<_EOF #!/bin/sh exec /usr/lib/qt5/bin/qmake \ "\$@" \ @@ -91,5 +91,8 @@ exec /usr/lib/qt5/bin/qmake \ CONFIG+=no_qt_rpath _EOF fi -chmod 755 ${XBPS_WRAPPERDIR}/qmake -cp -p ${XBPS_WRAPPERDIR}/qmake{,-qt5} +chmod 755 ${XBPS_WRAPPERDIR}/qmake5 +cp -p ${XBPS_WRAPPERDIR}/qmake{5,-qt5} +if [ -z "$qmake_default_version" ] || [ "${qmake_default_version}" = "5" ]; then + cp -p ${XBPS_WRAPPERDIR}/qmake{5,} +fi diff --git a/common/build-helper/qmake6.sh b/common/build-helper/qmake6.sh index 945110b94ea..fb344c90f4d 100644 --- a/common/build-helper/qmake6.sh +++ b/common/build-helper/qmake6.sh @@ -5,8 +5,8 @@ # respectively. if [ "$CROSS_BUILD" ]; then - mkdir -p "${XBPS_WRAPPERDIR}/target-spec/linux-g++" - cat > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qmake.conf" <<_EOF + mkdir -p "${XBPS_WRAPPERDIR}/qt6/target-spec/linux-g++" + cat > "${XBPS_WRAPPERDIR}/qt6/target-spec/linux-g++/qmake.conf" <<_EOF MAKEFILE_GENERATOR = UNIX CONFIG += incremental no_qt_rpath QMAKE_INCREMENTAL_STYLE = sublib @@ -34,9 +34,9 @@ QMAKE_CXXFLAGS = ${CXXFLAGS} QMAKE_LFLAGS = ${LDFLAGS} load(qt_config) _EOF - echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/target-spec/linux-g++/qplatformdefs.h" + echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt6/mkspecs/linux-g++/qplatformdefs.h\"" > "${XBPS_WRAPPERDIR}/qt6/target-spec/linux-g++/qplatformdefs.h" - cat > "${XBPS_WRAPPERDIR}/qt.conf" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qt6.conf" <<_EOF [Paths] Sysroot=${XBPS_CROSS_BASE} Prefix=${XBPS_CROSS_BASE}/usr @@ -69,15 +69,15 @@ _EOF # # + base flags will be picked up from QMAKE_{C,CXX,LD}FLAGS # + hardening flags will be picked up from environment variables - cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qmake6" <<_EOF #!/bin/sh -exec /usr/lib/qt6/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt.conf" \\ +exec /usr/lib/qt6/bin/qmake "\$@" -qtconf "${XBPS_WRAPPERDIR}/qt6.conf" \\ QMAKE_CFLAGS+="\${CFLAGS}" \\ QMAKE_CXXFLAGS+="\${CXXFLAGS}" \\ QMAKE_LFLAGS+="\${LDFLAGS}" _EOF else - cat > "${XBPS_WRAPPERDIR}/qmake" <<_EOF + cat > "${XBPS_WRAPPERDIR}/qmake6" <<_EOF #!/bin/sh exec /usr/lib/qt6/bin/qmake \ "\$@" \ @@ -92,6 +92,8 @@ exec /usr/lib/qt6/bin/qmake \ CONFIG+=no_qt_rpath _EOF fi -chmod 755 ${XBPS_WRAPPERDIR}/qmake -cp -p ${XBPS_WRAPPERDIR}/qmake{,-qt6} -cp -p ${XBPS_WRAPPERDIR}/qmake{,6} +chmod 755 ${XBPS_WRAPPERDIR}/qmake6 +cp -p ${XBPS_WRAPPERDIR}/qmake{6,-qt6} +if [ -z "$qmake_default_version" ] || [ "${qmake_default_version}" = "6" ]; then + cp -p ${XBPS_WRAPPERDIR}/qmake{6,} +fi diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh index b08379acdd3..ea2409841a6 100644 --- a/common/environment/setup/sourcepkg.sh +++ b/common/environment/setup/sourcepkg.sh @@ -50,6 +50,7 @@ unset -v make_cmd meson_cmd gem_cmd fetch_cmd make_check_pre unset -v python_version stackage unset -v cmake_builddir meson_builddir unset -v meson_crossfile +unset -v qmake_default_version unset -v gemspec unset -v go_import_path go_package go_mod_mode unset -v patch_args disable_parallel_build disable_parallel_check