2013-11-09 17:35:35 +04:00
|
|
|
{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null
|
|
|
|
, pkgconfig ? null, gt68xxFirmware ? null, snapscanFirmware ? null
|
|
|
|
}:
|
2012-11-26 19:17:31 +04:00
|
|
|
|
2011-12-10 09:05:15 +04:00
|
|
|
assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
|
2005-11-03 20:20:38 +03:00
|
|
|
|
2012-11-26 19:17:31 +04:00
|
|
|
let
|
|
|
|
firmware = gt68xxFirmware { inherit fetchurl; };
|
|
|
|
in
|
2012-10-06 22:42:06 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2014-01-02 18:51:45 +04:00
|
|
|
version = "1.0.24";
|
2012-10-06 22:42:06 +04:00
|
|
|
name = "sane-backends-${version}";
|
2012-11-26 19:17:31 +04:00
|
|
|
|
2005-11-03 20:20:38 +03:00
|
|
|
src = fetchurl {
|
2014-01-30 15:26:11 +04:00
|
|
|
urls = [
|
|
|
|
"http://pkgs.fedoraproject.org/repo/pkgs/sane-backends/sane-backends-1.0.24.tar.gz/1ca68e536cd7c1852322822f5f6ac3a4/${name}.tar.gz"
|
|
|
|
"https://alioth.debian.org/frs/download.php/file/3958/${name}.tar.gz"
|
|
|
|
];
|
2014-01-02 18:51:45 +04:00
|
|
|
curlOpts = "--insecure";
|
|
|
|
sha256 = "0ba68m6bzni54axjk15i51rya7hfsdliwvqyan5msl7iaid0iir7";
|
2005-11-03 20:20:38 +03:00
|
|
|
};
|
2012-11-26 19:17:31 +04:00
|
|
|
|
2006-07-31 17:29:02 +04:00
|
|
|
udevSupport = hotplugSupport;
|
2007-08-09 00:33:36 +04:00
|
|
|
|
2013-09-25 22:15:27 +04:00
|
|
|
configureFlags = stdenv.lib.optional (libusb != null) "--enable-libusb_1_0";
|
|
|
|
|
2012-10-06 22:42:06 +04:00
|
|
|
buildInputs = []
|
|
|
|
++ stdenv.lib.optional (libusb != null) libusb
|
|
|
|
++ stdenv.lib.optional (libv4l != null) libv4l
|
|
|
|
++ stdenv.lib.optional (pkgconfig != null) pkgconfig
|
|
|
|
;
|
2007-08-09 00:33:36 +04:00
|
|
|
|
2009-04-23 17:31:10 +04:00
|
|
|
postInstall = ''
|
|
|
|
if test "$udevSupport" = "1"; then
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p $out/etc/udev/rules.d/
|
2011-12-05 21:32:45 +04:00
|
|
|
./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
|
2009-04-23 17:31:10 +04:00
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
2012-11-26 19:17:31 +04:00
|
|
|
if gt68xxFirmware != null then
|
2010-10-14 15:54:19 +04:00
|
|
|
"mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
|
|
|
|
" \${out}/share/sane/gt68xx/" + firmware.name
|
2013-08-25 23:19:21 +04:00
|
|
|
else if snapscanFirmware != null then
|
|
|
|
"mkdir -p \${out}/share/sane/snapscan ; ln -s " + snapscanFirmware +
|
|
|
|
" \${out}/share/sane/snapscan/your-firmwarefile.bin"
|
2009-04-23 17:31:10 +04:00
|
|
|
else "";
|
2012-11-26 19:17:31 +04: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 20:20:38 +03:00
|
|
|
}
|