2014-03-24 22:21:21 +00:00
|
|
|
{stdenv, fetchurl, cups, zlib, libjpeg, libusb1, pythonPackages, saneBackends, dbus
|
|
|
|
, pkgconfig, polkit, qtSupport ? true, qt4, pythonDBus, pyqt4, net_snmp, automake
|
2010-06-18 09:16:17 +01:00
|
|
|
}:
|
|
|
|
|
2011-03-06 16:07:47 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-03-24 22:21:21 +00:00
|
|
|
name = "hplip-3.14.4";
|
2010-06-18 09:16:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2011-03-06 16:07:47 +00:00
|
|
|
url = "mirror://sourceforge/hplip/${name}.tar.gz";
|
2014-03-24 22:21:21 +00:00
|
|
|
sha256 = "1j8h44f8igl95wqypj4rk9awcw513hlps980jmcnkx60xghc4l6f";
|
2010-06-18 09:16:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#preBuild=''
|
|
|
|
# makeFlags="V=1 DISABLE_JBIG=1 CUPSFILTER=$out/lib/cups/filter CUPSPPD=$out/share/cups/model"
|
|
|
|
#'';
|
|
|
|
|
|
|
|
prePatch = ''
|
2010-09-21 02:24:00 +01:00
|
|
|
sed -i s,/etc/sane.d,$out/etc/sane.d/, Makefile.in
|
2013-02-05 18:58:31 +00:00
|
|
|
sed -i s,/etc/hp/,$out/etc/hp/, base/g.py
|
2014-03-24 22:21:21 +00:00
|
|
|
substituteInPlace Makefile.in \
|
|
|
|
--replace "/usr/include/libusb-1.0" "${libusb1}/include/libusb-1.0" \
|
|
|
|
--replace "/usr/lib/systemd/system" "$out/lib/systemd/system"
|
2010-06-18 09:16:17 +01:00
|
|
|
'';
|
|
|
|
|
2010-09-21 02:24:00 +01:00
|
|
|
# --disable-network-build Until we have snmp
|
|
|
|
|
2010-06-18 09:16:17 +01:00
|
|
|
preConfigure = ''
|
|
|
|
export configureFlags="$configureFlags
|
|
|
|
--with-cupsfilterdir=$out/lib/cups/filter
|
|
|
|
--with-cupsbackenddir=$out/lib/cups/backend
|
|
|
|
--with-icondir=$out/share/applications
|
|
|
|
--with-systraydir=$out/xdg/autostart
|
|
|
|
--with-mimedir=$out/etc/cups
|
2011-03-06 16:07:47 +00:00
|
|
|
--enable-policykit
|
2013-02-06 13:08:27 +00:00
|
|
|
"
|
2010-06-18 09:16:17 +01:00
|
|
|
|
|
|
|
export makeFlags="
|
|
|
|
halpredir=$out/share/hal/fdi/preprobe/10osvendor
|
|
|
|
hplip_statedir=$out/var
|
|
|
|
rulesdir=$out/etc/udev/rules.d
|
2011-03-06 16:07:47 +00:00
|
|
|
policykit_dir=$out/share/polkit-1/actions
|
|
|
|
policykit_dbus_etcdir=$out/etc/dbus-1/system.d
|
|
|
|
policykit_dbus_sharedir=$out/share/dbus-1/system-services
|
2010-06-18 09:16:17 +01:00
|
|
|
hplip_confdir=$out/etc/hp
|
|
|
|
";
|
|
|
|
'';
|
|
|
|
|
2013-02-05 18:58:31 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libjpeg
|
|
|
|
cups
|
2014-03-24 22:21:21 +00:00
|
|
|
libusb1
|
2013-02-05 18:58:31 +00:00
|
|
|
pythonPackages.python
|
|
|
|
pythonPackages.wrapPython
|
|
|
|
saneBackends
|
|
|
|
dbus
|
2013-02-06 13:08:27 +00:00
|
|
|
pkgconfig
|
|
|
|
net_snmp
|
|
|
|
] ++ stdenv.lib.optional qtSupport qt4;
|
2010-06-18 09:16:17 +01:00
|
|
|
|
2013-02-05 18:58:31 +00:00
|
|
|
pythonPath = with pythonPackages; [
|
|
|
|
pythonDBus
|
|
|
|
pygobject
|
2013-02-05 19:27:51 +00:00
|
|
|
recursivePthLoader
|
2013-02-07 23:27:07 +00:00
|
|
|
] ++ stdenv.lib.optional qtSupport pyqt4;
|
2013-02-05 18:58:31 +00:00
|
|
|
|
2010-09-21 02:24:00 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-06-18 09:16:17 +01:00
|
|
|
description = "Print, scan and fax HP drivers for Linux";
|
|
|
|
homepage = http://hplipopensource.com/;
|
2010-06-18 10:45:23 +01:00
|
|
|
license = "free"; # MIT/BSD/GPL
|
2010-09-21 02:24:00 +01:00
|
|
|
platforms = platforms.linux;
|
2010-06-18 09:16:17 +01:00
|
|
|
};
|
|
|
|
}
|