blob: aaf7429291a3b47e4f8de46ddbc04ad1ebce5b16 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
2SECTION = "console/network"
Brad Bishop26bdd442019-08-16 17:08:17 -04003LICENSE = "BSD-2-Clause"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05004LIC_FILES_CHKSUM = "file://COPYING;md5=7a5d174db44ec45f9638b2c747806821"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005DEPENDS = "dbus ncurses python3 pps-tools"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006PROVIDES = "virtual/gpsd"
7
Brad Bishop316dfdd2018-06-25 12:45:53 -04008SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05009 file://0001-SConscript-Correct-the-installation-of-gpsd.hotplug.patch \
Andrew Geissler89770b02020-06-13 10:40:47 -050010 file://gpsd.init \
Brad Bishop316dfdd2018-06-25 12:45:53 -040011"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050012SRC_URI[md5sum] = "b4f96cb01cbc06542b1cb66b3296078d"
13SRC_URI[sha256sum] = "522c2362a7eb2d7ac37eaa1504f12aded1c373479a87ba06cc6795974b567bbc"
Brad Bishop316dfdd2018-06-25 12:45:53 -040014
Andrew Geissler82c905d2020-04-13 13:39:40 -050015inherit scons update-rc.d python3-dir python3native systemd update-alternatives
Brad Bishop316dfdd2018-06-25 12:45:53 -040016
17INITSCRIPT_PACKAGES = "gpsd-conf"
18INITSCRIPT_NAME = "gpsd"
19INITSCRIPT_PARAMS = "defaults 35"
20
21SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
22
23export STAGING_INCDIR
24export STAGING_LIBDIR
25
Andrew Geissler2ee498a2020-05-29 15:52:06 -050026CLEANBROKEN = "1"
27
Brad Bishope42b3e32020-01-15 22:08:42 -050028PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb"
Brad Bishop26bdd442019-08-16 17:08:17 -040029PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5"
Brad Bishop15ae2502019-06-18 21:44:24 -040030PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase"
Brad Bishope42b3e32020-01-15 22:08:42 -050031PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032EXTRA_OESCONS = " \
33 sysroot=${STAGING_DIR_TARGET} \
34 libQgpsmm='false' \
Brad Bishop26bdd442019-08-16 17:08:17 -040035 debug='false' \
36 nostrip='true' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040037 systemd='${SYSTEMD_OESCONS}' \
38 libdir='${libdir}' \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050039 udevdir='${nonarch_base_libdir}/udev' \
40 unitdir='${systemd_system_unitdir}' \
Brad Bishop26bdd442019-08-16 17:08:17 -040041 manbuild='false' \
Andrew Geissler2ee498a2020-05-29 15:52:06 -050042 LINK='${CC}' \
Brad Bishop316dfdd2018-06-25 12:45:53 -040043 ${PACKAGECONFIG_CONFARGS} \
44"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050045# This cannot be used, because then chrpath is not found and only static lib is built
Brad Bishop316dfdd2018-06-25 12:45:53 -040046# target=${HOST_SYS}
47
Patrick Williams213cb262021-08-07 19:21:33 -050048do_compile:prepend() {
Brad Bishop316dfdd2018-06-25 12:45:53 -040049 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
50 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
51 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050052 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040053 export LINKFLAGS="${LDFLAGS}"
54}
55
56do_install() {
57 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
58 export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
59 export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050060 export LD="${CC}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040061 export LINKFLAGS="${LDFLAGS}"
62
63 export DESTDIR="${D}"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050064 # prefix is used for RPATH and DESTDIR/prefix for installation
65 ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} udev-install ${EXTRA_OESCONS} || \
Brad Bishop316dfdd2018-06-25 12:45:53 -040066 bbfatal "scons install execution failed."
67}
68
Patrick Williams213cb262021-08-07 19:21:33 -050069do_install:append() {
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050070 install -d ${D}${sysconfdir}/init.d
71 install -m 0755 ${WORKDIR}/gpsd.init ${D}${sysconfdir}/init.d/gpsd
72 install -d ${D}${sysconfdir}/default
73 install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}${sysconfdir}/default/gpsd.default
Brad Bishop316dfdd2018-06-25 12:45:53 -040074
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050075 # Support for python
76 install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
77 install -m 755 ${S}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
Brad Bishop316dfdd2018-06-25 12:45:53 -040078}
79
Andrew Geissler82c905d2020-04-13 13:39:40 -050080PACKAGES =+ "libgps libgpsd python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080081
Patrick Williams213cb262021-08-07 19:21:33 -050082RPROVIDES:${PN}-dbg += "python-pygps-dbg"
Brad Bishop316dfdd2018-06-25 12:45:53 -040083
Patrick Williams213cb262021-08-07 19:21:33 -050084FILES:${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
Brad Bishop316dfdd2018-06-25 12:45:53 -040085 ${libdir}/libQgpsmm.prl"
86
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050087FILES:${PN}-doc += "${datadir}/${BPN}/doc"
88
Patrick Williams213cb262021-08-07 19:21:33 -050089RDEPENDS:${PN} = "gpsd-gpsctl"
90RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040091
Patrick Williams213cb262021-08-07 19:21:33 -050092SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050093FILES:gpsd-udev = "${nonarch_base_libdir}/udev"
Patrick Williams213cb262021-08-07 19:21:33 -050094RDEPENDS:gpsd-udev += "udev gpsd-conf"
Brad Bishop316dfdd2018-06-25 12:45:53 -040095
Patrick Williams213cb262021-08-07 19:21:33 -050096SUMMARY:libgpsd = "C service library used for communicating with gpsd"
97FILES:libgpsd = "${libdir}/libgpsd.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -040098
Patrick Williams213cb262021-08-07 19:21:33 -050099SUMMARY:libgps = "C service library used for communicating with gpsd"
100FILES:libgps = "${libdir}/libgps.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400101
Patrick Williams213cb262021-08-07 19:21:33 -0500102SUMMARY:gpsd-conf = "gpsd configuration files and init scripts"
103FILES:gpsd-conf = "${sysconfdir}"
104CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400105
Patrick Williams213cb262021-08-07 19:21:33 -0500106SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes"
107FILES:gpsd-gpsctl = "${bindir}/gpsctl"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400108
Patrick Williams213cb262021-08-07 19:21:33 -0500109SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS"
Brad Bishop26bdd442019-08-16 17:08:17 -0400110# Python files are required for gps/fake, required for gpsfake.
Patrick Williams213cb262021-08-07 19:21:33 -0500111FILES:gps-utils = "${bindir}/* ${libdir}/gps/*.py ${libdir}/gps/*.so"
112RDEPENDS:gps-utils = "python3-pygps"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400113
Patrick Williams213cb262021-08-07 19:21:33 -0500114SUMMARY:python3-pygps = "Python bindings to gpsd"
115FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info"
116RDEPENDS:python3-pygps = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500117 python3-core \
118 python3-io \
119 python3-threading \
120 python3-terminal \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400121 gpsd \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500122 python3-json"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400123
Patrick Williams213cb262021-08-07 19:21:33 -0500124RPROVIDES:${PN} += "${PN}-systemd"
125RREPLACES:${PN} += "${PN}-systemd"
126RCONFLICTS:${PN} += "${PN}-systemd"
127SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400128
Patrick Williams213cb262021-08-07 19:21:33 -0500129ALTERNATIVE:${PN} = "gpsd-defaults"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400130ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
131ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"