2020-12-03 22:10:40 +00:00
|
|
|
{ stdenv, lib ,fetchurl, scons, pkg-config, dbus, ncurses
|
2011-06-07 22:51:13 +01:00
|
|
|
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc
|
2020-12-03 22:10:40 +00:00
|
|
|
|
|
|
|
# optional deps for GUI packages
|
|
|
|
, guiSupport ? true
|
|
|
|
, dbus-glib ? null, libX11 ? null, libXt ? null, libXpm ? null, libXaw ? null, libXext ? null
|
|
|
|
, gobject-introspection ? null, pango ? null, gdk-pixbuf ? null, atk ? null, wrapGAppsHook ? null
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
|
2018-07-04 12:28:07 +01:00
|
|
|
, pps-tools
|
2020-12-03 22:10:40 +00:00
|
|
|
, python3Packages
|
2013-11-23 23:02:03 +00:00
|
|
|
}:
|
|
|
|
|
2009-05-31 12:29:42 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-12-03 22:10:40 +00:00
|
|
|
pname = "gpsd";
|
2021-02-25 19:16:42 +00:00
|
|
|
version = "3.22";
|
2009-05-31 12:29:42 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-25 19:16:42 +00:00
|
|
|
url = "mirror://savannah/${pname}/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "18rplv1cd76ndb2wc91jarjmfm2nk508pykv1hir79bqbwmdygvq";
|
2009-05-31 12:29:42 +01:00
|
|
|
};
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
nativeBuildInputs = [
|
2020-12-03 22:10:40 +00:00
|
|
|
scons pkg-config docbook_xml_dtd_412 docbook_xsl xmlto bc
|
|
|
|
python3Packages.python
|
|
|
|
python3Packages.wrapPython
|
|
|
|
]
|
|
|
|
++ lib.optionals guiSupport [ wrapGAppsHook gobject-introspection ];
|
2009-05-31 12:29:42 +01:00
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
buildInputs = [
|
2020-12-03 22:10:40 +00:00
|
|
|
python3Packages.python dbus ncurses
|
2018-07-04 12:28:07 +01:00
|
|
|
libxslt libusb1 pps-tools
|
2020-12-03 22:10:40 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals guiSupport [
|
|
|
|
dbus-glib libX11 libXt libXpm libXaw libXext
|
|
|
|
gobject-introspection pango gdk-pixbuf atk
|
2013-11-23 23:02:03 +00:00
|
|
|
];
|
2009-06-01 01:03:08 +01:00
|
|
|
|
2020-12-03 22:10:40 +00:00
|
|
|
pythonPath = lib.optionals guiSupport [
|
|
|
|
python3Packages.pygobject3
|
|
|
|
python3Packages.pycairo
|
2016-07-09 17:50:13 +01:00
|
|
|
];
|
|
|
|
|
2013-11-23 23:02:03 +00:00
|
|
|
patches = [
|
2020-12-03 22:10:40 +00:00
|
|
|
./sconstruct-env-fixes.patch
|
2013-11-23 23:02:03 +00:00
|
|
|
];
|
2011-06-07 22:51:13 +01:00
|
|
|
|
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 .
|
2021-02-25 19:16:42 +00:00
|
|
|
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConscript
|
|
|
|
export TAR=noop
|
2018-11-12 02:52:07 +00:00
|
|
|
|
|
|
|
sconsFlags+=" udevdir=$out/lib/udev"
|
2020-12-03 22:10:40 +00:00
|
|
|
sconsFlags+=" python_libdir=$out/lib/${python3Packages.python.libPrefix}/site-packages"
|
2013-11-23 23:02:03 +00:00
|
|
|
'';
|
2009-05-31 12:29:42 +01:00
|
|
|
|
2018-11-12 02:52:07 +00:00
|
|
|
sconsFlags = [
|
|
|
|
"leapfetch=no"
|
|
|
|
"gpsd_user=${gpsdUser}"
|
|
|
|
"gpsd_group=${gpsdGroup}"
|
|
|
|
"systemd=yes"
|
2020-12-03 22:10:40 +00:00
|
|
|
"xgps=${if guiSupport then "True" else "False"}"
|
2018-11-12 02:52:07 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
2020-12-03 22:10:40 +00:00
|
|
|
# remove binaries for x-less install because xgps sconsflag is partially broken
|
2016-07-09 17:50:13 +01:00
|
|
|
postFixup = ''
|
2020-12-03 22:10:40 +00:00
|
|
|
${if guiSupport then "" else "rm $out/bin/xgps*"}
|
2016-07-09 17:50:13 +01:00
|
|
|
wrapPythonProgramsIn $out/bin "$out $pythonPath"
|
|
|
|
'';
|
2009-06-01 01:03:08 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-03-15 14:22:32 +00:00
|
|
|
description = "GPS service daemon";
|
2009-05-31 12:29:42 +01: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 12:29:42 +01: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 12:29:42 +01:00
|
|
|
'';
|
2021-02-25 19:16:42 +00:00
|
|
|
homepage = "https://gpsd.gitlab.io/gpsd/index.html";
|
|
|
|
changelog = "https://gitlab.com/gpsd/gpsd/-/blob/release-${version}/NEWS";
|
2020-05-29 15:27:55 +01:00
|
|
|
license = licenses.bsd3;
|
2014-03-15 14:22:32 +00:00
|
|
|
platforms = platforms.linux;
|
2016-07-09 17:50:13 +01:00
|
|
|
maintainers = with maintainers; [ bjornfor rasendubi ];
|
2009-05-31 12:29:42 +01:00
|
|
|
};
|
|
|
|
}
|