2011-12-05 17:32:45 +00:00
|
|
|
{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null
|
2010-07-28 18:01:17 +00:00
|
|
|
, gt68xxFirmware ? null }:
|
2010-10-14 11:54:19 +00:00
|
|
|
let
|
|
|
|
firmware = gt68xxFirmware {inherit fetchurl;};
|
|
|
|
in
|
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
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2012-04-16 15:14:19 +00:00
|
|
|
name = "sane-backends-1.0.22";
|
2009-04-23 13:31:10 +00:00
|
|
|
|
2005-11-03 17:20:38 +00:00
|
|
|
src = fetchurl {
|
2012-04-16 15:14:19 +00:00
|
|
|
url = http://alioth.debian.org/frs/download.php/3503/sane-backends-1.0.22.tar.gz;
|
|
|
|
sha256 = "0m0cz4ljw9asqvpryl6gx1ndwf7ll2qinlvql9whnzs901la314z";
|
2005-11-03 17:20:38 +00:00
|
|
|
};
|
2009-04-23 13:31:10 +00:00
|
|
|
|
2006-07-31 13:29:02 +00:00
|
|
|
udevSupport = hotplugSupport;
|
2007-08-08 20:33:36 +00:00
|
|
|
|
2009-04-23 13:31:10 +00:00
|
|
|
buildInputs = if libusb != null then [libusb] else [];
|
2007-08-08 20:33:36 +00:00
|
|
|
|
2009-04-23 13:31:10 +00: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 13:31:10 +00:00
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
|
|
|
if gt68xxFirmware != null then
|
2010-10-14 11:54:19 +00:00
|
|
|
"mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
|
|
|
|
" \${out}/share/sane/gt68xx/" + firmware.name
|
2009-04-23 13:31:10 +00:00
|
|
|
else "";
|
2005-11-03 17:20:38 +00:00
|
|
|
}
|