2018-02-25 03:23:58 +01:00
|
|
|
{ fetchurl, stdenv, scons, pkgconfig, dbus, dbus-glib
|
2016-07-09 18:50:13 +02:00
|
|
|
, ncurses, libX11, libXt, libXpm, libXaw, libXext
|
2011-06-07 23:51:13 +02:00
|
|
|
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
|
2013-11-24 00:02:03 +01:00
|
|
|
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
|
2018-07-04 13:28:07 +02:00
|
|
|
, pps-tools
|
2016-11-09 12:02:33 +01:00
|
|
|
, python2Packages
|
2013-11-24 00:02:03 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
# TODO: put the X11 deps behind a guiSupport parameter for headless support
|
2009-05-31 13:29:42 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-09 20:35:00 +02:00
|
|
|
name = "gpsd-3.16";
|
2009-05-31 13:29:42 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz";
|
2016-07-09 20:35:00 +02:00
|
|
|
sha256 = "0a90ph4qrlz5kkcz2mwkfk3cmwy9fmglp94znz2y0gsd7bqrlmq3";
|
2009-05-31 13:29:42 +02:00
|
|
|
};
|
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
nativeBuildInputs = [
|
2016-07-09 18:50:13 +02:00
|
|
|
scons pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
|
2016-11-09 12:02:33 +01:00
|
|
|
python2Packages.python
|
|
|
|
python2Packages.wrapPython
|
2013-11-24 00:02:03 +01:00
|
|
|
];
|
2009-05-31 13:29:42 +02:00
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
buildInputs = [
|
2018-02-25 03:23:58 +01:00
|
|
|
python2Packages.python dbus dbus-glib ncurses libX11 libXt libXpm libXaw libXext
|
2018-07-04 13:28:07 +02:00
|
|
|
libxslt libusb1 pps-tools
|
2013-11-24 00:02:03 +01:00
|
|
|
];
|
2009-06-01 02:03:08 +02:00
|
|
|
|
2016-07-09 18:50:13 +02:00
|
|
|
pythonPath = [
|
2016-11-09 12:02:33 +01:00
|
|
|
python2Packages.pygobject2
|
|
|
|
python2Packages.pygtk
|
2016-07-09 18:50:13 +02:00
|
|
|
];
|
|
|
|
|
2013-11-24 00:02:03 +01: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 20:35:00 +02:00
|
|
|
|
|
|
|
# TODO: remove the patch with the next release
|
|
|
|
./0001-Use-pkgconfig-for-dbus-library.patch
|
2018-07-04 13:28:07 +02:00
|
|
|
# to be able to find pps-tools
|
|
|
|
./0002-scons-envs-patch.patch
|
2013-11-24 00:02:03 +01:00
|
|
|
];
|
2011-06-07 23:51:13 +02:00
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
# - leapfetch=no disables going online at build time to fetch leap-seconds
|
|
|
|
# info. See <gpsd-src>/build.txt for more info.
|
|
|
|
buildPhase = ''
|
2015-01-08 10:26:49 +01:00
|
|
|
patchShebangs .
|
2016-07-09 20:35:00 +02:00
|
|
|
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
|
2018-07-04 13:28:07 +02:00
|
|
|
scons \
|
|
|
|
-j $NIX_BUILD_CORES \
|
|
|
|
prefix="$out" \
|
|
|
|
leapfetch=no \
|
|
|
|
gpsd_user=${gpsdUser} \
|
|
|
|
gpsd_group=${gpsdGroup} \
|
|
|
|
systemd=yes \
|
|
|
|
udevdir="$out/lib/udev" \
|
|
|
|
python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages"
|
2013-11-24 00:02:03 +01:00
|
|
|
'';
|
2009-05-31 13:29:42 +02:00
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
checkPhase = ''
|
|
|
|
export LD_LIBRARY_PATH="$PWD"
|
|
|
|
scons check
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: the udev rules file and the hotplug script need fixes to work on NixOS
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/lib/udev/rules.d"
|
2016-07-09 18:50:13 +02:00
|
|
|
scons install udev-install
|
2013-11-24 00:02:03 +01:00
|
|
|
'';
|
|
|
|
|
2016-07-09 18:50:13 +02:00
|
|
|
postFixup = ''
|
|
|
|
wrapPythonProgramsIn $out/bin "$out $pythonPath"
|
|
|
|
'';
|
2009-06-01 02:03:08 +02:00
|
|
|
|
2014-03-15 15:22:32 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "GPS service daemon";
|
2009-05-31 13:29:42 +02:00
|
|
|
longDescription = ''
|
2014-03-15 15:22:32 +01: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 13:29:42 +02:00
|
|
|
|
|
|
|
Besides gpsd itself, the project provides auxiliary tools for
|
2014-03-15 15:22:32 +01:00
|
|
|
diagnostic monitoring and profiling of receivers and feeding
|
|
|
|
location-aware applications GPS/AIS logs for diagnostic purposes.
|
2009-05-31 13:29:42 +02:00
|
|
|
'';
|
2014-03-15 15:22:32 +01:00
|
|
|
homepage = http://catb.org/gpsd/;
|
2009-05-31 13:29:42 +02:00
|
|
|
license = "BSD-style";
|
2014-03-15 15:22:32 +01:00
|
|
|
platforms = platforms.linux;
|
2016-07-09 18:50:13 +02:00
|
|
|
maintainers = with maintainers; [ bjornfor rasendubi ];
|
2009-05-31 13:29:42 +02:00
|
|
|
};
|
|
|
|
}
|