From 8f459a71fb86724ac2f8ad01f57f35488a0be0ea Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Mon, 27 Dec 2021 18:27:44 +0200 Subject: Add original gpsd 3.23.1 as is from meta-openembedded:245afbc8bd3bf6e91d02a99532ab8cab26e00024 --- recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init | 158 ++++++++++++++++++++++++++ recipes-navigation/gpsd/gpsd_3.23.1.bb | 152 +++++++++++++++++++++++++ 2 files changed, 310 insertions(+) create mode 100644 recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init create mode 100644 recipes-navigation/gpsd/gpsd_3.23.1.bb diff --git a/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init b/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init new file mode 100644 index 0000000..c9db0bb --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init @@ -0,0 +1,158 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: gpsd +# Required-Start: $remote_fs $syslog $network +# Should-Start: bluetooth dbus udev +# Required-Stop: $remote_fs $syslog $network +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# X-Start-Before: ntp +# Short-Description: GPS (Global Positioning System) daemon start/stop script +# Description: Start/Stop script for the gpsd service daemon, +# which is able to monitor one or more GPS devices +# connected to a host computer, making all data on +# the location and movements of the sensors available +# to be queried on TCP port 2947. +### END INIT INFO + + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="GPS (Global Positioning System) daemon" +NAME="gpsd" +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then + GPSD_SOCKET=/var/run/gpsd.sock +fi + +if [ -n "$GPSD_SOCKET" ]; then + GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET" +fi + +DAEMON_ARGS="$GPSD_OPTIONS $DEVICES" + +# +# Function that starts the daemon/service +# +do_start() { + local status pid + + status=0 + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "$DESC already running ($pid)." + exit 1 + ;; + *) + echo "Starting $DESC ..." + exec $DAEMON $DAEMON_ARGS >/dev/null 2>&1 || status=$? + echo "ERROR: Failed to start $DESC." + exit $status + ;; + esac +} + +# +# Function that stops the daemon/service +# +do_stop() { + local pid status + + status=0 + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + # Exit when fail to stop, the kill would complain when fail + kill -s 15 $pid >/dev/null && rm -f $PIDFILE && \ + echo "Stopped $DESC ($pid)." || exit $? + ;; + *) + echo "$DESC is not running; none killed." >&2 + ;; + esac + + return $status +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + local pid status + + status=0 + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "Reloading $DESC ..." + kill -s 1 $pid || exit $? + ;; + *) + echo "$DESC is not running; none reloaded." >&2 + ;; + esac + exit $status +} + + +# +# Function that shows the daemon/service status +# +status_of_proc () { + local pid status + + status=0 + # pidof output null when no program is running, so no "2>/dev/null". + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "$DESC is running ($pid)." + exit 0 + ;; + *) + echo "$DESC is not running." >&2 + exit $status + ;; + esac +} + +case "$1" in +start) + do_start + ;; +stop) + do_stop || exit $? + ;; +status) + status_of_proc + ;; +restart) + # Always start the service regardless the status of do_stop + do_stop + do_start + ;; +force-reload) + # Only start the service when do_stop succeeds + do_stop && do_start + ;; +*) + echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb new file mode 100644 index 0000000..c11d4c7 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -0,0 +1,152 @@ +SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices" +SECTION = "console/network" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=7a5d174db44ec45f9638b2c747806821" +DEPENDS = "dbus ncurses python3 pps-tools" +PROVIDES = "virtual/gpsd" + +SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ + file://gpsd.init \ + " +SRC_URI[sha256sum] = "0b991ce9a46538c4ea450f7a8ee428ff44fb4f8d665fddf2ffe40fe0ae9a6c09" + +inherit scons update-rc.d python3-dir python3native systemd update-alternatives pkgconfig + +INITSCRIPT_PACKAGES = "gpsd-conf" +INITSCRIPT_NAME = "gpsd" +INITSCRIPT_PARAMS = "defaults 35" + +SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}" + +export STAGING_INCDIR +export STAGING_LIBDIR + +CLEANBROKEN = "1" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} usb" +PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5" +PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase" +PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1" +EXTRA_OESCONS = " \ + sysroot=${STAGING_DIR_TARGET} \ + libQgpsmm='false' \ + debug='false' \ + nostrip='true' \ + systemd='${SYSTEMD_OESCONS}' \ + libdir='${libdir}' \ + sbindir='${sbindir}' \ + udevdir='${nonarch_base_libdir}/udev' \ + unitdir='${systemd_system_unitdir}' \ + manbuild='false' \ + LINK='${CC}' \ + ${PACKAGECONFIG_CONFARGS} \ +" +# This cannot be used, because then chrpath is not found and only static lib is built +# target=${HOST_SYS} + +do_compile:prepend() { + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" + export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" + export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" + export CC="${CC}" + export LD="${CC}" + export LINKFLAGS="${LDFLAGS}" +} + +do_install() { + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" + export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" + export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" + export LD="${CC}" + export LINKFLAGS="${LDFLAGS}" + + export DESTDIR="${D}" + # prefix is used for RPATH and DESTDIR/prefix for installation + ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} udev-install ${EXTRA_OESCONS} || \ + bbfatal "scons install execution failed." +} + +do_install:append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/gpsd.init ${D}${sysconfdir}/init.d/gpsd + install -d ${D}${sysconfdir}/default + install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}${sysconfdir}/default/gpsd.default + + # Support for python + install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps + install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps +} + +PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils" + +RPROVIDES:${PN}-dbg += "python-pygps-dbg" + +FILES:${PN}-dev += "${libdir}/libQgpsmm.prl" + +FILES:${PN}-doc += "${datadir}/${BPN}/doc" + +RDEPENDS:${PN} = "gpsd-gpsctl" +RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" + +SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging" +FILES:gpsd-udev = "${nonarch_base_libdir}/udev" +RDEPENDS:gpsd-udev += "udev gpsd-conf" + +SUMMARY:libgps = "C service library used for communicating with gpsd" +FILES:libgps = "${libdir}/libgps.so.*" + +SUMMARY:gpsd-conf = "gpsd configuration files and init scripts" +FILES:gpsd-conf = "${sysconfdir}" +CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default" + +SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes" +FILES:gpsd-gpsctl = "${bindir}/gpsctl" + +SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS" +# Python files are required for gps/fake, required for gpsfake. +FILES:gps-utils = "\ + ${bindir}/cgps \ + ${bindir}/gegps \ + ${bindir}/gps2udp \ + ${bindir}/gpscat \ + ${bindir}/gpscsv \ + ${bindir}/gpsctl \ + ${bindir}/gpsdebuginfo \ + ${bindir}/gpsdecode \ + ${bindir}/gpsfake \ + ${bindir}/gpsmon \ + ${bindir}/gpspipe \ + ${bindir}/gpsplot \ + ${bindir}/gpsprof \ + ${bindir}/gpsrinex \ + ${bindir}/gpssnmp \ + ${bindir}/gpssubframe \ + ${bindir}/gpxlogger \ + ${bindir}/lcdgps \ + ${bindir}/ntpshmmon \ + ${bindir}/ppscheck \ + ${bindir}/ubxtool \ + ${bindir}/xgps \ + ${bindir}/xgpsspeed \ + ${bindir}/zerk \ +" +RDEPENDS:gps-utils = "python3-pygps" + +SUMMARY:python3-pygps = "Python bindings to gpsd" +FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info" +RDEPENDS:python3-pygps = " \ + python3-core \ + python3-io \ + python3-threading \ + python3-terminal \ + gpsd \ + python3-json" + +RPROVIDES:${PN} += "${PN}-systemd" +RREPLACES:${PN} += "${PN}-systemd" +RCONFLICTS:${PN} += "${PN}-systemd" +SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service" + +ALTERNATIVE:${PN} = "gpsd-defaults" +ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd" +ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default" -- cgit v1.2.3 From 79234d6c45b73f6abddb7ceb1b303120aa763e14 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Mon, 27 Dec 2021 18:38:46 +0200 Subject: gpsd: convert from new override syntax to currently supported --- recipes-navigation/gpsd/gpsd_3.23.1.bb | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb index c11d4c7..5dfaf85 100644 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -44,7 +44,7 @@ EXTRA_OESCONS = " \ # This cannot be used, because then chrpath is not found and only static lib is built # target=${HOST_SYS} -do_compile:prepend() { +do_compile_prepend() { export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config" export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}" @@ -66,7 +66,7 @@ do_install() { bbfatal "scons install execution failed." } -do_install:append() { +do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/gpsd.init ${D}${sysconfdir}/init.d/gpsd install -d ${D}${sysconfdir}/default @@ -79,32 +79,32 @@ do_install:append() { PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils" -RPROVIDES:${PN}-dbg += "python-pygps-dbg" +RPROVIDES_${PN}-dbg += "python-pygps-dbg" -FILES:${PN}-dev += "${libdir}/libQgpsmm.prl" +FILES_${PN}-dev += "${libdir}/libQgpsmm.prl" -FILES:${PN}-doc += "${datadir}/${BPN}/doc" +FILES_${PN}-doc += "${datadir}/${BPN}/doc" -RDEPENDS:${PN} = "gpsd-gpsctl" -RRECOMMENDS:${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" +RDEPENDS_${PN} = "gpsd-gpsctl" +RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" -SUMMARY:gpsd-udev = "udev relevant files to use gpsd hotplugging" -FILES:gpsd-udev = "${nonarch_base_libdir}/udev" -RDEPENDS:gpsd-udev += "udev gpsd-conf" +SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging" +FILES_gpsd-udev = "${nonarch_base_libdir}/udev" +RDEPENDS_gpsd-udev += "udev gpsd-conf" -SUMMARY:libgps = "C service library used for communicating with gpsd" -FILES:libgps = "${libdir}/libgps.so.*" +SUMMARY_libgps = "C service library used for communicating with gpsd" +FILES_libgps = "${libdir}/libgps.so.*" -SUMMARY:gpsd-conf = "gpsd configuration files and init scripts" -FILES:gpsd-conf = "${sysconfdir}" -CONFFILES:gpsd-conf = "${sysconfdir}/default/gpsd.default" +SUMMARY_gpsd-conf = "gpsd configuration files and init scripts" +FILES_gpsd-conf = "${sysconfdir}" +CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default" -SUMMARY:gpsd-gpsctl = "Tool for tweaking GPS modes" -FILES:gpsd-gpsctl = "${bindir}/gpsctl" +SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes" +FILES_gpsd-gpsctl = "${bindir}/gpsctl" -SUMMARY:gps-utils = "Utils used for simulating, monitoring,... a GPS" +SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS" # Python files are required for gps/fake, required for gpsfake. -FILES:gps-utils = "\ +FILES_gps-utils = "\ ${bindir}/cgps \ ${bindir}/gegps \ ${bindir}/gps2udp \ @@ -130,11 +130,11 @@ FILES:gps-utils = "\ ${bindir}/xgpsspeed \ ${bindir}/zerk \ " -RDEPENDS:gps-utils = "python3-pygps" +RDEPENDS_gps-utils = "python3-pygps" -SUMMARY:python3-pygps = "Python bindings to gpsd" -FILES:python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info" -RDEPENDS:python3-pygps = " \ +SUMMARY_python3-pygps = "Python bindings to gpsd" +FILES_python3-pygps = "${PYTHON_SITEPACKAGES_DIR}/* ${libdir}/gps/*.py ${libdir}/*.egg-info" +RDEPENDS_python3-pygps = " \ python3-core \ python3-io \ python3-threading \ @@ -142,11 +142,11 @@ RDEPENDS:python3-pygps = " \ gpsd \ python3-json" -RPROVIDES:${PN} += "${PN}-systemd" -RREPLACES:${PN} += "${PN}-systemd" -RCONFLICTS:${PN} += "${PN}-systemd" -SYSTEMD_SERVICE:${PN} = "${BPN}.socket ${BPN}ctl@.service" +RPROVIDES_${PN} += "${PN}-systemd" +RREPLACES_${PN} += "${PN}-systemd" +RCONFLICTS_${PN} += "${PN}-systemd" +SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service" -ALTERNATIVE:${PN} = "gpsd-defaults" +ALTERNATIVE_${PN} = "gpsd-defaults" ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd" ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default" -- cgit v1.2.3 From 8e3baf6f8b90a9455bee79ce0fb89207ef73e534 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Mon, 27 Dec 2021 23:17:30 +0200 Subject: gpsd: put gpspipe into a separate package --- recipes-navigation/gpsd/gpsd_3.23.1.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb index 5dfaf85..eebbe15 100644 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -77,7 +77,8 @@ do_install_append() { install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps } -PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils" + +PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gpspipe gps-utils" RPROVIDES_${PN}-dbg += "python-pygps-dbg" @@ -102,6 +103,9 @@ CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default" SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes" FILES_gpsd-gpsctl = "${bindir}/gpsctl" +SUMMARY_gpspipe = "Tool for connecting to gpsd and retrieve sentences" +FILES_gpspipe = "${bindir}/gpspipe" + SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS" # Python files are required for gps/fake, required for gpsfake. FILES_gps-utils = "\ -- cgit v1.2.3 From 754d0018a92e3b21c61171213c7deb774213b3b1 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Mon, 27 Dec 2021 23:58:04 +0200 Subject: gpsd: enable same gpsd features as in previous revs (ublox, etc.) --- recipes-navigation/gpsd/gpsd_3.23.1.bb | 52 +++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb index eebbe15..9af661e 100644 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -27,10 +27,11 @@ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', PACKAGECONFIG[bluez] = "bluez='true',bluez='false',bluez5" PACKAGECONFIG[qt] = "qt='yes' qt_versioned=5,qt='no',qtbase" PACKAGECONFIG[usb] = "usb='true',usb='false',libusb1" + +# Remove unneeded features. netfeed is needed by gpsmon EXTRA_OESCONS = " \ sysroot=${STAGING_DIR_TARGET} \ libQgpsmm='false' \ - debug='false' \ nostrip='true' \ systemd='${SYSTEMD_OESCONS}' \ libdir='${libdir}' \ @@ -38,9 +39,58 @@ EXTRA_OESCONS = " \ udevdir='${nonarch_base_libdir}/udev' \ unitdir='${systemd_system_unitdir}' \ manbuild='false' \ + debug='true' \ + strip='false' \ + chrpath='yes' \ + ublox='yes' \ + ubloxtimels='yes' \ + pps='yes' \ + gpsd_group='gps' \ + ntpshm='yes' \ + prefix='usr' \ + control_socket='false' \ + nofloats='yes' \ + ashtech='false' \ + earthmate='false' \ + evermore='false' \ + fury='false' \ + fv18='false' \ + garmin='false' \ + garmintxt='false' \ + geostar='false' \ + greis='false' \ + itrax='false' \ + mtk3301='false' \ + navcom='false' \ + nmea0183='true' \ + nmea2000='false' \ + oncore='false' \ + sirf='false' \ + skytraq='false' \ + superstar2='false' \ + tnt='false' \ + tripmate='false' \ + tsip='false' \ + ublox='true' \ + aivdm='false' \ + gpsclock='false' \ + isync='false' \ + ntrip='false' \ + oceanserver='false' \ + passthrough='false' \ + rtcm104v2='false' \ + rtcm104v3='false' \ + bluez='false' \ + ipv6='false' \ + netfeed='true' \ + usb='false' \ LINK='${CC}' \ ${PACKAGECONFIG_CONFARGS} \ " + + + + # This cannot be used, because then chrpath is not found and only static lib is built # target=${HOST_SYS} -- cgit v1.2.3 From a9d3d75f87a8c25e7cca7a6bc23784fae4c96bc9 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Tue, 28 Dec 2021 16:53:45 +0200 Subject: gps: reintegrate 3.20 patches to 3.23.1; remove unused init script --- .../gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch | 37 +++++ .../gpsd/gpsd-3.23.1/0006-ubxtimelps.patch | 77 ++++++++++ .../gpsd/gpsd-3.23.1/0007-add-gll-vtg.patch | 74 ++++++++++ recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init | 158 --------------------- recipes-navigation/gpsd/gpsd_3.23.1.bb | 35 +++-- 5 files changed, 212 insertions(+), 169 deletions(-) create mode 100644 recipes-navigation/gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch create mode 100644 recipes-navigation/gpsd/gpsd-3.23.1/0006-ubxtimelps.patch create mode 100644 recipes-navigation/gpsd/gpsd-3.23.1/0007-add-gll-vtg.patch delete mode 100644 recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init diff --git a/recipes-navigation/gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch b/recipes-navigation/gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch new file mode 100644 index 0000000..e17cfad --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch @@ -0,0 +1,37 @@ +From 799f41e6bf0955d04510f16b33cdf731d27a597a Mon Sep 17 00:00:00 2001 +From: Mykyta Dorokhin +Date: Tue, 28 Dec 2021 15:46:42 +0200 +Subject: [PATCH] Reintegrate 0006-itu_r_tf_460_6.patch + +--- + gpsd/ntpshmwrite.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gpsd/ntpshmwrite.c b/gpsd/ntpshmwrite.c +index 3f2ded3..5f0524b 100644 +--- a/gpsd/ntpshmwrite.c ++++ b/gpsd/ntpshmwrite.c +@@ -39,11 +39,20 @@ void ntp_write(volatile struct shmTime *shmseg, + * ITU-R TF.460-6, Section 2.1, says laep seconds can be primarily + * in Jun/Dec but may be in March or September + */ ++ ++/* This code contradicts page 3 section 2.1 of ITU-R RV.460-6 that ++ * leap second may occur at the last second of a month, with ++ * preference for December and June, 2nd preference to March and ++ * September. ++ * https://www.itu.int/dms_pubrec/itu-r/rec/tf/R-REC-TF.460-6-200202-I!!PDF-E.pdf ++ */ ++#ifdef NOTITU_R_TF_460_6 + (void)gmtime_r( &(td->real.tv_sec), &tm); + if ( 5 != tm.tm_mon && 11 != tm.tm_mon ) { + /* Not june, not December, no way */ + leap_notify = LEAP_NOWARNING; + } ++#endif /* NOTITU_R_TF_460_6 */ + + /* we use the shmTime mode 1 protocol + * +-- +2.25.1 + diff --git a/recipes-navigation/gpsd/gpsd-3.23.1/0006-ubxtimelps.patch b/recipes-navigation/gpsd/gpsd-3.23.1/0006-ubxtimelps.patch new file mode 100644 index 0000000..6f92aea --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23.1/0006-ubxtimelps.patch @@ -0,0 +1,77 @@ +From 830a414311ee287340b11b60f5c6bb58aad7074f Mon Sep 17 00:00:00 2001 +From: Mykyta Dorokhin +Date: Tue, 28 Dec 2021 15:35:38 +0200 +Subject: [PATCH] Add missing leap seconds parts + +--- + SConscript | 1 + + drivers/driver_ubx.c | 19 +++++++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/SConscript b/SConscript +index 8c6136d..3ae2a7b 100644 +--- a/SConscript ++++ b/SConscript +@@ -315,6 +315,7 @@ boolopts = ( + ("tripmate", True, "DeLorme TripMate support"), + ("tsip", True, "Trimble TSIP support"), + ("ublox", True, "u-blox Protocol support"), ++ ("ubloxtimels", False, "u-blox UBX-NAV-TIMELS support (leap second)"), + # Non-GPS protocols + ("aivdm", True, "AIVDM support"), + ("gpsclock", True, "GPSClock support"), +diff --git a/drivers/driver_ubx.c b/drivers/driver_ubx.c +index bea2de0..e9f8a1c 100644 +--- a/drivers/driver_ubx.c ++++ b/drivers/driver_ubx.c +@@ -3798,7 +3798,10 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf, + mask = ubx_msg_nav_timegps(session, &buf[UBX_PREFIX_LEN], data_len); + break; + case UBX_NAV_TIMELS: ++ GPSD_LOG(LOG_PROG, &session->context->errout, "UBX_NAV_TIMELS\n"); ++#ifdef UBLOXTIMELS_ENABLE + mask = ubx_msg_nav_timels(session, &buf[UBX_PREFIX_LEN], data_len); ++#endif // UBLOXTIMELS_ENABLE + break; + case UBX_NAV_TIMEQZSS: + GPSD_LOG(LOG_PROG, &session->context->errout, "UBX-NAV-TIMEQZSS\n"); +@@ -3853,6 +3856,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf, + GPSD_LOG(LOG_PROG, &session->context->errout, "UBX-RXM-RTCM\n"); + break; + case UBX_RXM_SFRB: ++ GPSD_LOG(LOG_DATA, &session->context->errout, "UBX_RXM_SFRB\n"); + mask = ubx_msg_rxm_sfrb(session, &buf[UBX_PREFIX_LEN], data_len); + break; + case UBX_RXM_SFRBX: +@@ -4267,6 +4271,14 @@ ubx_cfg_prt(struct gps_device_t *session, speed_t speed, const char parity, + (void)ubx_write(session, UBX_CLASS_CFG, 0x01, msg, 3); + } + ++#ifdef UBLOXTIMELS_ENABLE ++ msg[0] = 0x01; /* class */ ++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */ ++ msg[2] = 0xff; /* rate */ ++ (void)ubx_write(session, 0x06u, 0x01, msg, 3); ++#endif /* UBLOXTIMELS_ENABLE */ ++ ++ + } else { /* MODE_BINARY */ + // nmea to turn off + const unsigned char nmea_off[] = { +@@ -4349,6 +4361,13 @@ ubx_cfg_prt(struct gps_device_t *session, speed_t speed, const char parity, + (void)ubx_write(session, UBX_CLASS_CFG, 0x01, msg, 3); + } + ++#ifdef UBLOXTIMELS_ENABLE ++ msg[0] = 0x01; /* class */ ++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */ ++ msg[2] = 0xff; /* rate */ ++ (void)ubx_write(session, 0x06u, 0x01, msg, 3); ++#endif /* UBLOXTIMELS_ENABLE */ ++ + /* if protver unknown, turn on everything. Which may be too + * much for slower serial port speeds. Hope that we know protver + * later and can fix things then. */ +-- +2.25.1 + diff --git a/recipes-navigation/gpsd/gpsd-3.23.1/0007-add-gll-vtg.patch b/recipes-navigation/gpsd/gpsd-3.23.1/0007-add-gll-vtg.patch new file mode 100644 index 0000000..777c0ca --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23.1/0007-add-gll-vtg.patch @@ -0,0 +1,74 @@ +From 596089b8582097c1f934a5d25035353f00118965 Mon Sep 17 00:00:00 2001 +From: Mykyta Dorokhin +Date: Tue, 28 Dec 2021 15:56:07 +0200 +Subject: [PATCH] add GLL and VTG to 'gpspipe -r' output in binary mode + +--- + gpsd/pseudonmea.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/gpsd/pseudonmea.c b/gpsd/pseudonmea.c +index 2d63d0f..feb9867 100644 +--- a/gpsd/pseudonmea.c ++++ b/gpsd/pseudonmea.c +@@ -171,6 +171,21 @@ void gpsd_position_fix_dump(struct gps_device_t *session, + * Differential base station ID */ + (void)strlcat(bufp, ",", len); + nmea_add_checksum(bufp); ++ ++ //$GNGGA,103527.00,4957.22994,N,03618.97862,E,1,12,0.89,180.3,M,17.0,M,,*4B ++ //$GNGLL,4957.22997,N,03618.97858,E,103526.00,A,A*7B ++ //we use the same values as in GGA sentence ++ char *bufgll = &bufp[strlen(bufp)]; ++ (void)snprintf(bufgll, len, ++ "$GPGLL,%s,%c,%s,%c,%s,%c,A,", ++ lat_str, ++ ((session->gpsdata.fix.latitude > 0) ? 'N' : 'S'), ++ lon_str, ++ ((session->gpsdata.fix.longitude > 0) ? 'E' : 'W'), ++ time_str, ++ ((fixquality != FIX_QUALITY_INVALID) ? 'A' : 'V') ++ ); ++ nmea_add_checksum(bufgll); + } + } + +@@ -183,6 +198,7 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session, + char lat_str[BUF_SZ]; + char lon_str[BUF_SZ]; + char speed_str[BUF_SZ]; ++ char kspeed_str[BUF_SZ]; + char track_str[BUF_SZ]; + char var_str[BUF_SZ]; + char *var_dir = ""; +@@ -231,6 +247,27 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session, + time2_str, + var_str, var_dir); + nmea_add_checksum(bufp); ++ ++ //$GNRMC,114740.00,A,4957.22826,N,03618.97015,E,0.054,,091220,,,A*65 ++ //$GNVTG,,T,,M,0.054,N,0.100,K,A*3D ++ //1 = Track made good ++ //2 = Fixed text 'T' indicates that track made good is relative to true north ++ //3 = Track made good, degrees Magnetic ++ //4 = Magnetic track indicator - 'M' ++ //5 = Speed over ground in knots ++ //6 = Fixed text 'N' indicates that speed over ground in in knots ++ //7 = Speed over ground in kilometers/hour ++ //8 = Fixed text 'K' indicates that speed over ground is in kilometers/hour ++ //we use the same values as in RMC sentence ++ char *bufvtg = &bufp[strlen(bufp)]; ++ (void)snprintf(bufvtg, len, ++ "$GPVTG,%s,T,%s,M,%s,N,%s,K,A,", ++ track_str, ++ track_str,//it is not Magnetic track, but may be it is enough ++ speed_str, ++ f_str(session->gpsdata.fix.speed, "%.4f", kspeed_str) ++ ); ++ nmea_add_checksum(bufvtg); + } + + static void gpsd_binary_satellite_dump(struct gps_device_t *session, +-- +2.25.1 + diff --git a/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init b/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init deleted file mode 100644 index c9db0bb..0000000 --- a/recipes-navigation/gpsd/gpsd-3.23.1/gpsd.init +++ /dev/null @@ -1,158 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: gpsd -# Required-Start: $remote_fs $syslog $network -# Should-Start: bluetooth dbus udev -# Required-Stop: $remote_fs $syslog $network -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# X-Start-Before: ntp -# Short-Description: GPS (Global Positioning System) daemon start/stop script -# Description: Start/Stop script for the gpsd service daemon, -# which is able to monitor one or more GPS devices -# connected to a host computer, making all data on -# the location and movements of the sensors available -# to be queried on TCP port 2947. -### END INIT INFO - - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin - -DESC="GPS (Global Positioning System) daemon" -NAME="gpsd" -DAEMON=/usr/sbin/$NAME -PIDFILE=/var/run/$NAME.pid - -. /etc/init.d/functions || exit 1 - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then - GPSD_SOCKET=/var/run/gpsd.sock -fi - -if [ -n "$GPSD_SOCKET" ]; then - GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET" -fi - -DAEMON_ARGS="$GPSD_OPTIONS $DEVICES" - -# -# Function that starts the daemon/service -# -do_start() { - local status pid - - status=0 - pid=`pidofproc $NAME` || status=$? - case $status in - 0) - echo "$DESC already running ($pid)." - exit 1 - ;; - *) - echo "Starting $DESC ..." - exec $DAEMON $DAEMON_ARGS >/dev/null 2>&1 || status=$? - echo "ERROR: Failed to start $DESC." - exit $status - ;; - esac -} - -# -# Function that stops the daemon/service -# -do_stop() { - local pid status - - status=0 - pid=`pidofproc $NAME` || status=$? - case $status in - 0) - # Exit when fail to stop, the kill would complain when fail - kill -s 15 $pid >/dev/null && rm -f $PIDFILE && \ - echo "Stopped $DESC ($pid)." || exit $? - ;; - *) - echo "$DESC is not running; none killed." >&2 - ;; - esac - - return $status -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - local pid status - - status=0 - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - pid=`pidofproc $NAME` || status=$? - case $status in - 0) - echo "Reloading $DESC ..." - kill -s 1 $pid || exit $? - ;; - *) - echo "$DESC is not running; none reloaded." >&2 - ;; - esac - exit $status -} - - -# -# Function that shows the daemon/service status -# -status_of_proc () { - local pid status - - status=0 - # pidof output null when no program is running, so no "2>/dev/null". - pid=`pidofproc $NAME` || status=$? - case $status in - 0) - echo "$DESC is running ($pid)." - exit 0 - ;; - *) - echo "$DESC is not running." >&2 - exit $status - ;; - esac -} - -case "$1" in -start) - do_start - ;; -stop) - do_stop || exit $? - ;; -status) - status_of_proc - ;; -restart) - # Always start the service regardless the status of do_stop - do_stop - do_start - ;; -force-reload) - # Only start the service when do_stop succeeds - do_stop && do_start - ;; -*) - echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb index 9af661e..2d7ad0e 100644 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -6,8 +6,18 @@ DEPENDS = "dbus ncurses python3 pps-tools" PROVIDES = "virtual/gpsd" SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ - file://gpsd.init \ - " + file://0006-ubxtimelps.patch \ + file://0007-add-gll-vtg.patch \ + file://gpsd-default \ + file://gpsd \ + file://gpsd_ubx_fixed.sh \ + file://gpsd_ubx_settime.sh \ + file://gpsd_fixed.sh \ + file://gpsd_settime.sh \ + file://gpsd.rules \ + file://gpsd.service \ +" + SRC_URI[sha256sum] = "0b991ce9a46538c4ea450f7a8ee428ff44fb4f8d665fddf2ffe40fe0ae9a6c09" inherit scons update-rc.d python3-dir python3native systemd update-alternatives pkgconfig @@ -88,9 +98,6 @@ EXTRA_OESCONS = " \ ${PACKAGECONFIG_CONFARGS} \ " - - - # This cannot be used, because then chrpath is not found and only static lib is built # target=${HOST_SYS} @@ -117,10 +124,16 @@ do_install() { } do_install_append() { - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/gpsd.init ${D}${sysconfdir}/init.d/gpsd - install -d ${D}${sysconfdir}/default - install -m 0644 ${S}/packaging/deb/etc_default_gpsd ${D}${sysconfdir}/default/gpsd.default + install -d ${D}/${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/ + install -d ${D}/${sysconfdir}/default + install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/gpsd_ubx_fixed.sh ${D}${sbindir}/gpsd_ubx_fixed + install -m 0755 ${WORKDIR}/gpsd_ubx_settime.sh ${D}${sbindir}/gpsd_ubx_settime + install -m 0755 ${WORKDIR}/gpsd_fixed.sh ${D}${sbindir}/gpsd_fixed + install -m 0755 ${WORKDIR}/gpsd_settime.sh ${D}${sbindir}/gpsd_settime + # Support for python install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps @@ -136,7 +149,7 @@ FILES_${PN}-dev += "${libdir}/libQgpsmm.prl" FILES_${PN}-doc += "${datadir}/${BPN}/doc" -RDEPENDS_${PN} = "gpsd-gpsctl" +RDEPENDS_${PN} = "bash gpsd-gpsctl" RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf" SUMMARY_gpsd-udev = "udev relevant files to use gpsd hotplugging" @@ -149,6 +162,7 @@ FILES_libgps = "${libdir}/libgps.so.*" SUMMARY_gpsd-conf = "gpsd configuration files and init scripts" FILES_gpsd-conf = "${sysconfdir}" CONFFILES_gpsd-conf = "${sysconfdir}/default/gpsd.default" +RDEPENDS_gpsd-conf = "bash" SUMMARY_gpsd-gpsctl = "Tool for tweaking GPS modes" FILES_gpsd-gpsctl = "${bindir}/gpsctl" @@ -169,7 +183,6 @@ FILES_gps-utils = "\ ${bindir}/gpsdecode \ ${bindir}/gpsfake \ ${bindir}/gpsmon \ - ${bindir}/gpspipe \ ${bindir}/gpsplot \ ${bindir}/gpsprof \ ${bindir}/gpsrinex \ -- cgit v1.2.3 From 2aa50115b56c08abaf8664fc5b8ba444f775c874 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Wed, 29 Dec 2021 18:11:11 +0200 Subject: gps: expose a set of private dev headers --- recipes-navigation/gpsd/gpsd_3.23.1.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb index 2d7ad0e..4663856 100644 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.23.1.bb @@ -138,6 +138,16 @@ do_install_append() { # Support for python install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps + + # support for dev (development) + mkdir -p -m 0644 ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/gpsd.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/compiler.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/os_compat.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/ppsthread.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/timespec.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/gpsdclient.h ${D}/${includedir}/gps + install -m 0644 ${S}/buildtmp/include/gpsd_config.h ${D}/${includedir}/gps } -- cgit v1.2.3 From d3c5604b409b58434253ac010aa40cc9354f5530 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Fri, 21 Jan 2022 20:04:14 +0200 Subject: gpsd: allow gpsd preffered version to be redefined --- conf/distro/mlinux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/distro/mlinux.conf b/conf/distro/mlinux.conf index cb25273..fa8364d 100644 --- a/conf/distro/mlinux.conf +++ b/conf/distro/mlinux.conf @@ -72,4 +72,4 @@ require java.inc PREFERRED_VERSION_nodejs ?= "10.%" PREFERRED_VERSION_nodejs-native ?= "10.%" -PREFERRED_VERSION_gpsd = "3.20" +PREFERRED_VERSION_gpsd ?= "3.20" -- cgit v1.2.3