Skip to contentSkip to conversation

Enable nativesdk-qtbase to keep additional libraries

PATCH New Anders Darander 1 participant 2 messages Oct 20, 2014

lore
Share & tools
lore
#0 lore raw

v2 cover Enable nativesdk-qtbase to keep additional libraries

We have a usecase where we need to run a tool to transform a protocol spec. to cpp (kdwsdl2cpp). That tool is built using Qt5, and requires a couple of extra Qt-libraries, among the libQt5Xml.so.*. Today the nativesdk-qtbase recipe just unconditionally removes every library, except for a couple hardcoded ones.

This patch add an extra variable, in which you can specify additional libraries to keep.

Changes:

	v2: 
	 	* Fix spelling mistake in a comment (net -> not)

The following changes since commit 2f1b8fe630ac76c8ff5d184f109449b10fde5a92:

Fix SDK environment setting (2014-10-16 17:35:21 -0300)

are available in the git repository at:

git://github.com/darander/meta-qt5 a29d8e60f63d6545ed84d6b72caf46bc0d1e7b78
https://github.com/darander/meta-qt5/tree/nativesdk-qtbase

Anders Darander (1):
nativesdk-qtbase: make it possible to keep additional libraries

 recipes-qt/qt5/nativesdk-qtbase.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
Signature · 1 line
2.1.1
#1 lore raw

PATCH v2 1/1 nativesdk-qtbase: make it possible to keep additional libraries

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

---
 recipes-qt/qt5/nativesdk-qtbase.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
recipes-qt/qt5/nativesdk-qtbase.inc +11 -0
index 12f5a54..e64f936 100644
@@ -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 '{}' ';'
 }
Signature · 1 line
2.1.1