From 1be13f458ff3533baad8b5456b08fdc68a6b7713 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 5 Dec 2011 17:32:45 +0000 Subject: [PATCH] Apply mornfall's SANE patches Fix sane-backends to generate udev rules, add a snapshot of sane-backends's unstable repo, and add a SANE nixos module svn path=/nixpkgs/trunk/; revision=30764 --- pkgs/misc/sane-backends/default.nix | 3 ++- pkgs/misc/sane-backends/snapshot.nix | 33 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 pkgs/misc/sane-backends/snapshot.nix diff --git a/pkgs/misc/sane-backends/default.nix b/pkgs/misc/sane-backends/default.nix index 65e748b68fcf..e1bd1436101b 100644 --- a/pkgs/misc/sane-backends/default.nix +++ b/pkgs/misc/sane-backends/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, hotplugSupport ? false, libusb ? null +{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null , gt68xxFirmware ? null }: let firmware = gt68xxFirmware {inherit fetchurl;}; @@ -20,6 +20,7 @@ stdenv.mkDerivation { postInstall = '' if test "$udevSupport" = "1"; then ensureDir $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 ''; diff --git a/pkgs/misc/sane-backends/snapshot.nix b/pkgs/misc/sane-backends/snapshot.nix new file mode 100644 index 000000000000..8725206ddce3 --- /dev/null +++ b/pkgs/misc/sane-backends/snapshot.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null +, gt68xxFirmware ? null }: +let + firmware = gt68xxFirmware {inherit fetchurl;}; +in +assert hotplugSupport -> stdenv.system == "i686-linux"; + +stdenv.mkDerivation { + name = "sane-backends-1.0.22.git201111204"; + + src = fetchurl { + url = http://www.sane-project.org/snapshots/sane-backends-git20111204.tar.gz; + sha256 = "00b3fi8zjrq3in0wndz1xcz228mgfhwhh2knmyjsikr88hal0m47"; + }; + + udevSupport = hotplugSupport; + + buildInputs = if libusb != null then [libusb] else []; + + postInstall = '' + if test "$udevSupport" = "1"; then + ensureDir $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 ""; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b157deb4642e..fa3fdd7dd6dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8486,6 +8486,10 @@ let gt68xxFirmware = getConfig ["sane" "gt68xxFirmware"] null; }; + saneBackendsSnapshot = callPackage ../misc/sane-backends/snapshot.nix { + gt68xxFirmware = getConfig ["sane" "gt68xxFirmware"] null; + }; + saneFrontends = callPackage ../misc/sane-front { }; slock = callPackage ../misc/screensavers/slock { };