From f590891ac26c07fc1049dc84abbc33348860c016 Mon Sep 17 00:00:00 2001 From: Aristid Breitkreuz Date: Tue, 5 Feb 2013 19:58:31 +0100 Subject: [PATCH 1/4] hplip: start work on making python programs work --- pkgs/misc/drivers/hplip/default.nix | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 514655bd727..965efb9dc91 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -1,5 +1,5 @@ -{stdenv, fetchurl, cups, zlib, libjpeg, libusb, python, saneBackends, dbus -, pkgconfig, polkit, qtSupport ? true, qt4 +{stdenv, fetchurl, cups, zlib, libjpeg, libusb, pythonPackages, saneBackends, dbus +, pkgconfig, polkit, qtSupport ? true, qt4, pythonDBus, pyqt4 }: stdenv.mkDerivation rec { @@ -16,6 +16,7 @@ stdenv.mkDerivation rec { prePatch = '' sed -i s,/etc/sane.d,$out/etc/sane.d/, Makefile.in + sed -i s,/etc/hp/,$out/etc/hp/, base/g.py ''; # --disable-network-build Until we have snmp @@ -41,9 +42,28 @@ stdenv.mkDerivation rec { "; ''; - buildInputs = [libjpeg cups libusb python saneBackends dbus pkgconfig] ++ + postInstall = '' + wrapPythonPrograms + ''; + + buildInputs = [ + libjpeg + cups + libusb + pythonPackages.python + pythonPackages.wrapPython + pythonPackages.recursivePthLoader # does not seem to work? + saneBackends + dbus + pkgconfig] ++ stdenv.lib.optional qtSupport qt4; + pythonPath = with pythonPackages; [ + pythonDBus + pyqt4 + pygobject + ]; + meta = with stdenv.lib; { description = "Print, scan and fax HP drivers for Linux"; homepage = http://hplipopensource.com/; From b5e2a027c4ea346f7472a0ed47655a326575f2d4 Mon Sep 17 00:00:00 2001 From: Aristid Breitkreuz Date: Tue, 5 Feb 2013 20:27:51 +0100 Subject: [PATCH 2/4] hplip: now hp-setup actually shows a dialog --- pkgs/misc/drivers/hplip/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 965efb9dc91..e848c4df5b9 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -52,7 +52,6 @@ stdenv.mkDerivation rec { libusb pythonPackages.python pythonPackages.wrapPython - pythonPackages.recursivePthLoader # does not seem to work? saneBackends dbus pkgconfig] ++ @@ -62,6 +61,7 @@ stdenv.mkDerivation rec { pythonDBus pyqt4 pygobject + recursivePthLoader ]; meta = with stdenv.lib; { From b73dff89f78854ebbeb95abd5e27d752994bc204 Mon Sep 17 00:00:00 2001 From: Aristid Breitkreuz Date: Wed, 6 Feb 2013 14:08:27 +0100 Subject: [PATCH 3/4] enable networking support for hplip, net_snmp is available now --- pkgs/misc/drivers/hplip/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index e848c4df5b9..8abdb232905 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -1,5 +1,5 @@ {stdenv, fetchurl, cups, zlib, libjpeg, libusb, pythonPackages, saneBackends, dbus -, pkgconfig, polkit, qtSupport ? true, qt4, pythonDBus, pyqt4 +, pkgconfig, polkit, qtSupport ? true, qt4, pythonDBus, pyqt4, net_snmp }: stdenv.mkDerivation rec { @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { --with-systraydir=$out/xdg/autostart --with-mimedir=$out/etc/cups --enable-policykit - --disable-network-build" + " export makeFlags=" halpredir=$out/share/hal/fdi/preprobe/10osvendor @@ -54,8 +54,9 @@ stdenv.mkDerivation rec { pythonPackages.wrapPython saneBackends dbus - pkgconfig] ++ - stdenv.lib.optional qtSupport qt4; + pkgconfig + net_snmp + ] ++ stdenv.lib.optional qtSupport qt4; pythonPath = with pythonPackages; [ pythonDBus From b2afb45b8dd8093011c96d879ac878c00377d747 Mon Sep 17 00:00:00 2001 From: Aristid Breitkreuz Date: Fri, 8 Feb 2013 00:27:07 +0100 Subject: [PATCH 4/4] hplip: make pyqt4 dependency conditional on qtSupport --- pkgs/misc/drivers/hplip/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 8abdb232905..5b9ef87a129 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -60,10 +60,9 @@ stdenv.mkDerivation rec { pythonPath = with pythonPackages; [ pythonDBus - pyqt4 pygobject recursivePthLoader - ]; + ] ++ stdenv.lib.optional qtSupport pyqt4; meta = with stdenv.lib; { description = "Print, scan and fax HP drivers for Linux";