emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26275: closed ([PATCH] build: perl-build-system: Add `wrap' phase.)


From: GNU bug Tracking System
Subject: bug#26275: closed ([PATCH] build: perl-build-system: Add `wrap' phase.)
Date: Mon, 16 Nov 2020 18:04:01 +0000

Your message dated Mon, 16 Nov 2020 19:03:25 +0100
with message-id <205927f7-8628-04b7-4f7a-6bfb3da273cc@web.de>
and subject line [PATCH] build: perl-build-system: Add `wrap' phase.
has caused the debbugs.gnu.org bug report #26275,
regarding [PATCH] build: perl-build-system: Add `wrap' phase.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
26275: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26275
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] build: perl-build-system: Add `wrap' phase. Date: Tue, 28 Mar 2017 01:08:50 +0530
* 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-system.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))
 
@@ -68,6 +71,31 @@
 (define-w/gnu-fallback* (install)
   (zero? (system* "./Build" "install")))
 
+(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)))
 
 (define* (perl-build #:key inputs (phases %standard-phases)
-- 
2.11.0




--- End Message ---
--- Begin Message --- Subject: [PATCH] build: perl-build-system: Add `wrap' phase. Date: Mon, 16 Nov 2020 19:03:25 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Icedove/78.4.3
Functionality was added in 0fb9a8df429a7b9f40610ff15baaff0d8e31e8cf by
Ricardo.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]