[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add (minimal) BioPerl.
From: |
Ricardo Wurmus |
Subject: |
Re: [PATCH] Add (minimal) BioPerl. |
Date: |
Wed, 17 Jun 2015 15:24:46 +0200 |
Ludovic Courtès <address@hidden> 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?
>From a7f69eb16e91ca94e5894b234a98a7f14e78fd64 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
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