Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> skribis: > Ludovic Courtès <l...@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.wur...@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’.