2018-02-25 02:23:58 +00:00
|
|
|
{ fetchurl, stdenv, scons, pkgconfig, dbus, dbus-glib
|
2016-07-09 16:50:13 +00:00
|
|
|
, ncurses, libX11, libXt, libXpm, libXaw, libXext
|
2011-06-07 21:51:13 +00:00
|
|
|
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
|
2013-11-23 23:02:03 +00:00
|
|
|
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
|
2018-07-04 11:28:07 +00:00
|
|
|
, pps-tools
|
2016-11-09 11:02:33 +00:00
|
|
|
, python2Packages
|
2013-11-23 23:02:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# TODO: put the X11 deps behind a guiSupport parameter for headless support
|
2009-05-31 11:29:42 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-09 18:35:00 +00:00
|
|
|
name = "gpsd-3.16";
|
2009-05-31 11:29:42 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz";
|
2016-07-09 18:35:00 +00:00
|
|
|
sha256 = "0a90ph4qrlz5kkcz2mwkfk3cmwy9fmglp94znz2y0gsd7bqrlmq3";
|
2009-05-31 11:29:42 +00:00
|
|
|
};
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
nativeBuildInputs = [
|
2020-03-27 13:47:48 +00:00
|
|
|
scons.py2 pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
|
2016-11-09 11:02:33 +00:00
|
|
|
python2Packages.python
|
|
|
|
python2Packages.wrapPython
|
2013-11-23 23:02:03 +00:00
|
|
|
];
|
2009-05-31 11:29:42 +00:00
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
buildInputs = [
|
2018-02-25 02:23:58 +00:00
|
|
|
python2Packages.python dbus dbus-glib ncurses libX11 libXt libXpm libXaw libXext
|
2018-07-04 11:28:07 +00:00
|
|
|
libxslt libusb1 pps-tools
|
2013-11-23 23:02:03 +00:00
|
|
|
];
|
2009-06-01 00:03:08 +00:00
|
|
|
|
2016-07-09 16:50:13 +00:00
|
|
|
pythonPath = [
|
2016-11-09 11:02:33 +00:00
|
|
|
python2Packages.pygobject2
|
|
|
|
python2Packages.pygtk
|
2016-07-09 16:50:13 +00:00
|
|
|
];
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
patches = [
|
|
|
|
./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
|
|
|
|
./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
|
2016-07-09 18:35:00 +00:00
|
|
|
|
|
|
|
# TODO: remove the patch with the next release
|
|
|
|
./0001-Use-pkgconfig-for-dbus-library.patch
|
2018-07-04 11:28:07 +00:00
|
|
|
# to be able to find pps-tools
|
|
|
|
./0002-scons-envs-patch.patch
|
2013-11-23 23:02:03 +00:00
|
|
|
];
|
2011-06-07 21:51:13 +00:00
|
|
|
|
2020-01-30 14:24:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '17i#include <sys/sysmacros.h>' serial.c
|
|
|
|
'';
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
# - leapfetch=no disables going online at build time to fetch leap-seconds
|
|
|
|
# info. See <gpsd-src>/build.txt for more info.
|
2018-11-12 02:52:07 +00:00
|
|
|
preBuild = ''
|
2015-01-08 09:26:49 +00:00
|
|
|
patchShebangs .
|
2016-07-09 18:35:00 +00:00
|
|
|
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
|
2018-11-12 02:52:07 +00:00
|
|
|
|
|
|
|
sconsFlags+=" udevdir=$out/lib/udev"
|
|
|
|
sconsFlags+=" python_libdir=$out/lib/${python2Packages.python.libPrefix}/site-packages"
|
2013-11-23 23:02:03 +00:00
|
|
|
'';
|
2009-05-31 11:29:42 +00:00
|
|
|
|
2018-11-12 02:52:07 +00:00
|
|
|
sconsFlags = [
|
|
|
|
"leapfetch=no"
|
|
|
|
"gpsd_user=${gpsdUser}"
|
|
|
|
"gpsd_group=${gpsdGroup}"
|
|
|
|
"systemd=yes"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
2013-11-23 23:02:03 +00:00
|
|
|
export LD_LIBRARY_PATH="$PWD"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: the udev rules file and the hotplug script need fixes to work on NixOS
|
2018-11-12 02:52:07 +00:00
|
|
|
preInstall = ''
|
2013-11-23 23:02:03 +00:00
|
|
|
mkdir -p "$out/lib/udev/rules.d"
|
|
|
|
'';
|
2019-11-04 11:23:53 +00:00
|
|
|
installTargets = [ "install" "udev-install" ];
|
2013-11-23 23:02:03 +00:00
|
|
|
|
2016-07-09 16:50:13 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapPythonProgramsIn $out/bin "$out $pythonPath"
|
|
|
|
'';
|
2009-06-01 00:03:08 +00:00
|
|
|
|
2014-03-15 14:22:32 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "GPS service daemon";
|
2009-05-31 11:29:42 +00:00
|
|
|
longDescription = ''
|
2014-03-15 14:22:32 +00:00
|
|
|
gpsd is a service daemon that monitors one or more GPSes or AIS
|
|
|
|
receivers attached to a host computer through serial or USB ports,
|
|
|
|
making all data on the location/course/velocity of the sensors
|
|
|
|
available to be queried on TCP port 2947 of the host computer. With
|
|
|
|
gpsd, multiple location-aware client applications (such as navigational
|
|
|
|
and wardriving software) can share access to receivers without
|
|
|
|
contention or loss of data. Also, gpsd responds to queries with a
|
|
|
|
format that is substantially easier to parse than the NMEA 0183 emitted
|
|
|
|
by most GPSes. The gpsd distribution includes a linkable C service
|
|
|
|
library, a C++ wrapper class, and a Python module that developers of
|
|
|
|
gpsd-aware applications can use to encapsulate all communication with
|
|
|
|
gpsd. Third-party client bindings for Java and Perl also exist.
|
2009-05-31 11:29:42 +00:00
|
|
|
|
|
|
|
Besides gpsd itself, the project provides auxiliary tools for
|
2014-03-15 14:22:32 +00:00
|
|
|
diagnostic monitoring and profiling of receivers and feeding
|
|
|
|
location-aware applications GPS/AIS logs for diagnostic purposes.
|
2009-05-31 11:29:42 +00:00
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://catb.org/gpsd/";
|
2020-05-29 14:27:55 +00:00
|
|
|
license = licenses.bsd3;
|
2014-03-15 14:22:32 +00:00
|
|
|
platforms = platforms.linux;
|
2016-07-09 16:50:13 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor rasendubi ];
|
2009-05-31 11:29:42 +00:00
|
|
|
};
|
|
|
|
}
|