Package: qt5-qmake
Version: 5.9.2+dfsg-6
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap
Control: affects -1 + src:qsynth

Running "<triplet>-qmake -query foo" gives an unpleasant error
"***Unknown option -query". It seems that qmake's argument parsing is
position dependent and the insertion of -qtconf breaks the handling.

This issue has been spotted elsewhere already:
https://stackoverflow.com/questions/6592931/building-for-windows-under-linux-using-qt-creator

The easy fix is to special case the -query handling and insert it early.
I checked that doing so still considers the -qtconf and gives query
results for that qt.conf. So this should work.

qsynth still needs to switch to AC_PATH_TOOL to see the issue.

Helmut
diff --minimal -Nru qtbase-opensource-src-5.9.2+dfsg/debian/changelog 
qtbase-opensource-src-5.9.2+dfsg/debian/changelog
--- qtbase-opensource-src-5.9.2+dfsg/debian/changelog   2017-12-04 
13:31:27.000000000 +0100
+++ qtbase-opensource-src-5.9.2+dfsg/debian/changelog   2018-01-07 
14:44:24.000000000 +0100
@@ -1,3 +1,10 @@
+qtbase-opensource-src (5.9.2+dfsg-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support <triplet>-qmake -query something. (closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 07 Jan 2018 14:44:24 +0100
+
 qtbase-opensource-src (5.9.2+dfsg-6) unstable; urgency=medium
 
   [ Lisandro Damián Nicanor Pérez Meyer ]
diff --minimal -Nru qtbase-opensource-src-5.9.2+dfsg/debian/qmake-cross-wrapper 
qtbase-opensource-src-5.9.2+dfsg/debian/qmake-cross-wrapper
--- qtbase-opensource-src-5.9.2+dfsg/debian/qmake-cross-wrapper 1970-01-01 
01:00:00.000000000 +0100
+++ qtbase-opensource-src-5.9.2+dfsg/debian/qmake-cross-wrapper 2018-01-07 
14:42:39.000000000 +0100
@@ -0,0 +1,5 @@
+#!/bin/sh
+if test "$#" = 2 -a "x$1" = x-query; then
+       exec /usr/lib/qt5/bin/qmake "$@" -qtconf 
/usr/lib/@DEB_HOST_MULTIARCH@/qt5/qt.conf 
"QMAKE_CC=${CC:-@DEB_HOST_GNU_TYPE@-gcc}" 
"QMAKCE_CXX=${CXX:-@DEB_HOST_GNU_TYPE@-g++}" 
"QMAKE_LINK=${CXX:-@DEB_HOST_GNU_TYPE@-g++}" 
"PKG_CONFIG=@DEB_HOST_GNU_TYPE@-pkg-config"
+fi
+exec /usr/lib/qt5/bin/qmake -qtconf /usr/lib/@DEB_HOST_MULTIARCH@/qt5/qt.conf 
"QMAKE_CC=${CC:-@DEB_HOST_GNU_TYPE@-gcc}" 
"QMAKCE_CXX=${CXX:-@DEB_HOST_GNU_TYPE@-g++}" 
"QMAKE_LINK=${CXX:-@DEB_HOST_GNU_TYPE@-g++}" 
"PKG_CONFIG=@DEB_HOST_GNU_TYPE@-pkg-config" "$@"
diff --minimal -Nru qtbase-opensource-src-5.9.2+dfsg/debian/rules 
qtbase-opensource-src-5.9.2+dfsg/debian/rules
--- qtbase-opensource-src-5.9.2+dfsg/debian/rules       2017-12-04 
13:31:13.000000000 +0100
+++ qtbase-opensource-src-5.9.2+dfsg/debian/rules       2018-01-07 
14:44:18.000000000 +0100
@@ -261,15 +261,9 @@
                > debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/qt.conf
 
        mkdir -p debian/tmp/usr/bin
-       echo "#!/bin/sh" > debian/tmp/usr/bin/$(DEB_HOST_GNU_TYPE)-qmake
-       echo "exec /usr/lib/qt5/bin/qmake" \
-               "-qtconf /usr/lib/$(DEB_HOST_MULTIARCH)/qt5/qt.conf" \
-               'QMAKE_CC=$${CC:-$(DEB_HOST_GNU_TYPE)-gcc}' \
-               'QMAKE_CXX=$${CXX:-$(DEB_HOST_GNU_TYPE)-g++}' \
-               'QMAKE_LINK=$${CXX:-$(DEB_HOST_GNU_TYPE)-g++}' \
-               "PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config" \
-               '"$$@"' \
-               >> debian/tmp/usr/bin/$(DEB_HOST_GNU_TYPE)-qmake
+       sed -e 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' \
+               -e 's/@DEB_HOST_GNU_TYPE@/$(DEB_HOST_GNU_TYPE)/g' \
+               < debian/qmake-cross-wrapper > 
debian/tmp/usr/bin/$(DEB_HOST_GNU_TYPE)-qmake
        chmod +x debian/tmp/usr/bin/$(DEB_HOST_GNU_TYPE)-qmake
 
 override_dh_auto_install-indep:

Reply via email to