fb1cb774f81e22f8af52a321b45524f87d1ececc
[AGL/meta-agl.git] / meta-ivi-common / recipes-automotive / automotive-message-broker / automotive-message-broker_git.bb
1 SUMMARY = "automotive message broker"
2 DESCRIPTION = "Automotive-message-broker abstracts the details of the network \
3 away from applications and provides a standard API for applications to easily \
4 get the required information"
5
6 HOMEPAGE = "https://github.com/otcshare/automotive-message-broker/wiki"
7
8 require automotive-message-broker_git.inc
9
10 CMAKE_QT5_CLASS = "${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','cmake_qt5','',d)}"
11 inherit cmake systemd ${CMAKE_QT5_CLASS}
12
13 DEPENDS = "glib-2.0 util-linux sqlite3 boost json-c libtool"
14 RDEPENDS_${PN} = "python-misc python-json python-curses"
15
16 PACKAGECONFIG ??= " use_gps \
17     ${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','use_qt5','', d)} \
18     "
19 PACKAGECONFIG[use_gps] = "-Dgpsnmea_plugin=On"
20 PACKAGECONFIG[use_qt5] = "-Dqtmainloop=On -Dqt_bindings=On,,qtbase qtdeclarative"
21
22 SYSTEMD_PACKAGES = "${PN}"
23 SYSTEMD_SERVICE_${PN} = "ambd.service"
24
25 # amb detects icecc in cmake and would override the
26 # compiler selection of yocto. This breaks the build
27 # if icecc is installed on the host.
28 # -> Disable the detection in cmake.
29 EXTRA_OECMAKE += " -Denable_icecc=OFF"
30
31 do_install_append() {
32     mv ${D}/usr/include/amb/* ${D}/usr/include
33     sed -i 's,/amb,,' ${D}${libdir}/pkgconfig/*.pc
34
35     install -d ${D}${systemd_unitdir}/system/
36     install -m 0644 ${WORKDIR}/ambd.service ${D}${systemd_unitdir}/system
37
38     if [ "${@bb.utils.contains('PACKAGECONFIG', 'use_gps', 'use_gps', '', d)}" = "use_gps" ]; then
39         install -m 0644 ${WORKDIR}/gps ${D}/${sysconfdir}/ambd/plugins.d
40     fi
41
42     # Grmbl - heck gotta fix library installations ?!? WTF !
43     # GO FIX YOUR INSTALLATION ROUTINES PLEASE.  ;)  (jsmoeller)
44     # HACK-ALARM:
45     ls -alh ${D}${libdir}
46     if test -e ${D}${libdir}/libamb-qt.so -a ! -L ${D}${libdir}/libamb-qt.so ; then 
47         mv ${D}${libdir}/libamb-qt.so ${D}${libdir}/libamb-qt.so.0
48         ln -sf libamb-qt.so.0 ${D}${libdir}/libamb-qt.so
49     fi
50     if test -e ${D}${libdir}/libamb-plugins-common.so -a ! -L ${D}${libdir}/libamb-plugins-common.so ; then 
51         mv ${D}${libdir}/libamb-plugins-common.so ${D}${libdir}/libamb-plugins-common.so.0
52         ln -sf libamb-plugins-common.so.0 ${D}${libdir}/libamb-plugins-common.so
53     fi
54 }
55
56 FILES_${PN} += " ${systemd_unitdir}/ambd.service \
57     ${@bb.utils.contains('BBFILE_COLLECTIONS','qt5-layer','${libdir}/qt5/qml/amb/','',d)} \
58     "
59 FILES_${PN}-dbg += " \
60     ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', '${libdir}/qt5/qml/amb/.debug', '', d)} \
61     "