Patchwork [meta-qt5] allow to set the package arch globally

mail settings
Submitter André Draszik
Date Dec. 3, 2013, 3:04 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/62733/
State New
Headers show


André Draszik - Dec. 3, 2013, 3:04 p.m.
If Qt5 (qtbase) is machine specific, then all packages depending
on qtbase will also be machine specific, because the (initial)
qtbase configuration becomes part of Qt5/qmake, thus affecting
builds of packages built against this specific version of qtbase.

Since it is not feasible to add PACKAGE_ARCH=... to each and every
recipe that is built using qmake and depends on Qt5, we introduce
a new variable, QT_PACKAGES_ARCH, that can be set by the machine
configuration as needed.

We have to be careful though to only change the architecture of the
resulting packages if we're not compiling a 'native' package.

Signed-off-by: André Draszik <>
 recipes-qt/qt5/ | 12 ++++++++++++
 1 file changed, 12 insertions(+)


diff --git a/recipes-qt/qt5/ b/recipes-qt/qt5/
index 7669efc..8d8438f 100644
--- a/recipes-qt/qt5/
+++ b/recipes-qt/qt5/
+# If Qt5 (qtbase) is machine specific, then everything will be,
+# because the (initial) qtbase configuration becomes part of Qt5/qmake
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch != tarch:
+        tarch = d.getVar("QT_PACKAGES_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
 PACKAGES =. "${PN}-qmlplugins-dbg ${PN}-tools-dbg ${PN}-plugins-dbg ${PN}-qmlplugins ${PN}-tools ${PN}-plugins ${PN}-mkspecs ${PN}-examples-dev ${PN}-examples-staticdev ${PN}-examples-dbg ${PN}-examples "
 # extra -dbg packages