unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add (minimal) BioPerl.
@ 2015-06-03 15:53 Ricardo Wurmus
  2015-06-03 16:00 ` Andreas Enge
  2015-06-06 17:48 ` Ludovic Courtès
  0 siblings, 2 replies; 13+ messages in thread
From: Ricardo Wurmus @ 2015-06-03 15:53 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-BioPerl.patch --]
[-- Type: text/x-patch, Size: 2394 bytes --]

From e8cffdb9e7a2447657b3f700b2f0beb00ad0f98e Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Wed, 3 Jun 2015 17:44:20 +0200
Subject: [PATCH] gnu: Add BioPerl.

* gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
---
 gnu/packages/bioinformatics.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index fd1c1dd..8d59768 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -225,6 +225,42 @@ pybedtools extends BEDTools by offering feature-level manipulations from with
 Python.")
     (license license:gpl2+)))
 
+(define-public bioperl-minimal
+  (package
+    (name "bioperl-minimal")
+    (version "1.6.924")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/C/CJ/CJFIELDS/BioPerl-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1l3npcvvvwjlhkna9dndpfv1hklhrgva013kw96m0n1wpd37ask1"))))
+    (build-system perl-build-system)
+    (inputs
+     `(("perl-module-build" ,perl-module-build)
+       ("perl-data-stag" ,perl-data-stag)
+       ("perl-libwww" ,perl-libwww)
+       ("perl-uri" ,perl-uri)))
+    (native-inputs
+     `(("perl-test-most" ,perl-test-most)))
+    (native-search-paths (list (search-path-specification
+                                (variable "PERL5LIB")
+                                (files '("lib/perl5/site_perl")))))
+    (home-page "http://search.cpan.org/dist/BioPerl")
+    (synopsis "Bioinformatics toolkit")
+    (description
+     "BioPerl is the product of a community effort to produce Perl code which
+is useful in biology.  Examples include Sequence objects, Alignment objects
+and database searching objects.  These objects not only do what they are
+advertised to do in the documentation, but they also interact - Alignment
+objects are made from the Sequence objects, Sequence objects have access to
+Annotation and SeqFeature objects and databases, Blast objects can be
+converted to Alignment objects, and so on.  This means that the objects
+provide a coordinated and extensible framework to do computational biology.")
+    (license (package-license perl))))
+
 (define-public python-biopython
   (package
     (name "python-biopython")
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-03 15:53 [PATCH] Add (minimal) BioPerl Ricardo Wurmus
@ 2015-06-03 16:00 ` Andreas Enge
  2015-06-04 16:19   ` Ludovic Courtès
  2015-06-06 17:48 ` Ludovic Courtès
  1 sibling, 1 reply; 13+ messages in thread
From: Andreas Enge @ 2015-06-03 16:00 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello,

On Wed, Jun 03, 2015 at 05:53:14PM +0200, Ricardo Wurmus wrote:
> +    (name "bioperl-minimal")

according to the naming standard, this should probably be called perl-bio,
in analogy with "libwww-perl becomes perl-libwww".

>      (name "python-biopython")

Actually, then this should be "python-bio".

What do you think?

Andreas

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-03 16:00 ` Andreas Enge
@ 2015-06-04 16:19   ` Ludovic Courtès
  2015-06-04 21:37     ` Pjotr Prins
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2015-06-04 16:19 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> skribis:

> On Wed, Jun 03, 2015 at 05:53:14PM +0200, Ricardo Wurmus wrote:
>> +    (name "bioperl-minimal")
>
> according to the naming standard, this should probably be called perl-bio,
> in analogy with "libwww-perl becomes perl-libwww".
>
>>      (name "python-biopython")
>
> Actually, then this should be "python-bio".
>
> What do you think?

I don’t know about the Perl one, but users will certainly expect the
package name to contain the string “biopython” since that’s what it’s
called.

I’m afraid this may be an exception to the 3rd paragraph of the “Python
Modules” section.  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-04 16:19   ` Ludovic Courtès
@ 2015-06-04 21:37     ` Pjotr Prins
  0 siblings, 0 replies; 13+ messages in thread
From: Pjotr Prins @ 2015-06-04 21:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

I would expect python-biopython - silly as it looks.

Pj.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-03 15:53 [PATCH] Add (minimal) BioPerl Ricardo Wurmus
  2015-06-03 16:00 ` Andreas Enge
@ 2015-06-06 17:48 ` Ludovic Courtès
  2015-06-06 17:52   ` Ricardo Wurmus
  1 sibling, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2015-06-06 17:48 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> From e8cffdb9e7a2447657b3f700b2f0beb00ad0f98e Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Wed, 3 Jun 2015 17:44:20 +0200
> Subject: [PATCH] gnu: Add BioPerl.
>
> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.

[...]

> +(define-public bioperl-minimal
> +  (package
> +    (name "bioperl-minimal")

So is it meant to be used as a Perl library, as a standalone executable,
or both?

If it can be used standalone, the current name is fine.  Otherwise,
perhaps “perl-bioperl-minimal”.  WDYT?

> +    (native-search-paths (list (search-path-specification
> +                                (variable "PERL5LIB")
> +                                (files '("lib/perl5/site_perl")))))

Why is it needed?  At first sight it looks wrong because PERL5LIB is
“owned” by Perl itself.

If there’s an executable that needs to find the libs listed in
‘propagated-inputs’, the best way would be to use ‘wrap-program’, I
think.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-06 17:48 ` Ludovic Courtès
@ 2015-06-06 17:52   ` Ricardo Wurmus
  2015-06-06 18:05     ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Wurmus @ 2015-06-06 17:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
>
>> From e8cffdb9e7a2447657b3f700b2f0beb00ad0f98e Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>> Date: Wed, 3 Jun 2015 17:44:20 +0200
>> Subject: [PATCH] gnu: Add BioPerl.
>>
>> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
>
> [...]
>
>> +(define-public bioperl-minimal
>> +  (package
>> +    (name "bioperl-minimal")
>
> So is it meant to be used as a Perl library, as a standalone executable,
> or both?

It's a library and a collection of perl executables using the library,
so I suppose "bioperl-minimal" would be appropriate?

>> +    (native-search-paths (list (search-path-specification
>> +                                (variable "PERL5LIB")
>> +                                (files '("lib/perl5/site_perl")))))
>
> Why is it needed?  At first sight it looks wrong because PERL5LIB is
> “owned” by Perl itself.
>
> If there’s an executable that needs to find the libs listed in
> ‘propagated-inputs’, the best way would be to use ‘wrap-program’, I
> think.

That's for the executables to find the library contained in this package
as well as the propagated Perl libraries.  There are *many* executables,
which made me shy away from wrapping each of them to be run with the
PERL5LIB variable set.

~~ Ricardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-06 17:52   ` Ricardo Wurmus
@ 2015-06-06 18:05     ` Ludovic Courtès
  2015-06-17 13:24       ` Ricardo Wurmus
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2015-06-06 18:05 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
>>
>>> From e8cffdb9e7a2447657b3f700b2f0beb00ad0f98e Mon Sep 17 00:00:00 2001
>>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>>> Date: Wed, 3 Jun 2015 17:44:20 +0200
>>> Subject: [PATCH] gnu: Add BioPerl.
>>>
>>> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
>>
>> [...]
>>
>>> +(define-public bioperl-minimal
>>> +  (package
>>> +    (name "bioperl-minimal")
>>
>> So is it meant to be used as a Perl library, as a standalone executable,
>> or both?
>
> It's a library and a collection of perl executables using the library,
> so I suppose "bioperl-minimal" would be appropriate?

Yeah that’s fine with me.

>>> +    (native-search-paths (list (search-path-specification
>>> +                                (variable "PERL5LIB")
>>> +                                (files '("lib/perl5/site_perl")))))
>>
>> Why is it needed?  At first sight it looks wrong because PERL5LIB is
>> “owned” by Perl itself.
>>
>> If there’s an executable that needs to find the libs listed in
>> ‘propagated-inputs’, the best way would be to use ‘wrap-program’, I
>> think.
>
> That's for the executables to find the library contained in this package
> as well as the propagated Perl libraries.  There are *many* executables,
> which made me shy away from wrapping each of them to be run with the
> PERL5LIB variable set.

There are two cases:

  1. When using BioPerl as a library, users will also have Perl
     installed, so ‘guix package’ will report the right value for
     PERL5LIB.  No problem here.

  2. When using just the executables, Perl might be missing from the
     profile.  ‘wrap-program’ looks best to me for that, even if there
     are many executables.

WDYT?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-06 18:05     ` Ludovic Courtès
@ 2015-06-17 13:24       ` Ricardo Wurmus
  2015-06-21 21:04         ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Ricardo Wurmus @ 2015-06-17 13:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

>>>> +    (native-search-paths (list (search-path-specification
>>>> +                                (variable "PERL5LIB")
>>>> +                                (files '("lib/perl5/site_perl")))))
>>>
>>> Why is it needed?  At first sight it looks wrong because PERL5LIB is
>>> “owned” by Perl itself.
>>>
>>> If there’s an executable that needs to find the libs listed in
>>> ‘propagated-inputs’, the best way would be to use ‘wrap-program’, I
>>> think.
>>
>> That's for the executables to find the library contained in this package
>> as well as the propagated Perl libraries.  There are *many* executables,
>> which made me shy away from wrapping each of them to be run with the
>> PERL5LIB variable set.
>
> There are two cases:
>
>   1. When using BioPerl as a library, users will also have Perl
>      installed, so ‘guix package’ will report the right value for
>      PERL5LIB.  No problem here.
>
>   2. When using just the executables, Perl might be missing from the
>      profile.  ‘wrap-program’ looks best to me for that, even if there
>      are many executables.

Agreed.  Attached is a patch with an additional build phase that wraps
all Perl scripts in $out/bin with the required PERL5LIB paths.

Note: I'm using (getenv PERL5LIB) here for convenience, but that
includes the native-input "perl-test-most" and the paths to its
dependencies.  I don't know how to do this nicely in any other way,
though, because I need not only the direct inputs to be in this list of
paths, but also their propagated inputs.

Is there a better way to make sure that all (direct and transient)
runtime dependencies can be found through the PERL5LIB variable?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-BioPerl.patch --]
[-- Type: text/x-patch, Size: 2976 bytes --]

From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Wed, 3 Jun 2015 17:44:20 +0200
Subject: [PATCH] gnu: Add BioPerl.

* gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
---
 gnu/packages/bioinformatics.scm | 50 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index fc03062..5ea0609 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -226,6 +226,56 @@ pybedtools extends BEDTools by offering feature-level manipulations from with
 Python.")
     (license license:gpl2+)))
 
+(define-public bioperl-minimal
+  (package
+    (name "bioperl-minimal")
+    (version "1.6.924")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/C/CJ/CJFIELDS/BioPerl-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1l3npcvvvwjlhkna9dndpfv1hklhrgva013kw96m0n1wpd37ask1"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after
+          'install 'wrap-programs
+          (lambda* (#:key outputs #:allow-other-keys)
+            ;; Make sure all executables in "bin" find the required Perl
+            ;; modules at runtime.
+            (let* ((out (assoc-ref outputs "out"))
+                   (bin (string-append out "/bin/"))
+                   (path (string-append out "/lib/perl5/site_perl:"
+                                        (getenv "PERL5LIB"))))
+              (for-each (lambda (file)
+                          (wrap-program file
+                            `("PERL5LIB" ":" prefix (,path))))
+                        (find-files bin "\\.pl$"))
+              #t))))))
+    (inputs
+     `(("perl-module-build" ,perl-module-build)
+       ("perl-data-stag" ,perl-data-stag)
+       ("perl-libwww" ,perl-libwww)
+       ("perl-uri" ,perl-uri)))
+    (native-inputs
+     `(("perl-test-most" ,perl-test-most)))
+    (home-page "http://search.cpan.org/dist/BioPerl")
+    (synopsis "Bioinformatics toolkit")
+    (description
+     "BioPerl is the product of a community effort to produce Perl code which
+is useful in biology.  Examples include Sequence objects, Alignment objects
+and database searching objects.  These objects not only do what they are
+advertised to do in the documentation, but they also interact - Alignment
+objects are made from the Sequence objects, Sequence objects have access to
+Annotation and SeqFeature objects and databases, Blast objects can be
+converted to Alignment objects, and so on.  This means that the objects
+provide a coordinated and extensible framework to do computational biology.")
+    (license (package-license perl))))
+
 (define-public python-biopython
   (package
     (name "python-biopython")
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-17 13:24       ` Ricardo Wurmus
@ 2015-06-21 21:04         ` Ludovic Courtès
  2015-07-21  8:41           ` Ricardo Wurmus
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2015-06-21 21:04 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:

[...]

>> There are two cases:
>>
>>   1. When using BioPerl as a library, users will also have Perl
>>      installed, so ‘guix package’ will report the right value for
>>      PERL5LIB.  No problem here.
>>
>>   2. When using just the executables, Perl might be missing from the
>>      profile.  ‘wrap-program’ looks best to me for that, even if there
>>      are many executables.
>
> Agreed.  Attached is a patch with an additional build phase that wraps
> all Perl scripts in $out/bin with the required PERL5LIB paths.
>
> Note: I'm using (getenv PERL5LIB) here for convenience, but that
> includes the native-input "perl-test-most" and the paths to its
> dependencies.  I don't know how to do this nicely in any other way,
> though, because I need not only the direct inputs to be in this list of
> paths, but also their propagated inputs.
>
> Is there a better way to make sure that all (direct and transient)
> runtime dependencies can be found through the PERL5LIB variable?

Good question.  The #:inputs parameter of build phases contains all the
inputs (native, normal, and propagated) when not cross-compiling, so
that doesn’t help.

Currently you would have to enumerate the subset of the inputs that you
want to use in ‘wrap-program’ as done in the ‘clusterssh’ recipe, for
instance.  That’s tedious but still preferable, esp. if that reduces the
size of the package’s closure.

> From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Wed, 3 Jun 2015 17:44:20 +0200
> Subject: [PATCH] gnu: Add BioPerl.
>
> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.

[...]

> +            ;; Make sure all executables in "bin" find the required Perl
> +            ;; modules at runtime.
> +            (let* ((out (assoc-ref outputs "out"))
> +                   (bin (string-append out "/bin/"))
> +                   (path (string-append out "/lib/perl5/site_perl:"
> +                                        (getenv "PERL5LIB"))))
> +              (for-each (lambda (file)
> +                          (wrap-program file
> +                            `("PERL5LIB" ":" prefix (,path))))
> +                        (find-files bin "\\.pl$"))

So either leave a “FIXME” saying that this is closing over a superset of
what’s actually needed at run time, or enumerate the inputs.

Otherwise LGTM.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-06-21 21:04         ` Ludovic Courtès
@ 2015-07-21  8:41           ` Ricardo Wurmus
  2015-07-21  9:24             ` Eric Bavier
  2015-08-24 13:03             ` Ricardo Wurmus
  0 siblings, 2 replies; 13+ messages in thread
From: Ricardo Wurmus @ 2015-07-21  8:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

>> Is there a better way to make sure that all (direct and transient)
>> runtime dependencies can be found through the PERL5LIB variable?
>
> Good question.  The #:inputs parameter of build phases contains all the
> inputs (native, normal, and propagated) when not cross-compiling, so
> that doesn’t help.
>
> Currently you would have to enumerate the subset of the inputs that you
> want to use in ‘wrap-program’ as done in the ‘clusterssh’ recipe, for
> instance.  That’s tedious but still preferable, esp. if that reduces the
> size of the package’s closure.
>
>> From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>> Date: Wed, 3 Jun 2015 17:44:20 +0200
>> Subject: [PATCH] gnu: Add BioPerl.
>>
>> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
>
> [...]
>
>> +            ;; Make sure all executables in "bin" find the required Perl
>> +            ;; modules at runtime.
>> +            (let* ((out (assoc-ref outputs "out"))
>> +                   (bin (string-append out "/bin/"))
>> +                   (path (string-append out "/lib/perl5/site_perl:"
>> +                                        (getenv "PERL5LIB"))))
>> +              (for-each (lambda (file)
>> +                          (wrap-program file
>> +                            `("PERL5LIB" ":" prefix (,path))))
>> +                        (find-files bin "\\.pl$"))
>
> So either leave a “FIXME” saying that this is closing over a superset of
> what’s actually needed at run time, or enumerate the inputs.
>
> Otherwise LGTM.

Attached is a new patch in which only the paths of the transitive target
inputs (+ the output perl site_perl directory) are wrapped around the
executables.  The resulting path is a lot shorter than the PERL5LIB path
at build time and judging from my quick tests the executables do not
complain about missing Perl modules.

WDYT?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-BioPerl.patch --]
[-- Type: text/x-patch, Size: 3980 bytes --]

From 7a772f530dba93cfd405e9800e0f043e747a15cc Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Wed, 3 Jun 2015 17:44:20 +0200
Subject: [PATCH] gnu: Add BioPerl.

* gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
---
 gnu/packages/bioinformatics.scm | 64 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 78cd3ce..ef5c8eb 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -52,7 +52,8 @@
   #:use-module (gnu packages vim)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
-  #:use-module (gnu packages zip))
+  #:use-module (gnu packages zip)
+  #:use-module (srfi srfi-1))
 
 (define-public bamtools
   (package
@@ -228,6 +229,67 @@ pybedtools extends BEDTools by offering feature-level manipulations from with
 Python.")
     (license license:gpl2+)))
 
+(define-public bioperl-minimal
+  (let* ((inputs `(("perl-module-build" ,perl-module-build)
+                   ("perl-data-stag" ,perl-data-stag)
+                   ("perl-libwww" ,perl-libwww)
+                   ("perl-uri" ,perl-uri)))
+         (transitive-inputs
+          (map (compose package-name cadr)
+               (delete-duplicates
+                (concatenate
+                 (map (compose package-transitive-target-inputs cadr) inputs))))))
+    (package
+      (name "bioperl-minimal")
+      (version "1.6.924")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (string-append "mirror://cpan/authors/id/C/CJ/CJFIELDS/BioPerl-"
+                             version ".tar.gz"))
+         (sha256
+          (base32
+           "1l3npcvvvwjlhkna9dndpfv1hklhrgva013kw96m0n1wpd37ask1"))))
+      (build-system perl-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after
+            'install 'wrap-programs
+            (lambda* (#:key outputs #:allow-other-keys)
+              ;; Make sure all executables in "bin" find the required Perl
+              ;; modules at runtime.  As the PERL5LIB variable contains also
+              ;; the paths of native inputs, we pick the transitive target
+              ;; inputs from %build-inputs.
+              (let* ((out  (assoc-ref outputs "out"))
+                     (bin  (string-append out "/bin/"))
+                     (path (string-join
+                            (cons (string-append out "/lib/perl5/site_perl")
+                                  (map (lambda (name)
+                                         (assoc-ref %build-inputs name))
+                                       ',transitive-inputs))
+                            ":")))
+                (for-each (lambda (file)
+                            (wrap-program file
+                              `("PERL5LIB" ":" prefix (,path))))
+                          (find-files bin "\\.pl$"))
+                #t))))))
+      (inputs inputs)
+      (native-inputs
+       `(("perl-test-most" ,perl-test-most)))
+      (home-page "http://search.cpan.org/dist/BioPerl")
+      (synopsis "Bioinformatics toolkit")
+      (description
+       "BioPerl is the product of a community effort to produce Perl code which
+is useful in biology.  Examples include Sequence objects, Alignment objects
+and database searching objects.  These objects not only do what they are
+advertised to do in the documentation, but they also interact - Alignment
+objects are made from the Sequence objects, Sequence objects have access to
+Annotation and SeqFeature objects and databases, Blast objects can be
+converted to Alignment objects, and so on.  This means that the objects
+provide a coordinated and extensible framework to do computational biology.")
+      (license (package-license perl)))))
+
 (define-public python-biopython
   (package
     (name "python-biopython")
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-07-21  8:41           ` Ricardo Wurmus
@ 2015-07-21  9:24             ` Eric Bavier
  2015-08-24 13:03             ` Ricardo Wurmus
  1 sibling, 0 replies; 13+ messages in thread
From: Eric Bavier @ 2015-07-21  9:24 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Tue, 21 Jul 2015 10:41:19 +0200
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:

> +(define-public bioperl-minimal
> +  (let* ((inputs `(("perl-module-build" ,perl-module-build)
> +                   ("perl-data-stag" ,perl-data-stag)
> +                   ("perl-libwww" ,perl-libwww)
> +                   ("perl-uri" ,perl-uri)))
> +         (transitive-inputs
> +          (map (compose package-name cadr)
> +               (delete-duplicates
> +                (concatenate
> +                 (map (compose package-transitive-target-inputs
> cadr) inputs))))))

I think what you're going for here is similar to the
package-propagated-input-refs procedure that was added to (gnu packages
version-control) recently.

A patch I sent to the list earlier would move that procedure to (guix
packages) so that it could be used elsewhere.  It seems to be something
that many other perl-using applications need (e.g. gnucash, clusterssh).

`~Eric

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-07-21  8:41           ` Ricardo Wurmus
  2015-07-21  9:24             ` Eric Bavier
@ 2015-08-24 13:03             ` Ricardo Wurmus
  2015-08-25 21:44               ` Ludovic Courtès
  1 sibling, 1 reply; 13+ messages in thread
From: Ricardo Wurmus @ 2015-08-24 13:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi,

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>>> Is there a better way to make sure that all (direct and transient)
>>> runtime dependencies can be found through the PERL5LIB variable?
>>
>> Good question.  The #:inputs parameter of build phases contains all the
>> inputs (native, normal, and propagated) when not cross-compiling, so
>> that doesn’t help.
>>
>> Currently you would have to enumerate the subset of the inputs that you
>> want to use in ‘wrap-program’ as done in the ‘clusterssh’ recipe, for
>> instance.  That’s tedious but still preferable, esp. if that reduces the
>> size of the package’s closure.
>>
>>> From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
>>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>>> Date: Wed, 3 Jun 2015 17:44:20 +0200
>>> Subject: [PATCH] gnu: Add BioPerl.
>>>
>>> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
>>
>> [...]
>>
>>> +            ;; Make sure all executables in "bin" find the required Perl
>>> +            ;; modules at runtime.
>>> +            (let* ((out (assoc-ref outputs "out"))
>>> +                   (bin (string-append out "/bin/"))
>>> +                   (path (string-append out "/lib/perl5/site_perl:"
>>> +                                        (getenv "PERL5LIB"))))
>>> +              (for-each (lambda (file)
>>> +                          (wrap-program file
>>> +                            `("PERL5LIB" ":" prefix (,path))))
>>> +                        (find-files bin "\\.pl$"))
>>
>> So either leave a “FIXME” saying that this is closing over a superset of
>> what’s actually needed at run time, or enumerate the inputs.
>>
>> Otherwise LGTM.
>
> Attached is a new patch in which only the paths of the transitive target
> inputs (+ the output perl site_perl directory) are wrapped around the
> executables.  The resulting path is a lot shorter than the PERL5LIB path
> at build time and judging from my quick tests the executables do not
> complain about missing Perl modules.
>
> WDYT?

I think that this patch is better than the previous versions in which
all programmes were wrapped in whatever “PERL5LIB” contained at
build-time.  If there are no objections, I’ll push the last commit to
add ‘bioperl-minimal’.

~~ Ricardo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Add (minimal) BioPerl.
  2015-08-24 13:03             ` Ricardo Wurmus
@ 2015-08-25 21:44               ` Ludovic Courtès
  0 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2015-08-25 21:44 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> Hi,
>
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>>> Is there a better way to make sure that all (direct and transient)
>>>> runtime dependencies can be found through the PERL5LIB variable?
>>>
>>> Good question.  The #:inputs parameter of build phases contains all the
>>> inputs (native, normal, and propagated) when not cross-compiling, so
>>> that doesn’t help.
>>>
>>> Currently you would have to enumerate the subset of the inputs that you
>>> want to use in ‘wrap-program’ as done in the ‘clusterssh’ recipe, for
>>> instance.  That’s tedious but still preferable, esp. if that reduces the
>>> size of the package’s closure.
>>>
>>>> From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
>>>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>>>> Date: Wed, 3 Jun 2015 17:44:20 +0200
>>>> Subject: [PATCH] gnu: Add BioPerl.
>>>>
>>>> * gnu/packages/bioinformatics.scm (bioperl-minimal): New variable.
>>>
>>> [...]
>>>
>>>> +            ;; Make sure all executables in "bin" find the required Perl
>>>> +            ;; modules at runtime.
>>>> +            (let* ((out (assoc-ref outputs "out"))
>>>> +                   (bin (string-append out "/bin/"))
>>>> +                   (path (string-append out "/lib/perl5/site_perl:"
>>>> +                                        (getenv "PERL5LIB"))))
>>>> +              (for-each (lambda (file)
>>>> +                          (wrap-program file
>>>> +                            `("PERL5LIB" ":" prefix (,path))))
>>>> +                        (find-files bin "\\.pl$"))
>>>
>>> So either leave a “FIXME” saying that this is closing over a superset of
>>> what’s actually needed at run time, or enumerate the inputs.
>>>
>>> Otherwise LGTM.
>>
>> Attached is a new patch in which only the paths of the transitive target
>> inputs (+ the output perl site_perl directory) are wrapped around the
>> executables.  The resulting path is a lot shorter than the PERL5LIB path
>> at build time and judging from my quick tests the executables do not
>> complain about missing Perl modules.
>>
>> WDYT?
>
> I think that this patch is better than the previous versions in which
> all programmes were wrapped in whatever “PERL5LIB” contained at
> build-time.  If there are no objections, I’ll push the last commit to
> add ‘bioperl-minimal’.

Sure, please go ahead.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-08-25 21:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-03 15:53 [PATCH] Add (minimal) BioPerl Ricardo Wurmus
2015-06-03 16:00 ` Andreas Enge
2015-06-04 16:19   ` Ludovic Courtès
2015-06-04 21:37     ` Pjotr Prins
2015-06-06 17:48 ` Ludovic Courtès
2015-06-06 17:52   ` Ricardo Wurmus
2015-06-06 18:05     ` Ludovic Courtès
2015-06-17 13:24       ` Ricardo Wurmus
2015-06-21 21:04         ` Ludovic Courtès
2015-07-21  8:41           ` Ricardo Wurmus
2015-07-21  9:24             ` Eric Bavier
2015-08-24 13:03             ` Ricardo Wurmus
2015-08-25 21:44               ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).