From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csstn-0004d5-54 for guix-patches@gnu.org; Tue, 28 Mar 2017 11:19:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csstj-00042f-0N for guix-patches@gnu.org; Tue, 28 Mar 2017 11:19:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cssti-00042T-Hd for guix-patches@gnu.org; Tue, 28 Mar 2017 11:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cssti-0004m2-DE for guix-patches@gnu.org; Tue, 28 Mar 2017 11:19:02 -0400 Subject: bug#26275: [PATCH] build: perl-build-system: Add `wrap' phase. Resent-Message-ID: From: Marius Bakke In-Reply-To: <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@mailjet.com> References: <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@mailjet.com> Date: Tue, 28 Mar 2017 17:18:12 +0200 Message-ID: <87lgrptop7.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac , 26275@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello! I can't study the code right now, but at a glance it looks like this will also include native-inputs in PERL5LIB. Can you try to filter them out? Doing that will effectively also solve https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25235 . Patch welcome! :) Arun Isaac writes: > * guix/build/perl-build-system.scm (wrap): New procedure. > (%standard-phases): Add it. > --- > guix/build/perl-build-system.scm | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/guix/build/perl-build-system.scm b/guix/build/perl-build-sys= tem.scm > index 8f480eae1..32ef86b65 100644 > --- a/guix/build/perl-build-system.scm > +++ b/guix/build/perl-build-system.scm > @@ -19,7 +19,10 @@ > (define-module (guix build perl-build-system) > #:use-module ((guix build gnu-build-system) #:prefix gnu:) > #:use-module (guix build utils) > + #:use-module (ice-9 ftw) > #:use-module (ice-9 match) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-26) > #:export (%standard-phases > perl-build)) >=20=20 > @@ -68,6 +71,31 @@ > (define-w/gnu-fallback* (install) > (zero? (system* "./Build" "install"))) >=20=20 > +(define* (wrap #:key inputs outputs #:allow-other-keys) > + (define (list-of-files dir) > + (map (cut string-append dir "/" <>) > + (or (scandir dir (lambda (f) > + (let ((s (stat (string-append dir "/" f)))) > + (eq? 'regular (stat:type s))))) > + '()))) > + > + (define bindirs > + (append-map (match-lambda > + ((_ . dir) > + (list (string-append dir "/bin") > + (string-append dir "/sbin")))) > + outputs)) > + > + (let* ((out (assoc-ref outputs "out")) > + (var `("PERL5LIB" prefix > + ,(search-path-as-string->list > + (or (getenv "PERL5LIB") ""))))) > + (for-each (lambda (dir) > + (let ((files (list-of-files dir))) > + (for-each (cut wrap-program <> var) > + files))) > + bindirs))) > + > (define %standard-phases > ;; Everything is as with the GNU Build System except for the `configur= e', > ;; `build', `check', and `install' phases. > @@ -75,6 +103,7 @@ > (replace 'install install) > (replace 'check check) > (replace 'build build) > + (add-after 'install 'wrap wrap) > (replace 'configure configure))) >=20=20 > (define* (perl-build #:key inputs (phases %standard-phases) > --=20 > 2.11.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAljafrQACgkQoqBt8qM6 VPoaxwgAovh4FZ4VyPEGx+eV0vEC5IDSwUmGCdOZ5ditnNk94x238bueOpGMfHcm crtWL9SkFsHE/r9WO6bjyYqB+zkSLiBrRGG0e4hMJFCIgtpGG+iip91q2OjhapYj sQnsDUrENaVeIsOUKN36VB7aE7Zyq6YP5MYdnPdM/XKmA6/rJbNEHjh8x5p8aFwz 7/p3MnrWqfzubJcktJ5j/RpCqpiPNKKPJJuzge5+YmmA9MxEbTKUExtbMWofY7qs +T6a7KjfqfN6e+WOoFFxYZXM5/KEGH5ItLYIQLEby+rdUwzsc/9emYuJ/BbKQ1yk ibWh5VTuJD0wVEWRO5Gok0iXNIk0WQ== =TgsL -----END PGP SIGNATURE----- --=-=-=--