Signed-off-by: David Michael <[email protected]>
---
Hi,
I'd like to be able to install qt5 packages in a sysroot for staging,
and this is an initial patch for it. The pkg-config variables might not
be required, but it seemed appropriate to pass the sysroot-configured
versions through the build. There are a few caveats:
- The upstream configure scripts do some bad things like this:
https://code.qt.io/cgit/qt/qtbase.git/tree/configure.pri#n363
That makes the build fail for systems using lib64 (e.g. amd64). I'm
able to work around this by defining PKG_CONFIG_LIBDIR for dev-qt/*.
- This isn't for real cross-compiling. There are places where it
tries to execute cross-compiled programs that I haven't investigated
yet, so this is only for building a sysroot for an architecture
compatible with the build system for now.
- The qt packages depend on each other being installed in / as well as
the sysroot, so their ebuilds will need BDEPENDs added.
- I've only gotten to testing a few packages that are dependencies of
other applications (like VLC), so I may be missing breakages.
The patch basically just sets -sysroot when $SYSROOT is defined. It
also needs to set -extprefix to the normal prefix, since otherwise it
would default to installing into /sysroot/prefix. Is anyone involved in
qt maintenance more experienced with this and able to comment?
Thanks.
David
eclass/qt5-build.eclass | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 70e9be80c98..7fe39e6a23b 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -479,7 +479,7 @@ qt5_symlink_tools_to_build_dir() {
# Runs ./configure for modules belonging to qtbase.
qt5_base_configure() {
# setup toolchain variables used by configure
- tc-export AR CC CXX OBJDUMP RANLIB STRIP
+ tc-export AR CC CXX OBJDUMP PKG_CONFIG RANLIB STRIP
export LD="$(tc-getCXX)"
# bug 633838
@@ -487,6 +487,8 @@ qt5_base_configure() {
# configure arguments
local conf=(
+ ${SYSROOT:+-extprefix "${QT5_PREFIX}" -sysroot "${SYSROOT}"}
+
# installation paths
-prefix "${QT5_PREFIX}"
-bindir "${QT5_BINDIR}"
@@ -677,6 +679,7 @@ qt5_qmake_args() {
QMAKE_LINK=\"$(tc-getCXX)\" \
QMAKE_LINK_SHLIB=\"$(tc-getCXX)\" \
QMAKE_OBJCOPY=\"$(tc-getOBJCOPY)\" \
+ QMAKE_PKG_CONFIG=\"$(tc-getPKG_CONFIG)\" \
QMAKE_RANLIB= \
QMAKE_STRIP=\"$(tc-getSTRIP)\" \
QMAKE_CFLAGS=\"${CFLAGS}\" \
@@ -716,6 +719,7 @@ qt5_qmake() {
QMAKE_LINK="$(tc-getCXX)" \
QMAKE_LINK_SHLIB="$(tc-getCXX)" \
QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \
+ QMAKE_PKG_CONFIG="$(tc-getPKG_CONFIG)" \
QMAKE_RANLIB= \
QMAKE_STRIP="$(tc-getSTRIP)" \
QMAKE_CFLAGS="${CFLAGS}" \
--
2.21.1