2013-06-05 17:53:30 -06:00
|
|
|
################################################################################
|
2010-11-02 13:32:47 -06:00
|
|
|
#
|
|
|
|
# gpsd
|
|
|
|
#
|
2013-06-05 17:53:30 -06:00
|
|
|
################################################################################
|
2013-02-25 16:16:09 -07:00
|
|
|
|
package/gpsd: bump to 3.24
In 3.24, the NTRIP and NMEA0183 drivers are now always enabled, so the
configure options ntrip and nmea0183 have been removed (upstream commits
f8cf4c922 and 838220fee respectively).
As a consequence, drop the options in menuconfig. We do not need to add
legacy support for those options. Indeed, users who had those enabled
will still get the feature, and those who did not will get them, in both
cases without loss of feature.
Finally, we need to fix a runtime issue that makes the kernel segfault
(yeah, that much), because upstream has been yoda-ifying their code, and
they actually borked a comparison. The issue has been fixed upstream,
but that is in a patch tha cobbles up many changes and brings new stuff,
so we just fix the issue with an unupstreamable patch (which we can drop
when we bump when upstream tags a newer release and we update).
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-09-16 07:06:16 -06:00
|
|
|
GPSD_VERSION = 3.24
|
2014-08-25 03:40:23 -06:00
|
|
|
GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd
|
2019-08-04 07:44:31 -06:00
|
|
|
GPSD_LICENSE = BSD-2-Clause
|
2012-07-23 13:29:36 -06:00
|
|
|
GPSD_LICENSE_FILES = COPYING
|
2021-03-21 03:15:37 -06:00
|
|
|
GPSD_CPE_ID_VENDOR = gpsd_project
|
2021-07-26 02:34:23 -06:00
|
|
|
GPSD_SELINUX_MODULES = gpsd
|
2010-11-02 13:32:47 -06:00
|
|
|
GPSD_INSTALL_STAGING = YES
|
2012-07-23 13:29:36 -06:00
|
|
|
|
2022-01-08 03:25:42 -07:00
|
|
|
GPSD_DEPENDENCIES = host-scons host-pkgconf
|
2012-07-23 13:29:36 -06:00
|
|
|
|
|
|
|
GPSD_LDFLAGS = $(TARGET_LDFLAGS)
|
2015-11-22 05:24:00 -07:00
|
|
|
GPSD_CFLAGS = $(TARGET_CFLAGS)
|
2021-08-03 06:07:14 -06:00
|
|
|
GPSD_CXXFLAGS = $(TARGET_CXXFLAGS)
|
2012-07-23 13:29:36 -06:00
|
|
|
|
|
|
|
GPSD_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
|
|
|
|
|
|
|
|
GPSD_SCONS_OPTS = \
|
2019-08-05 23:19:19 -06:00
|
|
|
arch=$(ARCH) \
|
2018-10-27 14:54:15 -06:00
|
|
|
manbuild=no \
|
2019-08-05 23:19:19 -06:00
|
|
|
prefix=/usr \
|
|
|
|
sysroot=$(STAGING_DIR) \
|
|
|
|
strip=no \
|
2019-08-05 23:19:20 -06:00
|
|
|
qt=no \
|
2019-05-29 17:02:41 -06:00
|
|
|
systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
|
2012-07-23 13:29:36 -06:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_DEPENDENCIES += ncurses
|
2012-07-23 13:29:36 -06:00
|
|
|
else
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += ncurses=no
|
2012-07-23 13:29:36 -06:00
|
|
|
endif
|
|
|
|
|
2010-11-02 13:32:47 -06:00
|
|
|
# Build libgpsmm if we've got C++
|
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_LDFLAGS += -lstdc++
|
2016-11-25 04:00:42 -07:00
|
|
|
GPSD_CFLAGS += -std=gnu++98
|
|
|
|
GPSD_CXXFLAGS += -std=gnu++98
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += libgpsmm=yes
|
2010-11-02 13:32:47 -06:00
|
|
|
else
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += libgpsmm=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
2019-06-14 15:03:33 -06:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
|
2017-08-13 02:59:26 -06:00
|
|
|
GPSD_CFLAGS += -O0
|
2021-08-03 06:07:14 -06:00
|
|
|
GPSD_CXXFLAGS += -O0
|
2015-11-22 05:24:00 -07:00
|
|
|
endif
|
|
|
|
|
2010-11-02 13:32:47 -06:00
|
|
|
# If libusb is available build it before so the package can use it
|
|
|
|
ifeq ($(BR2_PACKAGE_LIBUSB),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_DEPENDENCIES += libusb
|
2012-07-23 13:29:36 -06:00
|
|
|
else
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += usb=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
2012-07-23 13:29:36 -06:00
|
|
|
# If bluetooth is available build it before so the package can use it
|
2020-01-12 15:08:39 -07:00
|
|
|
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
|
2020-01-11 02:18:32 -07:00
|
|
|
GPSD_DEPENDENCIES += bluez5_utils
|
2012-07-23 13:29:36 -06:00
|
|
|
else
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += bluez=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
2015-11-27 09:25:57 -07:00
|
|
|
# If pps-tools is available, build it before so the package can use it
|
|
|
|
# (HAVE_SYS_TIMEPPS_H).
|
|
|
|
ifeq ($(BR2_PACKAGE_PPS_TOOLS),y)
|
|
|
|
GPSD_DEPENDENCIES += pps-tools
|
|
|
|
endif
|
|
|
|
|
2012-07-23 13:29:36 -06:00
|
|
|
ifeq ($(BR2_PACKAGE_DBUS_GLIB),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += dbus_export=yes
|
|
|
|
GPSD_DEPENDENCIES += dbus-glib
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Protocol support
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_ASHTECH),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += ashtech=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_AIVDM),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += aivdm=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_EARTHMATE),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += earthmate=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_EVERMORE),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += evermore=no
|
2012-07-23 13:29:36 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_FURY),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += fury=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_FV18),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += fv18=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_GARMIN),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += garmin=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
2011-11-09 01:38:41 -07:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_GARMIN_SIMPLE_TXT),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += garmintxt=no
|
2012-07-23 13:29:36 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_GEOSTAR),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += geostar=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_GPSCLOCK),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += gpsclock=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
2018-10-07 13:29:45 -06:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_GREIS),y)
|
|
|
|
GPSD_SCONS_OPTS += greis=no
|
|
|
|
endif
|
2018-02-03 14:40:53 -07:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_ISYNC),y)
|
|
|
|
GPSD_SCONS_OPTS += isync=no
|
|
|
|
endif
|
2010-11-02 13:32:47 -06:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_ITRAX),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += itrax=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_NAVCOM),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += navcom=no
|
2012-07-23 13:29:36 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_NMEA2000),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += nmea2000=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_OCEANSERVER),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += oceanserver=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_ONCORE),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += oncore=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_RTCM104V2),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += rtcm104v2=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_RTCM104V3),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += rtcm104v3=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_SIRF),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += sirf=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
2019-05-25 08:17:26 -06:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_SKYTRAQ),y)
|
|
|
|
GPSD_SCONS_OPTS += skytraq=no
|
|
|
|
endif
|
2010-11-02 13:32:47 -06:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_SUPERSTAR2),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += superstar2=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_TRIMBLE_TSIP),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += tsip=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_TRIPMATE),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += tripmate=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
2012-07-23 13:29:36 -06:00
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_TRUE_NORTH),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += tnt=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_UBX),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += ublox=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Features
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_SQUELCH),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += squelch=yes
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_PROFILING),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += profiling=yes
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifneq ($(BR2_PACKAGE_GPSD_CLIENT_DEBUG),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += clientdebug=no
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_USER),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += gpsd_user=$(BR2_PACKAGE_GPSD_USER_VALUE)
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_GROUP),y)
|
2015-03-31 01:21:57 -06:00
|
|
|
GPSD_SCONS_OPTS += gpsd_group=$(BR2_PACKAGE_GPSD_GROUP_VALUE)
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_MAX_CLIENT),y)
|
2019-05-25 07:52:41 -06:00
|
|
|
GPSD_SCONS_OPTS += max_clients=$(BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE)
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
|
2019-05-25 07:52:41 -06:00
|
|
|
GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
|
2010-11-02 13:32:47 -06:00
|
|
|
endif
|
|
|
|
|
2020-11-01 04:47:12 -07:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
|
|
GPSD_SCONS_OPTS += \
|
|
|
|
python=yes \
|
|
|
|
python_libdir="/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages"
|
|
|
|
else
|
|
|
|
GPSD_SCONS_OPTS += python=no
|
|
|
|
endif
|
|
|
|
|
2020-06-21 14:41:32 -06:00
|
|
|
GPSD_SCONS_ENV += \
|
|
|
|
LDFLAGS="$(GPSD_LDFLAGS)" \
|
|
|
|
CFLAGS="$(GPSD_CFLAGS)" \
|
2021-08-03 06:07:14 -06:00
|
|
|
CCFLAGS="$(GPSD_CFLAGS)" \
|
|
|
|
CXXFLAGS="$(GPSD_CXXFLAGS)"
|
2012-07-23 13:29:36 -06:00
|
|
|
|
|
|
|
define GPSD_BUILD_CMDS
|
|
|
|
(cd $(@D); \
|
|
|
|
$(GPSD_SCONS_ENV) \
|
2022-01-08 03:15:19 -07:00
|
|
|
$(SCONS) \
|
2012-07-23 13:29:36 -06:00
|
|
|
$(GPSD_SCONS_OPTS))
|
2010-11-02 13:32:47 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
define GPSD_INSTALL_TARGET_CMDS
|
2012-07-23 13:29:36 -06:00
|
|
|
(cd $(@D); \
|
|
|
|
$(GPSD_SCONS_ENV) \
|
2012-07-24 16:01:55 -06:00
|
|
|
DESTDIR=$(TARGET_DIR) \
|
2022-01-08 03:15:19 -07:00
|
|
|
$(SCONS) \
|
2012-07-23 13:29:36 -06:00
|
|
|
$(GPSD_SCONS_OPTS) \
|
2019-05-29 17:02:41 -06:00
|
|
|
$(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install))
|
2014-11-30 07:18:07 -07:00
|
|
|
endef
|
|
|
|
|
|
|
|
define GPSD_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
|
|
|
|
$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
|
2010-11-02 13:32:47 -06:00
|
|
|
endef
|
|
|
|
|
package/gpsd: actually wait for after chrony
We use gpsd's upstream systemd service unit files, which define a
dependency on chronyd.service. And indeed, upstream chrony does
provide an example service unit file chronyd.service.
However, in Buildroot, we are not using chrony's upstream unit, we are
providing our own, much simplified as compared to upstream. We install
that unit file as chrony.service. Notice that subtle difference in the
name: upstream's is chronyd, with a trailing 'd', while ours just
chrony, without the trailing 'd'.
As a consequence, in a Buildroot-built system, gpsd does not wait for
after chrony is started, which causes all kind of mayhem when gpsd
actually needs to talk to chrony.
We have multiple options:
1. use chrony's upstream unit file;
2 rename the chrony service file as installed by Buildroot, to match
what chrony would actually do;
3. tweak gpsd's unit file to refer to chrony.service, not
chronyd.service;
4. leverage systemd's flexibility in how units are defined, and provide
a drop-in to complement gpsd's unit to also wait for chrony.service.
For 1. it is totally unknown why we do have our unit file to begin with,
rather than use upstream's. Since upstream's is much more complex than
ours, using it might have unforetold consequences.
Going with 2. seems the easiest at first sight, but then it would break
systems where users provide their own drop-ins for chrony, as they would
no longer match.
3. is relatively easy, but running sed is not entirely nice. Besides, it
semantically should be a post-install hook, rather than a systemd-init
command, but again that makes things a bit more ugly. Also, some people
may have their own gpsd.service in an overlay or whatever, which would
break our fixup.
Solution 4. is pretty straightforward, although it is not ideal either.
To be noted: some distributions, like Ubuntu 20.04 at least, do install
the chrony unit file as chrony.service, like Buildroot does. However,
there does not appear to be any fixup in gpsd for this discrepancy, as
their gpsd install still refers to chronyd.service. So that does not
help us decide what to do.
So, eventually, we decided to go with solution 4, which has the least
impact on the system, and keeps the status-quo for all other use-cases.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-09-20 06:45:01 -06:00
|
|
|
# When using chrony, wait for after Buildroot's chrony.service
|
|
|
|
ifeq ($(BR2_PACKAGE_CHRONY),y)
|
|
|
|
define GPSD_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 0644 $(GPSD_PKGDIR)/br-chrony.conf \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service.d/br-chrony.conf
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2012-07-23 13:29:36 -06:00
|
|
|
define GPSD_INSTALL_STAGING_CMDS
|
|
|
|
(cd $(@D); \
|
|
|
|
$(GPSD_SCONS_ENV) \
|
2012-07-24 16:01:55 -06:00
|
|
|
DESTDIR=$(STAGING_DIR) \
|
2022-01-08 03:15:19 -07:00
|
|
|
$(SCONS) \
|
2012-07-23 13:29:36 -06:00
|
|
|
$(GPSD_SCONS_OPTS) \
|
|
|
|
install)
|
2010-11-02 13:32:47 -06:00
|
|
|
endef
|
|
|
|
|
2019-05-29 17:02:41 -06:00
|
|
|
# After the udev rule is installed, make it writable so that this
|
2015-11-05 11:41:53 -07:00
|
|
|
# package can be re-built/re-installed.
|
2014-02-07 06:21:33 -07:00
|
|
|
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
|
2013-06-12 11:52:35 -06:00
|
|
|
define GPSD_INSTALL_UDEV_RULES
|
2015-11-05 11:41:53 -07:00
|
|
|
chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
|
2013-06-12 11:52:35 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
GPSD_POST_INSTALL_TARGET_HOOKS += GPSD_INSTALL_UDEV_RULES
|
|
|
|
endif
|
|
|
|
|
2012-07-23 13:29:36 -06:00
|
|
|
$(eval $(generic-package))
|