about summary refs log tree commit diff
path: root/pkgs/servers/gpsd/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/gpsd/default.nix')
-rw-r--r--pkgs/servers/gpsd/default.nix26
1 files changed, 22 insertions, 4 deletions
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 523a126e9398..067e7c4446b2 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -1,5 +1,6 @@
 { fetchurl, stdenv, python, pkgconfig, dbus, dbus_glib
-, ncurses, libXt, libXpm, libxslt, xmlto, gpsdUser ? "gpsd" }:
+, ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper
+, libxslt, xmlto, gpsdUser ? "gpsd" }:
 
 stdenv.mkDerivation rec {
   name = "gpsd-2.39";
@@ -10,14 +11,31 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    python pkgconfig dbus dbus_glib ncurses libXt libXpm
-    libxslt xmlto
+    python pkgconfig dbus dbus_glib ncurses
+    libX11 libXt libXpm libXaw libXext
+    makeWrapper libxslt xmlto
   ];
 
-  configureFlags = "--enable-dbus --enable-gpsd-user=${gpsdUser}";
+  configureFlags = "--enable-dbus --enable-gpsd-user=${gpsdUser} "
+
+    # Make sure `xgpsspeed' has libXt and libX11 in its RPATH.
+    + "LDFLAGS=-Wl,--rpath=${libXt}/lib:${libX11}/lib";
 
   doCheck = true;
 
+  postInstall = ''
+    for prog in "$out/bin"/*
+    do
+      if grep -q python "$prog"
+      then
+          echo "patching \`$prog'..."
+          wrapProgram "$prog"                                                   \
+            --prefix PATH ":" "${python}/bin"                                   \
+            --prefix PYTHONPATH ":" "$out/lib/${python.libPrefix}/site-packages"
+      fi
+    done
+  '';
+
   meta = {
     description = "`gpsd', a GPS service daemon";