guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu: sane-backends: Support USB scanners.


From: Andy Wingo
Subject: [PATCH] gnu: sane-backends: Support USB scanners.
Date: Thu, 06 Aug 2015 12:28:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

>From eeff701d60de09445abbfca23602abed27e648b9 Mon Sep 17 00:00:00 2001
From: Andy Wingo <address@hidden>
Date: Thu, 6 Aug 2015 12:23:26 +0200
Subject: [PATCH 1/4] gnu: sane-backends: Support USB scanners.

* gnu/packages/scanner.scm (sane-backends): Build with libusb-compat as an
  input and install a udev rule to give users access to scanners.
---
 gnu/packages/scanner.scm | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/scanner.scm b/gnu/packages/scanner.scm
index 84d1dee..8bafed3 100644
--- a/gnu/packages/scanner.scm
+++ b/gnu/packages/scanner.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright 2014 John Darrington <address@hidden>
+;;; Copyright 2014, 2015 John Darrington <address@hidden>
+;;; Copyright 2015 Andy Wingo <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,8 @@
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages libusb)
   #:use-module ((guix licenses)
                 #:prefix licence:))
 
@@ -36,8 +39,24 @@
               (base32
                "0ba68m6bzni54axjk15i51rya7hfsdliwvqyan5msl7iaid0iir7"))))
     (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libusb-compat" ,libusb-compat)))
     (arguments
-      `(#:tests? #f)) 
+     `(#:tests?
+       #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after
+          'install 'udev-rules
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((out (assoc-ref outputs "out")))
+              (mkdir-p (string-append out "/lib/udev/rules.d"))
+              (copy-file "tools/udev/libsane.rules"
+                         (string-append out
+                                        "/lib/udev/rules.d/"
+                                        "60-libsane.rules"))))))))
     ;; It would seem that tests are not maintained - fails with
     ;; the following:
     ;;
@@ -55,4 +74,3 @@ proving access to any raster image scanner hardware (flatbed 
scanner,
 hand-held scanner, video- and still-cameras, frame-grabbers, etc.).  The
 package contains the library and drivers.")
     (license licence:gpl2+))) ; plus linking exception
-
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]