13 , kppsSupport ? stdenv.isLinux, pps-tools
16 # optional deps for GUI packages
24 , gobject-introspection
30 , gpsdUser ? "gpsd", gpsdGroup ? "dialout"
33 stdenv.mkDerivation rec {
38 url = "mirror://savannah/${pname}/${pname}-${version}.tar.gz";
39 sha256 = "sha256-s2i2owXj96Y4LSOgy/wdeJIwYLa39Uz3mHpzx7Spr8I=";
42 # TODO: render & install HTML documentation using asciidoctor
45 python3Packages.wrapPython
47 ] ++ lib.optionals guiSupport [
56 python3Packages.python
57 ] ++ lib.optionals kppsSupport [
59 ] ++ lib.optionals guiSupport [
71 pythonPath = lib.optionals guiSupport [
72 python3Packages.pygobject3
73 python3Packages.pycairo
77 ./sconstruct-env-fixes.patch
82 sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConscript
84 substituteInPlace SConscript --replace "env['CCVERSION']" "env['CC']"
86 sconsFlags+=" udevdir=$out/lib/udev"
87 sconsFlags+=" python_libdir=$out/${python3Packages.python.sitePackages}"
90 # - leapfetch=no disables going online at build time to fetch leap-seconds
91 # info. See <gpsd-src>/build.txt for more info.
94 "gpsd_user=${gpsdUser}"
95 "gpsd_group=${gpsdGroup}"
97 "xgps=${if guiSupport then "True" else "False"}"
101 export LD_LIBRARY_PATH="$PWD"
104 # TODO: the udev rules file and the hotplug script need fixes to work on NixOS
106 mkdir -p "$out/lib/udev/rules.d"
109 installTargets = [ "install" "udev-install" ];
111 # remove binaries for x-less install because xgps sconsflag is partially broken
113 wrapPythonProgramsIn $out/bin "$out $pythonPath"
117 description = "GPS service daemon";
119 gpsd is a service daemon that monitors one or more GPSes or AIS
120 receivers attached to a host computer through serial or USB ports,
121 making all data on the location/course/velocity of the sensors
122 available to be queried on TCP port 2947 of the host computer. With
123 gpsd, multiple location-aware client applications (such as navigational
124 and wardriving software) can share access to receivers without
125 contention or loss of data. Also, gpsd responds to queries with a
126 format that is substantially easier to parse than the NMEA 0183 emitted
127 by most GPSes. The gpsd distribution includes a linkable C service
128 library, a C++ wrapper class, and a Python module that developers of
129 gpsd-aware applications can use to encapsulate all communication with
130 gpsd. Third-party client bindings for Java and Perl also exist.
132 Besides gpsd itself, the project provides auxiliary tools for
133 diagnostic monitoring and profiling of receivers and feeding
134 location-aware applications GPS/AIS logs for diagnostic purposes.
136 homepage = "https://gpsd.gitlab.io/gpsd/index.html";
137 changelog = "https://gitlab.com/gpsd/gpsd/-/blob/release-${version}/NEWS";
138 license = licenses.bsd2;
139 platforms = platforms.unix;
140 maintainers = with maintainers; [ bjornfor rasendubi ];