From 8d0fe8e515310454783d71ed35c0a1ebcfb90b97 Mon Sep 17 00:00:00 2001 From: Serhii Voloshynov Date: Tue, 8 Feb 2022 09:46:51 +0200 Subject: GPS sometimes does not detected on device start --- .../gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch | 37 ++++ .../gpsd/gpsd-3.23/0006-ubxtimelps.patch | 77 +++++++ .../gpsd/gpsd-3.23/0007-add-gll-vtg.patch | 74 +++++++ recipes-navigation/gpsd/gpsd_3.23.1.bb | 229 -------------------- recipes-navigation/gpsd/gpsd_3.23.bb | 234 +++++++++++++++++++++ 5 files changed, 422 insertions(+), 229 deletions(-) create mode 100644 recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch create mode 100644 recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch create mode 100644 recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch delete mode 100644 recipes-navigation/gpsd/gpsd_3.23.1.bb create mode 100644 recipes-navigation/gpsd/gpsd_3.23.bb diff --git a/recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch b/recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch new file mode 100644 index 0000000..e17cfad --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23/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/0006-ubxtimelps.patch b/recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch new file mode 100644 index 0000000..6f92aea --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23/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/0007-add-gll-vtg.patch b/recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch new file mode 100644 index 0000000..777c0ca --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.23/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.bb b/recipes-navigation/gpsd/gpsd_3.23.1.bb deleted file mode 100644 index 4663856..0000000 --- a/recipes-navigation/gpsd/gpsd_3.23.1.bb +++ /dev/null @@ -1,229 +0,0 @@ -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://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 - -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" - -# Remove unneeded features. netfeed is needed by gpsmon -EXTRA_OESCONS = " \ - sysroot=${STAGING_DIR_TARGET} \ - libQgpsmm='false' \ - nostrip='true' \ - systemd='${SYSTEMD_OESCONS}' \ - libdir='${libdir}' \ - sbindir='${sbindir}' \ - 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} - -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 ${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 - 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 -} - - -PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gpspipe gps-utils" - -RPROVIDES_${PN}-dbg += "python-pygps-dbg" - -FILES_${PN}-dev += "${libdir}/libQgpsmm.prl" - -FILES_${PN}-doc += "${datadir}/${BPN}/doc" - -RDEPENDS_${PN} = "bash 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" -RDEPENDS_gpsd-conf = "bash" - -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 = "\ - ${bindir}/cgps \ - ${bindir}/gegps \ - ${bindir}/gps2udp \ - ${bindir}/gpscat \ - ${bindir}/gpscsv \ - ${bindir}/gpsctl \ - ${bindir}/gpsdebuginfo \ - ${bindir}/gpsdecode \ - ${bindir}/gpsfake \ - ${bindir}/gpsmon \ - ${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" diff --git a/recipes-navigation/gpsd/gpsd_3.23.bb b/recipes-navigation/gpsd/gpsd_3.23.bb new file mode 100644 index 0000000..166ce0a --- /dev/null +++ b/recipes-navigation/gpsd/gpsd_3.23.bb @@ -0,0 +1,234 @@ +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://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] = "522c2362a7eb2d7ac37eaa1504f12aded1c373479a87ba06cc6795974b567bbc" + +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" + +# Remove unneeded features. netfeed is needed by gpsmon +EXTRA_OESCONS = " \ + sysroot=${STAGING_DIR_TARGET} \ + libQgpsmm='false' \ + nostrip='true' \ + systemd='${SYSTEMD_OESCONS}' \ + libdir='${libdir}' \ + sbindir='${sbindir}' \ + 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} + +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} install ${EXTRA_OESCONS} || \ + bbfatal "scons install execution failed." +} + +do_install_append() { + 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 udev + install -d ${D}/${sysconfdir}/udev/rules.d + install -m 0644 ${S}/gpsd.rules.in ${D}/${sysconfdir}/udev/rules.d/ + install -d ${D}${base_libdir}/udev/ + install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ + + # Support for python + install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps + install -m 755 ${S}/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 +} + + +PACKAGES =+ "libgps python3-pygps gpsd-udev gpsd-conf gpsd-gpsctl gpspipe gps-utils" + +RPROVIDES_${PN}-dbg += "python-pygps-dbg" + +FILES_${PN}-dev += "${libdir}/libQgpsmm.prl" + +FILES_${PN}-doc += "${datadir}/${BPN}/doc" + +RDEPENDS_${PN} = "bash 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" +RDEPENDS_gpsd-conf = "bash" + +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 = "\ + ${bindir}/cgps \ + ${bindir}/gegps \ + ${bindir}/gps2udp \ + ${bindir}/gpscat \ + ${bindir}/gpscsv \ + ${bindir}/gpsctl \ + ${bindir}/gpsdebuginfo \ + ${bindir}/gpsdecode \ + ${bindir}/gpsfake \ + ${bindir}/gpsmon \ + ${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