[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26275: [PATCH] build: perl-build-system: Add `wrap' phase.
From: |
Arun Isaac |
Subject: |
bug#26275: [PATCH] build: perl-build-system: Add `wrap' phase. |
Date: |
Tue, 28 Mar 2017 20:03:13 +0530 |
> +(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)))
I copied this wrap function from the python build system, and modified
it a little to suite perl. Is there any reason `list-of-files' and
`bindirs' are initialized using `define' rather than a `let' binding?
This is probably a very basic Guile question, but still...
Thanks,
Arun Isaac.