ea21636320
For some reason, SANE suddenly stopped recognizing my scanner recently: | $ scanimage -L | | No scanners were identified. If you were expecting something different, | check that the scanner is plugged in, turned on and detected by the | sane-find-scanner tool (if appropriate). Please read the documentation | which came with this software (README, FAQ, manpages). I was able to remedy this issue by building SANE with the latest version of the backends package from Git, by adding the following override to ~/.nixpkgs/config.nix: | { | packageOverrides = pkgs: | { | saneBackends = pkgs.saneBackendsGit; | }; | }
43 lines
1.3 KiB
Nix
43 lines
1.3 KiB
Nix
{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null, gt68xxFirmware ? null }:
|
|
let
|
|
firmware = gt68xxFirmware { inherit fetchurl; };
|
|
in
|
|
assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
|
|
|
|
stdenv.mkDerivation {
|
|
name = "sane-backends-1.0.23.296-gf139120";
|
|
|
|
src = fetchgit {
|
|
url = "http://git.debian.org/git/sane/sane-backends.git";
|
|
rev = "f139120c72db6de98be95b52c206c2a4d8071e92";
|
|
sha256 = "1b2fv19c8ijh9l0jjilli3j70n17wvcgpqq1nxmiby3ai6nrzk8d";
|
|
};
|
|
|
|
udevSupport = hotplugSupport;
|
|
|
|
buildInputs = if libusb != null then [libusb] else [];
|
|
|
|
postInstall = ''
|
|
if test "$udevSupport" = "1"; then
|
|
mkdir -p $out/etc/udev/rules.d/
|
|
./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 =
|
|
if gt68xxFirmware != null then
|
|
"mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
|
|
" \${out}/share/sane/gt68xx/" + firmware.name
|
|
else "";
|
|
|
|
meta = {
|
|
homepage = "http://www.sane-project.org/";
|
|
description = "Scanner Access Now Easy";
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
|
platforms = stdenv.lib.platforms.linux;
|
|
};
|
|
}
|