2010-07-28 19:01:17 +01:00
|
|
|
{ stdenv, fetchurl, hotplugSupport ? false, libusb ? null
|
|
|
|
, gt68xxFirmware ? null }:
|
2010-10-14 12:54:19 +01:00
|
|
|
let
|
|
|
|
firmware = gt68xxFirmware {inherit fetchurl;};
|
|
|
|
in
|
2006-01-30 15:29:26 +00:00
|
|
|
assert hotplugSupport -> stdenv.system == "i686-linux";
|
2005-11-03 17:20:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2010-05-09 02:09:28 +01:00
|
|
|
name = "sane-backends-1.0.21";
|
2009-04-23 14:31:10 +01:00
|
|
|
|
2005-11-03 17:20:38 +00:00
|
|
|
src = fetchurl {
|
2010-05-09 02:09:28 +01:00
|
|
|
url = ftp://ftp.sane-project.org/pub/sane/sane-backends-1.0.21/sane-backends-1.0.21.tar.gz;
|
|
|
|
sha256 = "12wl4a86hxwlrx46lm5z6lw4id3j8wi82yv3khxcz5sqjai2ykp4";
|
2005-11-03 17:20:38 +00:00
|
|
|
};
|
2009-04-23 14:31:10 +01:00
|
|
|
|
2006-07-31 14:29:02 +01:00
|
|
|
udevSupport = hotplugSupport;
|
2007-08-08 21:33:36 +01:00
|
|
|
|
2009-04-23 14:31:10 +01:00
|
|
|
buildInputs = if libusb != null then [libusb] else [];
|
2007-08-08 21:33:36 +01:00
|
|
|
|
2009-04-23 14:31:10 +01:00
|
|
|
postInstall = ''
|
|
|
|
if test "$udevSupport" = "1"; then
|
|
|
|
ensureDir $out/etc/udev/rules.d/
|
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
|
|
|
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 "";
|
2005-11-03 17:20:38 +00:00
|
|
|
}
|