2012-11-26 15:17:31 +00:00
|
|
|
{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null, pkgconfig ? null , gt68xxFirmware ? null }:
|
|
|
|
|
2011-12-10 05:05:15 +00:00
|
|
|
assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
|
2005-11-03 17:20:38 +00:00
|
|
|
|
2012-11-26 15:17:31 +00:00
|
|
|
let
|
|
|
|
firmware = gt68xxFirmware { inherit fetchurl; };
|
|
|
|
in
|
2012-10-06 19:42:06 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.0.23";
|
|
|
|
name = "sane-backends-${version}";
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2005-11-03 17:20:38 +00:00
|
|
|
src = fetchurl {
|
2012-10-06 19:42:06 +01:00
|
|
|
url = "https://launchpad.net/ubuntu/+archive/primary/+files/sane-backends_${version}.orig.tar.gz";
|
|
|
|
sha256 = "4d4f5b2881615af7fc0ed75fdde7dc623a749e80e40f3f792fe4010163cbb029";
|
2005-11-03 17:20:38 +00:00
|
|
|
};
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2006-07-31 14:29:02 +01:00
|
|
|
udevSupport = hotplugSupport;
|
2007-08-08 21:33:36 +01:00
|
|
|
|
2012-10-06 19:42:06 +01:00
|
|
|
buildInputs = []
|
|
|
|
++ stdenv.lib.optional (libusb != null) libusb
|
|
|
|
++ stdenv.lib.optional (libv4l != null) libv4l
|
|
|
|
++ stdenv.lib.optional (pkgconfig != null) pkgconfig
|
|
|
|
;
|
2007-08-08 21:33:36 +01:00
|
|
|
|
2009-04-23 14:31:10 +01:00
|
|
|
postInstall = ''
|
|
|
|
if test "$udevSupport" = "1"; then
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/etc/udev/rules.d/
|
2011-12-05 17:32:45 +00:00
|
|
|
./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
|
2009-04-23 14:31:10 +01:00
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
2012-11-26 15:17:31 +00:00
|
|
|
if gt68xxFirmware != null then
|
2010-10-14 12:54:19 +01:00
|
|
|
"mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
|
|
|
|
" \${out}/share/sane/gt68xx/" + firmware.name
|
2009-04-23 14:31:10 +01:00
|
|
|
else "";
|
2012-11-26 15:17:31 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.sane-project.org/";
|
|
|
|
description = "Scanner Access Now Easy";
|
|
|
|
license = "GPLv2+";
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2005-11-03 17:20:38 +00:00
|
|
|
}
|