gpsd: update 2.95 -> 3.10

Build system is changed, gpsd uses scons now.

The expressions needs some more work, TODO comments added. (xgps didn't
work before this change either.)

I added an option for the gpsd group, which is set to upstream default:
"dialout". Note that our default gpsd user is "gpsd", while upstream
uses "nobody" by default.

+97 -11
+25
pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
···
··· 1 + From d7e56abcae8bcb85dc935e94418a2f0e9956941b Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> 3 + Date: Mon, 17 Feb 2014 20:52:50 +0000 4 + Subject: [PATCH 1/2] Import LD_LIBRARY_PATH to allow running 'scons check' 5 + without 'chrpath' 6 + 7 + --- 8 + SConstruct | 1 + 9 + 1 file changed, 1 insertion(+) 10 + 11 + diff --git a/SConstruct b/SConstruct 12 + index 14e2f59..86b94bc 100644 13 + --- a/SConstruct 14 + +++ b/SConstruct 15 + @@ -215,6 +215,7 @@ import_env = ( 16 + 'PKG_CONFIG_LIBDIR', # Pass more environment variables to pkg-config (required for crossbuilds) 17 + 'STAGING_DIR', # Required by the OpenWRT and CeroWrt builds. 18 + 'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds. 19 + + 'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath' 20 + ) 21 + envs = {} 22 + for var in import_env: 23 + -- 24 + 1.9.0 25 +
+28
pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
···
··· 1 + From aed93b6ada5b9b76b85d11d9bad732ca005295af Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> 3 + Date: Sat, 15 Mar 2014 15:08:01 +0100 4 + Subject: [PATCH 2/2] Import XML_CATALOG_FILES to be able to validate the 5 + manual 6 + 7 + In nixos/nixpkgs, 'xmlto' depends on $XML_CATALOG_FILES to be able to 8 + validate XML documents. Because without it, it'll try to go online to 9 + download DTD's and builders don't have network access... 10 + --- 11 + SConstruct | 1 + 12 + 1 file changed, 1 insertion(+) 13 + 14 + diff --git a/SConstruct b/SConstruct 15 + index 86b94bc..a0b3d25 100644 16 + --- a/SConstruct 17 + +++ b/SConstruct 18 + @@ -216,6 +216,7 @@ import_env = ( 19 + 'STAGING_DIR', # Required by the OpenWRT and CeroWrt builds. 20 + 'STAGING_PREFIX', # Required by the OpenWRT and CeroWrt builds. 21 + 'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath' 22 + + 'XML_CATALOG_FILES', # Enables validating the manual with 'xmlto' using nix build system 23 + ) 24 + envs = {} 25 + for var in import_env: 26 + -- 27 + 1.9.0 28 +
+44 -11
pkgs/servers/gpsd/default.nix
··· 1 - { fetchurl, stdenv, pythonPackages, pkgconfig, dbus, dbus_glib 2 , ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper 3 , libusb1, docbook_xml_dtd_412, docbook_xsl, bc 4 - , libxslt, xmlto, gpsdUser ? "gpsd" }: 5 6 stdenv.mkDerivation rec { 7 - name = "gpsd-2.95"; 8 9 src = fetchurl { 10 - url = "http://download.berlios.de/gpsd/${name}.tar.gz"; 11 - sha256 = "1bjhyjg561kwp6zc2wg58njdvpnsj5yaa2slz8g3ga1176jl68w3"; 12 }; 13 14 - nativeBuildInputs = [ makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl 15 - xmlto bc pythonPackages.wrapPython ]; 16 17 - pythonPath = [ pythonPackages.curses ]; 18 19 - buildInputs = [ pythonPackages.python dbus dbus_glib ncurses libX11 libXt 20 - libXpm libXaw libXext libxslt libusb1 ]; 21 22 - configureFlags = "--enable-static --enable-dbus --enable-gpsd-user=${gpsdUser}"; 23 24 doCheck = true; 25 26 postInstall = "wrapPythonPrograms"; 27
··· 1 + { fetchurl, stdenv, scons, pythonFull, pkgconfig, dbus, dbus_glib 2 , ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper 3 , libusb1, docbook_xml_dtd_412, docbook_xsl, bc 4 + , libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout" 5 + }: 6 + 7 + # TODO: the 'xgps' program doesn't work: "ImportError: No module named gobject" 8 + # TODO: put the X11 deps behind a guiSupport parameter for headless support 9 10 stdenv.mkDerivation rec { 11 + name = "gpsd-3.10"; 12 13 src = fetchurl { 14 + url = "http://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz"; 15 + sha256 = "0823hl5zgwnbgm0fq3i4z34lv76cpj0k6m0zjiygiyrxrz0w4vvh"; 16 }; 17 18 + nativeBuildInputs = [ 19 + scons makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc 20 + pythonFull 21 + ]; 22 23 + buildInputs = [ 24 + pythonFull dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext 25 + libxslt libusb1 26 + ]; 27 28 + patches = [ 29 + ./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch 30 + ./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch 31 + ]; 32 33 + # - leapfetch=no disables going online at build time to fetch leap-seconds 34 + # info. See <gpsd-src>/build.txt for more info. 35 + # - chrpath=no stops the build from using 'chrpath' (which we don't have). 36 + # 'chrpath' is used to be able to run the tests from the source tree, but 37 + # we use $LD_LIBRARY_PATH instead. 38 + buildPhase = '' 39 + mkdir -p "$out" 40 + sed -e "s|python_lib_dir = .*|python_lib_dir = \"$out/lib/${pythonFull.python.libPrefix}/site-packages\"|" -i SConstruct 41 + scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \ 42 + systemd=yes udevdir="$out/lib/udev" chrpath=no 43 + ''; 44 45 doCheck = true; 46 + 47 + checkPhase = '' 48 + export LD_LIBRARY_PATH="$PWD" 49 + scons check 50 + ''; 51 + 52 + # TODO: the udev rules file and the hotplug script need fixes to work on NixOS 53 + installPhase = '' 54 + scons install 55 + mkdir -p "$out/lib/udev/rules.d" 56 + scons udev-install 57 + ''; 58 59 postInstall = "wrapPythonPrograms"; 60