[oe] [meta-qt5][PATCH] qmake5_base.bbclass: Add install support for native builds

Donald R. Poole, Jr. donald.poole at swri.org
Tue May 6 18:34:24 UTC 2014


From: "Donald R. Poole, Jr" <donald (dot) poole (at) swri (dot) org>

Currently, if you are building native applications with Qt5, the current qmake5_base_do_install() method assumes an install into the image folder for the target. Since the native builds handle this a little differently, this patch should account for the native install scenario.
---
 classes/qmake5.bbclass      |    8 ++++++--
 classes/qmake5_base.bbclass |   46 +++++++++++++++++++++----------------------
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/classes/qmake5.bbclass b/classes/qmake5.bbclass
index e1dda0d..01454f3 100644
--- a/classes/qmake5.bbclass
+++ b/classes/qmake5.bbclass
@@ -19,6 +19,10 @@ do_configure() {
     qmake5_base_do_configure
 }
 
-do_install() {
-    qmake5_base_do_install
+do_install_class-target() {
+    qmake5_base_do_install_target
+}
+
+do_install_class-native() {
+    qmake5_base_do_install_native
 }
diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass
index df8a59a..5a380d0 100644
--- a/classes/qmake5_base.bbclass
+++ b/classes/qmake5_base.bbclass
@@ -161,32 +161,32 @@ qmake5_base_do_configure () {
     ${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_DEBUG_OUTPUT} -r $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling $CMD"
 }
 
-qmake5_base_do_install() {
+qmake5_base_do_install_target() {
     # Fix install paths for all
-    if [ "${BUILD_SYS}" = "${HOST_SYS}" ] ; then
-        find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT),(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"
-    else
-        find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_TARGET},(INSTALL_ROOT),g"
-    fi
+    find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_TARGET},(INSTALL_ROOT),g"
 
     oe_runmake install INSTALL_ROOT=${D}
 
-    # Only do this for target builds. Native install work a little differently
-    if [ "${BUILD_SYS}" != "${HOST_SYS}" ] ; then
-        # everything except HostData and HostBinaries is prefixed with sysroot value,
-        # but we cannot remove sysroot override, because that's useful for pkg-config etc
-        # In some cases like QtQmlDevTools in qtdeclarative, the sed above does not work,
-        # fix them manually
-        if [ -d ${D}${STAGING_DIR_TARGET} ] && [ -n "${STAGING_DIR_TARGET}" ] ; then
-            echo "Some files are installed in wrong directory ${D}${STAGING_DIR_TARGET}"
-            cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
-            rm -rf ${D}${STAGING_DIR_TARGET}
-            # remove empty dirs
-            TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
-            while test ${TMP} != ${D}; do
-                rmdir ${TMP}
-                TMP=`dirname ${TMP}`;
-            done
-        fi
+    # everything except HostData and HostBinaries is prefixed with sysroot value,
+    # but we cannot remove sysroot override, because that's useful for pkg-config etc
+    # In some cases like QtQmlDevTools in qtdeclarative, the sed above does not work,
+    # fix them manually
+    if [ -d ${D}${STAGING_DIR_TARGET} ] ; then
+        echo "Some files are installed in wrong directory ${D}${STAGING_DIR_TARGET}"
+        cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
+        rm -rf ${D}${STAGING_DIR_TARGET}
+        # remove empty dirs
+        TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
+        while test ${TMP} != ${D}; do
+            rmdir ${TMP}
+            TMP=`dirname ${TMP}`;
+        done
     fi
 }
+
+qmake5_base_do_install_native() {
+    # Fix install paths for all
+    find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT),(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"
+
+    oe_runmake install INSTALL_ROOT=${D}
+}
-- 
1.7.9.5




More information about the Openembedded-devel mailing list