nativesdk-qtbase: make it possible to keep additional libraries
authorAnders Darander <anders@chargestorm.se>
Mon, 20 Oct 2014 06:32:10 +0000 (08:32 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:46:17 +0000 (08:46 -0800)
In some usecases for the nativesdk, you might need some build tools that are built upon Qt5. This means
that we're having a need to keep more of the libraries build by nativsdk-qtbase. This patch adds the
infrastructure to support that

(From meta-qt5 rev: b62bda97802a3c79586e4e1c7b31f95e617cc0c8)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-qt5/recipes-qt/qt5/nativesdk-qtbase.inc

index 09f3d9a..832fda9 100644 (file)
@@ -194,6 +194,16 @@ do_configure() {
     bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}"
 }
 
+# Set the EXTRA_QTLIB variable to e.g. Xml, in order to not remove libQt5Xml.so.*
+EXTRA_QTLIB ?= ""
+
+python __anonymous () {
+    templibs = ""
+    for e in d.getVar("EXTRA_QTLIB", True).split():
+        templibs = "%s -not -name 'libQt5%s.so*' -and" % (templibs, e)
+    d.setVar("QTLIBSPRESERVE", templibs)
+}
+
 do_install() {
     # Fix install paths for all
     find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE},(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"
@@ -216,6 +226,7 @@ do_install() {
            ${D}${libdir}/pkgconfig
     find ${D}${libdir} -maxdepth 1 -name 'lib*' -and \
                                    -not -name 'libQt5Core.so*' -and \
+                                   ${QTLIBSPRESERVE} \
                                    -not -name 'libQt5Bootstrap.a' \
                                    -exec rm '{}' ';'
 }