From: JamiKettunen <JamiKettunen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] build-style/qmake: add support for Qt6
Date: Wed, 01 Mar 2023 15:34:56 +0100 [thread overview]
Message-ID: <20230301143456.RIhWPsEU597QNCD6AW2wpjAVdDkEM2vnbuk4NtJ4qQk@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42354@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 2489 bytes --]
There is an updated pull request by JamiKettunen against master on the void-packages repository
https://github.com/JamiKettunen/void-packages qt6-qmake
https://github.com/void-linux/void-packages/pull/42354
build-style/qmake: add support for Qt6
<!-- Uncomment relevant sections and delete options which are not applicable -->
There's a big problem: cross-compiling any Qt6 `qmake` package quickly results in something like:
```
make: *** No rule to make target '/usr/libexec/moc', needed by '.moc/main.moc'. Stop.
```
Native builds still work as expected however already. For a testing tree see [my `qt6-qmake-demo` tree](https://github.com/JamiKettunen/void-packages/commits/qt6-qmake-demo) and try e.g. `./xbps-src pkg qt6-qpa-hwcomposer-plugin` vs `./xbps-src pkg -a aarch64 qt6-qpa-hwcomposer-plugin` on a glibc masterdir.
As per https://forum.qt.io/topic/137300/qtpaths-return-incorrect-path `ln -s /usr/lib/qt6/libexec/moc /usr/libexec/moc` would probably work as a really ugly hack, but is there someone around (perhaps @Johnnynator?) who knows how this could be fixed properly, and maybe even upstream? Here's a few other places where the same error can be seen:
- https://community.nxp.com/t5/i-MX-Processors/Imx8mp-cmake-creat-qt6-project-with-an-error-usr-libexec-moc-no/m-p/1567183
- https://gobolinux.discourse.group/t/system-index-libexec-is-empty-issue/101
There's also no `qt6-doc` package (compared to `qt5-doc`) or `qt6-examples` subpackage (compared to `qt5-examples`) but those could just be ignored I suppose
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/42354.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt6-qmake-42354.patch --]
[-- Type: text/x-diff, Size: 5644 bytes --]
From 4032ac6e140bc2eab2ac8a89863023b45e5bc535 Mon Sep 17 00:00:00 2001
From: Jami Kettunen <jami.kettunen@protonmail.com>
Date: Mon, 20 Feb 2023 01:06:51 +0200
Subject: [PATCH] build-style/qmake: add support for Qt6
---
common/build-style/qmake.sh | 64 +++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 27 deletions(-)
diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 486bb0644380..bf8527ba9a7f 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -4,13 +4,18 @@
do_configure() {
local qmake
local qmake_args
+ local qt
if [ -x "/usr/lib/qt5/bin/qmake" ]; then
qmake="/usr/lib/qt5/bin/qmake"
+ qt="qt5"
+ elif [ -x "/usr/lib/qt6/bin/qmake" ]; then
+ qmake="/usr/lib/qt6/bin/qmake"
+ qt="qt6"
fi
if [ -z "${qmake}" ]; then
msg_error "${pkgver}: Could not find qmake - missing in hostmakedepends?\n"
fi
- if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
+ if [ "$CROSS_BUILD" ]; then
case $XBPS_TARGET_MACHINE in
i686*) _qt_arch=i386;;
x86_64*) _qt_arch=x86_64;;
@@ -26,13 +31,13 @@ MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
-include(/usr/lib/qt5/mkspecs/common/linux.conf)
-include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
-include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+include(/usr/lib/${qt}/mkspecs/common/linux.conf)
+include(/usr/lib/${qt}/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/${qt}/mkspecs/common/g++-unix.conf)
-QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
-QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
-QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/modules
+QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/qmodule.pri
+QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/modules
QMAKE_CC = ${CC}
QMAKE_CXX = ${CXX}
QMAKE_LINK = ${CXX}
@@ -49,7 +54,7 @@ QMAKE_CXXFLAGS = ${CXXFLAGS}
QMAKE_LFLAGS = ${LDFLAGS}
load(qt_config)
_EOF
- echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
+ echo "#include \"${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
mkdir -p "${wrksrc}/.host-spec/linux-g++"
cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
@@ -57,12 +62,12 @@ MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
-include(/usr/lib/qt5/mkspecs/common/linux.conf)
-include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
-include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+include(/usr/lib/${qt}/mkspecs/common/linux.conf)
+include(/usr/lib/${qt}/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/${qt}/mkspecs/common/g++-unix.conf)
-QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
-QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/qmodule.pri
QMAKE_CC = ${CC_host}
QMAKE_CXX = ${CXX_host}
QMAKE_LINK = ${CXX_host}
@@ -79,29 +84,34 @@ QMAKE_CXXFLAGS = ${CXXFLAGS_host}
QMAKE_LFLAGS = ${LDFLAGS_host}
load(qt_config)
_EOF
-echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
+echo '#include "/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
+ # FIXME:
+ # - package cross-builds fail fast with "make: *** No rule to make target '/usr/libexec/moc', needed by '.moc/main.moc'. Stop."
+ # - Qt6 docs not @ usr/share/doc/qt6 (no qt6-doc package)!
+ # - Qt6 examples @ usr/share/qt6/examples (no qt6-examples subpackage)!
cat > "${wrksrc}/qt.conf" <<_EOF
[Paths]
Sysroot=${XBPS_CROSS_BASE}
Prefix=/usr
-ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
-Data=${XBPS_CROSS_BASE}/usr/share/qt5
-Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
-Headers=${XBPS_CROSS_BASE}/usr/include/qt5
+ArchData=${XBPS_CROSS_BASE}/usr/lib/${qt}
+Data=${XBPS_CROSS_BASE}/usr/share/${qt}
+Documentation=${XBPS_CROSS_BASE}/usr/share/doc/${qt}
+Headers=${XBPS_CROSS_BASE}/usr/include/${qt}
Libraries=${XBPS_CROSS_BASE}/usr/lib
-LibraryExecutables=/usr/lib/qt5/libexec
-Binaries=/usr/lib/qt5/bin
+LibraryExecutables=/usr/lib/${qt}/libexec
+Binaries=/usr/lib/${qt}/bin
Tests=${XBPS_CROSS_BASE}/usr/tests
-Plugins=/usr/lib/qt5/plugins
-Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
-Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
-Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
+Plugins=/usr/lib/${qt}/plugins
+Imports=${XBPS_CROSS_BASE}/usr/lib/${qt}/imports
+Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/${qt}/qml
+Translations=${XBPS_CROSS_BASE}/usr/share/${qt}/translations
Settings=${XBPS_CROSS_BASE}/etc/xdg
-Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
+Examples=${XBPS_CROSS_BASE}/usr/share/${qt}/examples
HostPrefix=/usr
-HostData=/usr/lib/qt5
-HostBinaries=/usr/lib/qt5/bin
+HostData=/usr/lib/${qt}
+HostBinaries=/usr/lib/${qt}/bin
HostLibraries=/usr/lib
+HostLibraryExecutables=/usr/lib/${qt}/libexec
Spec=${wrksrc}/.host-spec/linux-g++
TargetSpec=${wrksrc}/.target-spec/linux-g++
_EOF
next prev parent reply other threads:[~2023-03-01 14:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 1:03 [PR PATCH] " JamiKettunen
2023-02-20 9:50 ` Johnnynator
2023-02-22 15:35 ` sgn
2023-02-22 16:05 ` sgn
2023-02-22 16:10 ` sgn
2023-03-01 13:09 ` [PR PATCH] [Updated] " JamiKettunen
2023-03-01 13:10 ` JamiKettunen
2023-03-01 13:15 ` sgn
2023-03-01 13:16 ` sgn
2023-03-01 14:34 ` JamiKettunen [this message]
2023-03-01 17:58 ` [PR PATCH] [Updated] " JamiKettunen
2023-03-02 0:52 ` [PR PATCH] [Merged]: " sgn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230301143456.RIhWPsEU597QNCD6AW2wpjAVdDkEM2vnbuk4NtJ4qQk@z \
--to=jamikettunen@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).