From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csaUn-0005T9-BU for guix-patches@gnu.org; Mon, 27 Mar 2017 15:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csaUk-0003bf-Q2 for guix-patches@gnu.org; Mon, 27 Mar 2017 15:40:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49563) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1csaUk-0003bb-MC for guix-patches@gnu.org; Mon, 27 Mar 2017 15:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1csaUk-00016Z-9q for guix-patches@gnu.org; Mon, 27 Mar 2017 15:40:02 -0400 Subject: bug#26275: [PATCH] build: perl-build-system: Add `wrap' phase. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@bnc3.mailjet.com>) id 1csaU0-0005RF-JJ for guix-patches@gnu.org; Mon, 27 Mar 2017 15:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@bnc3.mailjet.com>) id 1csaTy-0003T5-0C for guix-patches@gnu.org; Mon, 27 Mar 2017 15:39:16 -0400 Received: from o119.p8.mailjet.com ([87.253.233.119]:43311) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@bnc3.mailjet.com>) id 1csaTx-0003SW-Mu for guix-patches@gnu.org; Mon, 27 Mar 2017 15:39:13 -0400 Message-Id: <3389aacc.ADsAAG-tXNgAAAAAAAAAAAOtUOAAAAACwQwAAAAAAAW9WABY2Wpd@mailjet.com> From: Arun Isaac Date: Tue, 28 Mar 2017 01:08:50 +0530 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 26275@debbugs.gnu.org * 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-syste= m.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 @@ -68,6 +71,31 @@ (define-w/gnu-fallback* (install) (zero? (system* "./Build" "install"))) =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 `configure'= , ;; `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 (define* (perl-build #:key inputs (phases %standard-phases) --=20 2.11.0 =