2013-11-24 00:02:03 +01:00
|
|
|
{ fetchurl, stdenv, scons, pythonFull, pkgconfig, dbus, dbus_glib
|
2011-06-07 23:51:13 +02:00
|
|
|
, ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper
|
|
|
|
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
|
2013-11-24 00:02:03 +01:00
|
|
|
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
|
|
|
|
}:
|
|
|
|
|
|
|
|
# TODO: the 'xgps' program doesn't work: "ImportError: No module named gobject"
|
|
|
|
# TODO: put the X11 deps behind a guiSupport parameter for headless support
|
2009-05-31 13:29:42 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-11-24 00:02:03 +01:00
|
|
|
name = "gpsd-3.10";
|
2009-05-31 13:29:42 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-11-24 00:02:03 +01:00
|
|
|
url = "http://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz";
|
|
|
|
sha256 = "0823hl5zgwnbgm0fq3i4z34lv76cpj0k6m0zjiygiyrxrz0w4vvh";
|
2009-05-31 13:29:42 +02:00
|
|
|
};
|
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
scons makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
|
|
|
|
pythonFull
|
|
|
|
];
|
2009-05-31 13:29:42 +02:00
|
|
|
|
2013-11-24 00:02:03 +01:00
|
|
|
buildInputs = [
|
|
|
|
pythonFull dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext
|
|
|
|
libxslt libusb1
|
|
|
|
];
|
2009-06-01 02:03:08 +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
|
|
|
|
];
|
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.
|
|
|
|
# - chrpath=no stops the build from using 'chrpath' (which we don't have).
|
|
|
|
# 'chrpath' is used to be able to run the tests from the source tree, but
|
|
|
|
# we use $LD_LIBRARY_PATH instead.
|
|
|
|
buildPhase = ''
|
2015-01-08 10:26:49 +01:00
|
|
|
patchShebangs .
|
2013-11-24 00:02:03 +01:00
|
|
|
mkdir -p "$out"
|
2014-10-12 14:59:31 +02:00
|
|
|
sed -e "s|python_lib_dir = .*|python_lib_dir = \"$out/lib/${pythonFull.libPrefix}/site-packages\"|" -i SConstruct
|
2013-11-24 00:02:03 +01:00
|
|
|
scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \
|
|
|
|
systemd=yes udevdir="$out/lib/udev" chrpath=no
|
|
|
|
'';
|
2009-05-31 13:29:42 +02:00
|
|
|
|
2014-03-31 11:23:44 +02:00
|
|
|
doCheck = false;
|
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 = ''
|
|
|
|
scons install
|
|
|
|
mkdir -p "$out/lib/udev/rules.d"
|
|
|
|
scons udev-install
|
|
|
|
'';
|
|
|
|
|
2011-03-28 19:19:27 +02:00
|
|
|
postInstall = "wrapPythonPrograms";
|
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;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2009-05-31 13:29:42 +02:00
|
|
|
};
|
|
|
|
}
|