gpsd: fix python dependencies

This fixes xgps and xgpsspeed executables.
This commit is contained in:
Alexey Shmalko 2016-07-09 19:50:13 +03:00 committed by Bjørn Forsman
parent 5a245c24b0
commit 34fab1a858

View File

@ -1,10 +1,10 @@
{ fetchurl, stdenv, scons, pythonFull, pkgconfig, dbus, dbus_glib { fetchurl, stdenv, scons, pkgconfig, dbus, dbus_glib
, ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper , ncurses, libX11, libXt, libXpm, libXaw, libXext
, libusb1, docbook_xml_dtd_412, docbook_xsl, bc , libusb1, docbook_xml_dtd_412, docbook_xsl, bc
, libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout" , libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
, pythonPackages
}: }:
# TODO: the 'xgps' program doesn't work: "ImportError: No module named gobject"
# TODO: put the X11 deps behind a guiSupport parameter for headless support # TODO: put the X11 deps behind a guiSupport parameter for headless support
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -16,15 +16,21 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ nativeBuildInputs = [
scons makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc scons pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
pythonFull pythonPackages.python
pythonPackages.wrapPython
]; ];
buildInputs = [ buildInputs = [
pythonFull dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext pythonPackages.python dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext
libxslt libusb1 libxslt libusb1
]; ];
pythonPath = [
pythonPackages.pygobject
pythonPackages.pygtk
];
patches = [ patches = [
./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch ./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch ./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
@ -37,14 +43,11 @@ stdenv.mkDerivation rec {
# we use $LD_LIBRARY_PATH instead. # we use $LD_LIBRARY_PATH instead.
buildPhase = '' buildPhase = ''
patchShebangs . patchShebangs .
mkdir -p "$out" sed -e "s|python_lib_dir = .*|python_lib_dir = \"$out/lib/${pythonPackages.python.libPrefix}/site-packages\"|" -i SConstruct
sed -e "s|python_lib_dir = .*|python_lib_dir = \"$out/lib/${pythonFull.libPrefix}/site-packages\"|" -i SConstruct
scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \ scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \
systemd=yes udevdir="$out/lib/udev" chrpath=no systemd=yes udevdir="$out/lib/udev" chrpath=no
''; '';
doCheck = false;
checkPhase = '' checkPhase = ''
export LD_LIBRARY_PATH="$PWD" export LD_LIBRARY_PATH="$PWD"
scons check scons check
@ -52,12 +55,13 @@ stdenv.mkDerivation rec {
# TODO: the udev rules file and the hotplug script need fixes to work on NixOS # TODO: the udev rules file and the hotplug script need fixes to work on NixOS
installPhase = '' installPhase = ''
scons install
mkdir -p "$out/lib/udev/rules.d" mkdir -p "$out/lib/udev/rules.d"
scons udev-install scons install udev-install
''; '';
postInstall = "wrapPythonPrograms"; postFixup = ''
wrapPythonProgramsIn $out/bin "$out $pythonPath"
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "GPS service daemon"; description = "GPS service daemon";
@ -82,6 +86,6 @@ stdenv.mkDerivation rec {
homepage = http://catb.org/gpsd/; homepage = http://catb.org/gpsd/;
license = "BSD-style"; license = "BSD-style";
platforms = platforms.linux; platforms = platforms.linux;
maintainers = [ maintainers.bjornfor ]; maintainers = with maintainers; [ bjornfor rasendubi ];
}; };
} }