AMB (automotive-message-broker): allow building with Qt5 47/4347/2
authorManuel Bachmann <mbc@iot.bzh>
Fri, 13 Nov 2015 12:52:21 +0000 (12:52 +0000)
committerTadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Mon, 16 Nov 2015 14:26:57 +0000 (23:26 +0900)
v2: (Tadao Tanikawa)
- The recipe in meta-agl-demo which added by Change 4339
  has been merged into this patch.

- The recipe splitted automotive-message-broker_git.bb and
  automotive-message-broker_git.inc.

- Dependencies to gpsd, qtbase and qtdeclarative has been defined
  into PACKAGECONFIG because they need each of their options into
  EXTRA_OECMAKE.

NOTE: Once this patch merged, Change 4339 should be reverted.

v1: (Manuel Bachmann)
We want to be able to build AMB with or without meta-qt5 ;
this is possible by checking the layer presence (see
http://lists.openembedded.org/pipermail/openembedded-devel
/2015-October/103781.html for an upstream OE example).

Enable QtMainLoop and QtQuick/QML plugins, only if meta-qt5
has been added in bblayers.conf.

We need to precise package contents for Bitbake because
the install tree uses a complicated layout.

Change-Id: Ie7e5b6955c76324fd92662fee9caa5bad4dfd2f6
Signed-off-by: Manuel Bachmann <mbc@iot.bzh>
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker_git.bb
meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker_git.inc [new file with mode: 0644]

index 49bb7ca..4873f12 100644 (file)
@@ -4,47 +4,29 @@ away from applications and provides a standard API for applications to easily \
 get the required information"
 
 HOMEPAGE = "https://github.com/otcshare/automotive-message-broker/wiki"
-LICENSE = "LGPL-2.1"
-LIC_FILES_CHKSUM = "file://COPYING;md5=b42382de5d854b9bb598acf2e8827de3"
 
-inherit cmake systemd
+require automotive-message-broker_git.inc
 
-#DEPENDS = "glib-2.0 util-linux sqlite3 qtbase boost json-c libtool gpsd"
-DEPENDS = "glib-2.0 util-linux sqlite3 boost json-c libtool gpsd"
+CMAKE_QT5_CLASS = "${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','cmake_qt5','',d)}"
+inherit cmake systemd ${CMAKE_QT5_CLASS}
+
+DEPENDS = "glib-2.0 util-linux sqlite3 boost json-c libtool"
 RDEPENDS_${PN} = "python-misc python-json"
 
-PV = "0.14+git${SRCPV}"
-
-SRC_URI = "git://github.com/CogentEmbedded/automotive-message-broker.git;protocol=https;branch=master"
-SRCREV = "58569fac42bb8b6e1ad208caef5db8a51befc87f"
-
-# The paches from 0001 to 0009 are from difference between
-# hash:58569fac42bb8b6e1ad208caef5db8a51befc87f(main branch) and
-# hash:8f761e02172544212915c82b7e8dd8d4dd1281a6(dev_0.14_2)
-SRC_URI += " \
-    file://0001-Improve-backward-compatibility-with-old-linaro-gcc.patch \
-    file://0002-Fix-library-versioning.patch \
-    file://0003-AmbSignalMapper-fix-can-interface-specification.patch \
-    file://0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch \
-    file://0005-ambctl-remove-unnecessary-dependency-on-glib-introsp.patch \
-    file://0006-cangen-Implement-basic-handling-of-RX_TIMEOUT.patch \
-    file://0007-WORKAROUND-Allow-amb-qt-binding-to-work-in-case-of-m.patch \
-    file://0008-Add-simple-Qt-QML-example.patch \
-    file://0009-Add-Pressure-property-to-BrakeOperation.patch \
-    file://0001-Fix-build-issues-while-bitbake-without-meta-qt5-laye.patch \
-    file://ambd.service \
+PACKAGECONFIG ??= " use_gps \
+    ${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','use_qt5','', d)} \
     "
+PACKAGECONFIG[use_gps] = "-Dgpsd_plugins=On,,gpsd"
+PACKAGECONFIG[use_qt5] = "-Dqtmainloop=On -Dqt_bindings=On,,qtbase qtdeclarative"
 
 SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "ambd.service"
 
-S = "${WORKDIR}/git"
-
 # amb detects icecc in cmake and would override the
 # compiler selection of yocto. This breaks the build
 # if icecc is installed on the host.
 # -> Disable the detection in cmake.
-EXTRA_OECMAKE += " -Denable_icecc=OFF -Dgpsd_plugin=ON"
+EXTRA_OECMAKE += " -Denable_icecc=OFF"
 
 do_install_append() {
     mv ${D}/usr/include/amb/* ${D}/usr/include
@@ -53,4 +35,9 @@ do_install_append() {
     install -m 0644 ${WORKDIR}/ambd.service ${D}${systemd_unitdir}/system
 }
 
-FILES_${PN} += "${systemd_unitdir}/ambd.service"
+FILES_${PN} += " ${systemd_unitdir}/ambd.service \
+    ${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','${libdir}/qt5/qml/amb/','',d)} \
+    "
+FILES_${PN}-dbg += " \
+    ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', '${libdir}/qt5/qml/amb/.debug', '', d)} \
+    "
diff --git a/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker_git.inc b/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker_git.inc
new file mode 100644 (file)
index 0000000..9cef0d5
--- /dev/null
@@ -0,0 +1,26 @@
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b42382de5d854b9bb598acf2e8827de3"
+
+SRC_URI = "git://github.com/CogentEmbedded/automotive-message-broker.git;protocol=https;branch=master"
+SRCREV = "58569fac42bb8b6e1ad208caef5db8a51befc87f"
+
+PV = "0.14+git${SRCPV}"
+
+# The paches from 0001 to 0009 are from difference between
+# hash:58569fac42bb8b6e1ad208caef5db8a51befc87f(main branch) and
+# hash:8f761e02172544212915c82b7e8dd8d4dd1281a6(dev_0.14_2)
+SRC_URI += " \
+    file://0001-Improve-backward-compatibility-with-old-linaro-gcc.patch \
+    file://0002-Fix-library-versioning.patch \
+    file://0003-AmbSignalMapper-fix-can-interface-specification.patch \
+    file://0004-cansocketbcm-Fix-reading-of-frames-in-case-of-RX_TIM.patch \
+    file://0005-ambctl-remove-unnecessary-dependency-on-glib-introsp.patch \
+    file://0006-cangen-Implement-basic-handling-of-RX_TIMEOUT.patch \
+    file://0007-WORKAROUND-Allow-amb-qt-binding-to-work-in-case-of-m.patch \
+    file://0008-Add-simple-Qt-QML-example.patch \
+    file://0009-Add-Pressure-property-to-BrakeOperation.patch \
+    file://0001-Fix-build-issues-while-bitbake-without-meta-qt5-laye.patch \
+    file://ambd.service \
+    "
+
+S = "${WORKDIR}/git"