From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Patterson Subject: bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant. Date: Mon, 5 Dec 2016 17:38:27 -0500 Message-ID: <20161205173827.49a9001a@uwaterloo.ca> References: <20161203194113.6456663e@scratchpost.org> <20161204040037.21758-1-ajpatter@uwaterloo.ca> <20161204040037.21758-2-ajpatter@uwaterloo.ca> <871sxm14rf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE1ud-0003aH-7g for bug-guix@gnu.org; Mon, 05 Dec 2016 17:39:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE1uY-0006Ql-Li for bug-guix@gnu.org; Mon, 05 Dec 2016 17:39:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42034) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cE1uY-0006QE-IU for bug-guix@gnu.org; Mon, 05 Dec 2016 17:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cE1uY-0006sV-7W for bug-guix@gnu.org; Mon, 05 Dec 2016 17:39:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <871sxm14rf.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25101@debbugs.gnu.org On Mon, 05 Dec 2016 21:48:36 +0100 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > > +(define-public sane-backends+hpaio =20 >=20 > Could you add a comment and a synopsis explaining what=E2=80=99s this is? >=20 Sure, is the following patch ok? > > + (package > > + (inherit sane-backends) > > + (name "sane-backends+hpaio") > > + (inputs > > + `(("hplip" ,(@ (gnu packages cups) hplip)) > > + ,@(package-inputs sane-backends))) =20 >=20 > The closure size of this is 290 MiB whereas it=E2=80=99s 87 MiB for > =E2=80=98sane-backends=E2=80=99. I suppose that=E2=80=99s the reason to = keep=E2=80=99em separated? > Yeah, and there's also the fact that hplip depends on sane-backends. But this is the reason I didn't change sane-backends into a private variable, and then make this the new sane-backends. > Otherwise LGTM, thanks! >=20 > Ludo=E2=80=99. Thanks for your review. -- Andy =46rom 05474fbe68591b136c912db8aa1400b24800c541 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Sat, 3 Dec 2016 22:29:44 -0500 Subject: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant. * gnu/packages/scanner.scm (sane-backends+hpaio): New variable. --- gnu/packages/scanner.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/gnu/packages/scanner.scm b/gnu/packages/scanner.scm index 76817b3..f74c4e1 100644 --- a/gnu/packages/scanner.scm +++ b/gnu/packages/scanner.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2014 John Darrington ;;; Copyright =C2=A9 2015 Andy Wingo +;;; Copyright =C2=A9 2016 Andy Patterson ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,7 @@ (define-module (gnu packages scanner) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (gnu packages pkg-config) #:use-module (gnu packages libusb) @@ -73,3 +75,36 @@ proving access to any raster image scanner hardware (fla= tbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.). The package contains the library and drivers.") (license licence:gpl2+))) ; plus linking exception + +;; This variant links in the hpaio backend, provided by hplip, which adds +;; support for HP scanners whose backends are not maintained by +;; 'sane-backends' +(define-public sane-backends+hpaio + (package + (inherit sane-backends) + (name "sane-backends+hpaio") + (inputs + `(("hplip" ,(@ (gnu packages cups) hplip)) + ,@(package-inputs sane-backends))) + (arguments + (substitute-keyword-arguments (package-arguments sane-backends) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'add-backends + (lambda _ + (substitute* "backend/dll.conf.in" + (("hp5590" all) (format #f "~a~%~a" all "hpaio"))) + #t)) + (add-after 'install 'install-hpaio + (lambda* (#:key inputs outputs #:allow-other-keys) + (define hplip (string-append (assoc-ref inputs "hplip") + "/lib/sane")) + (define out (string-append (assoc-ref outputs "out") + "/lib/sane")) + (for-each + (lambda (file) + (symlink file (string-append out "/" (basename file)))) + (find-files hplip)) + #t)))))) + (synopsis + "Raster image scanner library and drivers, with full HP scanner suppo= rt"))) --=20 2.10.2