1 |
Signed-off-by: David Michael <fedora.dm0@×××××.com> |
2 |
--- |
3 |
|
4 |
Hi, |
5 |
|
6 |
I'd like to be able to install qt5 packages in a sysroot for staging, |
7 |
and this is an initial patch for it. The pkg-config variables might not |
8 |
be required, but it seemed appropriate to pass the sysroot-configured |
9 |
versions through the build. There are a few caveats: |
10 |
|
11 |
- The upstream configure scripts do some bad things like this: |
12 |
https://code.qt.io/cgit/qt/qtbase.git/tree/configure.pri#n363 |
13 |
That makes the build fail for systems using lib64 (e.g. amd64). I'm |
14 |
able to work around this by defining PKG_CONFIG_LIBDIR for dev-qt/*. |
15 |
|
16 |
- This isn't for real cross-compiling. There are places where it |
17 |
tries to execute cross-compiled programs that I haven't investigated |
18 |
yet, so this is only for building a sysroot for an architecture |
19 |
compatible with the build system for now. |
20 |
|
21 |
- The qt packages depend on each other being installed in / as well as |
22 |
the sysroot, so their ebuilds will need BDEPENDs added. |
23 |
|
24 |
- I've only gotten to testing a few packages that are dependencies of |
25 |
other applications (like VLC), so I may be missing breakages. |
26 |
|
27 |
The patch basically just sets -sysroot when $SYSROOT is defined. It |
28 |
also needs to set -extprefix to the normal prefix, since otherwise it |
29 |
would default to installing into /sysroot/prefix. Is anyone involved in |
30 |
qt maintenance more experienced with this and able to comment? |
31 |
|
32 |
Thanks. |
33 |
|
34 |
David |
35 |
|
36 |
eclass/qt5-build.eclass | 6 +++++- |
37 |
1 file changed, 5 insertions(+), 1 deletion(-) |
38 |
|
39 |
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass |
40 |
index 70e9be80c98..7fe39e6a23b 100644 |
41 |
--- a/eclass/qt5-build.eclass |
42 |
+++ b/eclass/qt5-build.eclass |
43 |
@@ -479,7 +479,7 @@ qt5_symlink_tools_to_build_dir() { |
44 |
# Runs ./configure for modules belonging to qtbase. |
45 |
qt5_base_configure() { |
46 |
# setup toolchain variables used by configure |
47 |
- tc-export AR CC CXX OBJDUMP RANLIB STRIP |
48 |
+ tc-export AR CC CXX OBJDUMP PKG_CONFIG RANLIB STRIP |
49 |
export LD="$(tc-getCXX)" |
50 |
|
51 |
# bug 633838 |
52 |
@@ -487,6 +487,8 @@ qt5_base_configure() { |
53 |
|
54 |
# configure arguments |
55 |
local conf=( |
56 |
+ ${SYSROOT:+-extprefix "${QT5_PREFIX}" -sysroot "${SYSROOT}"} |
57 |
+ |
58 |
# installation paths |
59 |
-prefix "${QT5_PREFIX}" |
60 |
-bindir "${QT5_BINDIR}" |
61 |
@@ -677,6 +679,7 @@ qt5_qmake_args() { |
62 |
QMAKE_LINK=\"$(tc-getCXX)\" \ |
63 |
QMAKE_LINK_SHLIB=\"$(tc-getCXX)\" \ |
64 |
QMAKE_OBJCOPY=\"$(tc-getOBJCOPY)\" \ |
65 |
+ QMAKE_PKG_CONFIG=\"$(tc-getPKG_CONFIG)\" \ |
66 |
QMAKE_RANLIB= \ |
67 |
QMAKE_STRIP=\"$(tc-getSTRIP)\" \ |
68 |
QMAKE_CFLAGS=\"${CFLAGS}\" \ |
69 |
@@ -716,6 +719,7 @@ qt5_qmake() { |
70 |
QMAKE_LINK="$(tc-getCXX)" \ |
71 |
QMAKE_LINK_SHLIB="$(tc-getCXX)" \ |
72 |
QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \ |
73 |
+ QMAKE_PKG_CONFIG="$(tc-getPKG_CONFIG)" \ |
74 |
QMAKE_RANLIB= \ |
75 |
QMAKE_STRIP="$(tc-getSTRIP)" \ |
76 |
QMAKE_CFLAGS="${CFLAGS}" \ |
77 |
-- |
78 |
2.21.1 |