[oe] making qt5 package machine specific

Nicolas Dechesne nicolas.dechesne at linaro.org
Thu Nov 21 15:11:00 UTC 2013


On Thu, Nov 21, 2013 at 1:39 PM, Martin Jansa <martin.jansa at gmail.com>wrote:

> There are 2 ways and I'm using both in different scenarios (different
> builds)
>
> 1) .inc file with
> PACKAGE_ARCH_pn-qtbase = "${MACHINE_ARCH}"
> PACKAGE_ARCH_pn-qtdeclarative = "${MACHINE_ARCH}"
> ...
> for whole qt* stack (use sstate-diff-machines.sh script to see that you
> get them all).
>
> 2) SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
> # Depending on MACHINE_ARCH GL/GLES binaries (or mesa)
> SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "\
>     qtbase->other-gl-gles-provider \
>     qtbase->mesa \
> "
>
> 2) doesn't solve your MACHINE specific patches of course
>

thanks. how about getting something like this merged? i believe our
situation is going to be an issue for others as well, so perhaps it's nice
to build the infrastructure to make it simpler for people to use

=========

>From c562d011f196b1ee8ceced76833dc80e48dd599f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik at linaro.org>
Date: Thu, 21 Nov 2013 13:48:45 +0000
Subject: [PATCH] qmake5_base.bbclass: allow to set the package arch globally
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Packages built using a (machine) specific qmake, will also be
machine specific.
Since it is not feasible to add PACKAGE_ARCH=... to each and every
recipe that is built using qmake, we introduce a new variable,
QMAKE_PACKAGE_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 <andre.draszik at linaro.org>
---
 classes/qmake5_base.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass
index 2db0fa3..e77dd73 100644
--- a/classes/qmake5_base.bbclass
+++ b/classes/qmake5_base.bbclass
@@ -1,3 +1,15 @@
+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:
+        True
+    else:
+        tarch = d.getVar("QMAKE_PACKAGE_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 # This is useful for target recipes to reference native mkspecs
 QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
 QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}/${QT_DIR_NAME}"
-- 
1.8.2



More information about the Openembedded-devel mailing list