2013-11-09 13:35:35 +00:00
|
|
|
{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null
|
|
|
|
, gt68xxFirmware ? null, snapscanFirmware ? null
|
|
|
|
}:
|
2011-12-05 17:32:45 +00:00
|
|
|
let
|
2012-11-23 20:31:23 +00:00
|
|
|
firmware = gt68xxFirmware { inherit fetchurl; };
|
2011-12-05 17:32:45 +00:00
|
|
|
in
|
2012-11-23 20:31:23 +00:00
|
|
|
assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
|
2011-12-05 17:32:45 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-01-03 11:39:55 +00:00
|
|
|
name = "sane-backends-1.0.24.73-g6c4f6bc";
|
2012-11-23 20:31:23 +00:00
|
|
|
|
2012-11-26 15:17:31 +00:00
|
|
|
src = fetchgit {
|
2014-01-03 11:39:55 +00:00
|
|
|
url = "git://alioth.debian.org/git/sane/sane-backends.git";
|
|
|
|
rev = "6c4f6bc58615755dc734281703b594cea3ebf848";
|
|
|
|
sha256 = "0f7lbv1rnr53n4rpihcd8dkfm01xvwfnx9i1nqaadrzbpvgkjrfa";
|
2011-12-05 17:32:45 +00:00
|
|
|
};
|
2012-11-23 20:31:23 +00:00
|
|
|
|
2011-12-05 17:32:45 +00:00
|
|
|
udevSupport = hotplugSupport;
|
|
|
|
|
|
|
|
buildInputs = if libusb != null then [libusb] else [];
|
|
|
|
|
|
|
|
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 || \
|
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
2012-11-23 20:31:23 +00:00
|
|
|
if gt68xxFirmware != null then
|
2011-12-05 17:32:45 +00:00
|
|
|
"mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
|
|
|
|
" \${out}/share/sane/gt68xx/" + firmware.name
|
2013-08-25 20:19:21 +01:00
|
|
|
else if snapscanFirmware != null then
|
|
|
|
"mkdir -p \${out}/share/sane/snapscan ; ln -s " + snapscanFirmware +
|
|
|
|
" \${out}/share/sane/snapscan/your-firmwarefile.bin ;" +
|
|
|
|
"mkdir -p \${out}/etc/sane.d ; " +
|
|
|
|
"echo epson2 > \${out}/etc/sane.d/dll.conf"
|
2011-12-05 17:32:45 +00:00
|
|
|
else "";
|
2012-11-26 15:17:31 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.sane-project.org/";
|
|
|
|
description = "Scanner Access Now Easy";
|
2013-07-10 09:14:05 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2012-11-26 15:17:31 +00:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2011-12-05 17:32:45 +00:00
|
|
|
}
|