bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-17 Thread Ludovic Courtès
Hello!

Andy Patterson  skribis:

> Here's some patches implementing what you've suggested. I decided to use the
> full "sane-backends" for the other dependents, since I guessed that they need
> some backend support. If anyone knows that that's not required, it can be
> changed.

I think that’s fine.

Applied all 3 patches.  I also fixed a reproducibility issue due to
timestamps in a subsequent commit.

Thanks!

Ludo’.





bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-13 Thread Andy Patterson
Hi,

Here's some patches implementing what you've suggested. I decided to use the
full "sane-backends" for the other dependents, since I guessed that they need
some backend support. If anyone knows that that's not required, it can be
changed.

Thanks,

--
Andy






bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-12 Thread Ludovic Courtès
Andy Patterson  skribis:

> Hi, and sorry for the late reply.
>
> On Tue, 06 Dec 2016 10:10:57 +0100
> l...@gnu.org (Ludovic Courtès) wrote:
>
>> Andy Patterson  skribis:
>> 
>> > On Mon, 05 Dec 2016 21:48:36 +0100
>> > l...@gnu.org (Ludovic Courtès) wrote:
>> >  
>> >> > +(define-public sane-backends+hpaio
>> >> 
>> >> Could you add a comment and a synopsis explaining what’s this is?
>> >>   
>> >
>> > Sure, is the following patch ok?  
>> 
>> Yup!
>> 
>> >> > +  (package
>> >> > +(inherit sane-backends)
>> >> > +(name "sane-backends+hpaio")
>> >> > +(inputs
>> >> > + `(("hplip" ,(@ (gnu packages cups) hplip))
>> >> > +   ,@(package-inputs sane-backends)))
>> >> 
>> >> The closure size of this is 290 MiB whereas it’s 87 MiB for
>> >> ‘sane-backends’.  I suppose that’s the reason to keep’em 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.  
>> 
>> Oh right.
>> 
>> One last thing: should we renaming “sane-backends” to
>> “sane-backends-minimal”, and “sane-backends+hpaio” to “sane-backends”?
>
> The current "sane-backends" isn't really minimal, as it includes most
> backends. I'm not sure how it's applied elsewhere in Guix though, so
> I'll leave it up to you.

Right.  Well maybe while you’re at it you could make the new
‘sane-backend-minimal’ more minimal, it would make sense to me.

>> That way all scanners would work out of the box, at the expense of
>> extra disk usage, but that is roughly what patch 2/2 does anyway.
>
> One more patch is required in either case, as hplip would need to use
> sane-backends-minimal. Let me know if you'd like me to make this change.

Yes please!

Thank you!

Ludo’.





bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-12 Thread Andy Patterson
Hi, and sorry for the late reply.

On Tue, 06 Dec 2016 10:10:57 +0100
l...@gnu.org (Ludovic Courtès) wrote:

> Andy Patterson  skribis:
> 
> > On Mon, 05 Dec 2016 21:48:36 +0100
> > l...@gnu.org (Ludovic Courtès) wrote:
> >  
> >> > +(define-public sane-backends+hpaio
> >> 
> >> Could you add a comment and a synopsis explaining what’s this is?
> >>   
> >
> > Sure, is the following patch ok?  
> 
> Yup!
> 
> >> > +  (package
> >> > +(inherit sane-backends)
> >> > +(name "sane-backends+hpaio")
> >> > +(inputs
> >> > + `(("hplip" ,(@ (gnu packages cups) hplip))
> >> > +   ,@(package-inputs sane-backends)))
> >> 
> >> The closure size of this is 290 MiB whereas it’s 87 MiB for
> >> ‘sane-backends’.  I suppose that’s the reason to keep’em 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.  
> 
> Oh right.
> 
> One last thing: should we renaming “sane-backends” to
> “sane-backends-minimal”, and “sane-backends+hpaio” to “sane-backends”?

The current "sane-backends" isn't really minimal, as it includes most
backends. I'm not sure how it's applied elsewhere in Guix though, so
I'll leave it up to you.

> 
> That way all scanners would work out of the box, at the expense of
> extra disk usage, but that is roughly what patch 2/2 does anyway.

One more patch is required in either case, as hplip would need to use
sane-backends-minimal. Let me know if you'd like me to make this change.

--
Andy





bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-06 Thread Ludovic Courtès
Andy Patterson  skribis:

> On Mon, 05 Dec 2016 21:48:36 +0100
> l...@gnu.org (Ludovic Courtès) wrote:
>
>> > +(define-public sane-backends+hpaio  
>> 
>> Could you add a comment and a synopsis explaining what’s this is?
>> 
>
> Sure, is the following patch ok?

Yup!

>> > +  (package
>> > +(inherit sane-backends)
>> > +(name "sane-backends+hpaio")
>> > +(inputs
>> > + `(("hplip" ,(@ (gnu packages cups) hplip))
>> > +   ,@(package-inputs sane-backends)))  
>> 
>> The closure size of this is 290 MiB whereas it’s 87 MiB for
>> ‘sane-backends’.  I suppose that’s the reason to keep’em 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.

Oh right.

One last thing: should we renaming “sane-backends” to
“sane-backends-minimal”, and “sane-backends+hpaio” to “sane-backends”?

That way all scanners would work out of the box, at the expense of extra
disk usage, but that is roughly what patch 2/2 does anyway.

Thanks!

Ludo’.





bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-05 Thread Andy Patterson
On Mon, 05 Dec 2016 21:48:36 +0100
l...@gnu.org (Ludovic Courtès) wrote:

> > +(define-public sane-backends+hpaio  
> 
> Could you add a comment and a synopsis explaining what’s this is?
> 

Sure, is the following patch ok?

> > +  (package
> > +(inherit sane-backends)
> > +(name "sane-backends+hpaio")
> > +(inputs
> > + `(("hplip" ,(@ (gnu packages cups) hplip))
> > +   ,@(package-inputs sane-backends)))  
> 
> The closure size of this is 290 MiB whereas it’s 87 MiB for
> ‘sane-backends’.  I suppose that’s the reason to keep’em 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!
> 
> Ludo’.

Thanks for your review.

--
Andy

From 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 © 2014 John Darrington 
 ;;; Copyright © 2015 Andy Wingo 
+;;; Copyright © 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 (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
+
+;; 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 
support")))
-- 
2.10.2






bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-05 Thread Ludovic Courtès
Andy Patterson  skribis:

> * gnu/packages/scanner.scm (sane-backends+hpaio): New variable.

[...]

> +(define-public sane-backends+hpaio

Could you add a comment and a synopsis explaining what’s this is?

> +  (package
> +(inherit sane-backends)
> +(name "sane-backends+hpaio")
> +(inputs
> + `(("hplip" ,(@ (gnu packages cups) hplip))
> +   ,@(package-inputs sane-backends)))

The closure size of this is 290 MiB whereas it’s 87 MiB for
‘sane-backends’.  I suppose that’s the reason to keep’em separated?

Otherwise LGTM, thanks!

Ludo’.





bug#25101: [PATCH 1/2] gnu: Add hpaio-enabled sane-backends variant.

2016-12-03 Thread Andy Patterson
* gnu/packages/scanner.scm (sane-backends+hpaio): New variable.
---
 gnu/packages/scanner.scm | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/scanner.scm b/gnu/packages/scanner.scm
index 76817b3..f918291 100644
--- a/gnu/packages/scanner.scm
+++ b/gnu/packages/scanner.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 John Darrington 
 ;;; Copyright © 2015 Andy Wingo 
+;;; Copyright © 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,31 @@ 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
+
+(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
-- 
2.10.2