2013-11-09 13:35:35 +00:00
|
|
|
{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null
|
|
|
|
, pkgconfig ? null, gt68xxFirmware ? null, snapscanFirmware ? null
|
|
|
|
}:
|
2012-11-26 15:17:31 +00:00
|
|
|
|
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
|
|
|
|
2012-11-26 15:17:31 +00:00
|
|
|
let
|
|
|
|
firmware = gt68xxFirmware { inherit fetchurl; };
|
|
|
|
in
|
2012-10-06 18:42:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-12-05 16:49:58 +00:00
|
|
|
version = "1.0.25";
|
2012-10-06 18:42:06 +00:00
|
|
|
name = "sane-backends-${version}";
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2005-11-03 17:20:38 +00:00
|
|
|
src = fetchurl {
|
2014-01-30 11:26:11 +00:00
|
|
|
urls = [
|
2015-12-05 16:49:58 +00:00
|
|
|
"http://pkgs.fedoraproject.org/repo/pkgs/sane-backends/sane-backends-1.0.25.tar.gz/f9ed5405b3c12f07c6ca51ee60225fe7/${name}.tar.gz"
|
|
|
|
"https://alioth.debian.org/frs/download.php/file/4146/${name}.tar.gz"
|
2014-01-30 11:26:11 +00:00
|
|
|
];
|
2014-01-02 14:51:45 +00:00
|
|
|
curlOpts = "--insecure";
|
2015-12-05 16:49:58 +00:00
|
|
|
sha256 = "0b3fvhrxl4l82bf3v0j47ypjv6a0k5lqbgknrq1agpmjca6vmmx4";
|
2005-11-03 17:20:38 +00:00
|
|
|
};
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2015-08-27 15:24:42 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
|
|
|
|
2006-07-31 13:29:02 +00:00
|
|
|
udevSupport = hotplugSupport;
|
2007-08-08 20:33:36 +00:00
|
|
|
|
2013-09-25 18:15:27 +00:00
|
|
|
configureFlags = stdenv.lib.optional (libusb != null) "--enable-libusb_1_0";
|
|
|
|
|
2012-10-06 18:42:06 +00:00
|
|
|
buildInputs = []
|
|
|
|
++ stdenv.lib.optional (libusb != null) libusb
|
|
|
|
++ stdenv.lib.optional (libv4l != null) libv4l
|
|
|
|
++ stdenv.lib.optional (pkgconfig != null) pkgconfig
|
|
|
|
;
|
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/
|
2014-11-15 22:07:54 +00:00
|
|
|
./tools/sane-desc -m udev > $out/etc/udev/rules.d/49-libsane.rules || \
|
|
|
|
cp tools/udev/libsane.rules $out/etc/udev/rules.d/49-libsane.rules
|
2009-04-23 13:31:10 +00:00
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall =
|
2012-11-26 15:17:31 +00:00
|
|
|
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
|
2013-08-25 19:19:21 +00: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 13:31:10 +00:00
|
|
|
else "";
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2015-12-05 19:27:52 +00:00
|
|
|
meta = with stdenv.lib; {
|
2012-11-26 15:17:31 +00:00
|
|
|
homepage = "http://www.sane-project.org/";
|
2015-12-05 21:27:27 +00:00
|
|
|
description = "SANE (Scanner Access Now Easy) backends";
|
|
|
|
longDescription = ''
|
|
|
|
Collection of open-source SANE backends (device drivers).
|
|
|
|
SANE is a universal scanner interface providing standardized access to
|
|
|
|
any raster image scanner hardware: flatbed scanners, hand-held scanners,
|
|
|
|
video- and still-cameras, frame-grabbers, etc. For a list of supported
|
|
|
|
scanners, see http://www.sane-project.org/sane-backends.html.
|
|
|
|
'';
|
2015-12-05 19:27:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2012-11-26 15:17:31 +00:00
|
|
|
|
2015-12-05 19:27:52 +00:00
|
|
|
maintainers = with maintainers; [ nckx simons ];
|
|
|
|
platforms = platforms.linux;
|
2012-11-26 15:17:31 +00:00
|
|
|
};
|
2005-11-03 17:20:38 +00:00
|
|
|
}
|