2012-11-23 20:31:23 +00:00
|
|
|
{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null, gt68xxFirmware ? 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 {
|
2012-11-26 15:17:31 +00:00
|
|
|
name = "sane-backends-1.0.22.482-g071f226";
|
2012-11-23 20:31:23 +00:00
|
|
|
|
2012-11-26 15:17:31 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "http://git.debian.org/git/sane/sane-backends.git";
|
|
|
|
rev = "071f2269cd68d3411cbfa05a3d028b74496db970";
|
|
|
|
sha256 = "178xkv30m6irk4k0gqnfcl5kramm1qyj24dar8gp32428z1444xf";
|
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
|
|
|
|
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;
|
|
|
|
};
|
2011-12-05 17:32:45 +00:00
|
|
|
}
|