From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cssCE-0005KB-LU for guix-patches@gnu.org; Tue, 28 Mar 2017 10:34:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cssCA-00022H-L9 for guix-patches@gnu.org; Tue, 28 Mar 2017 10:34:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cssCA-000221-Ed for guix-patches@gnu.org; Tue, 28 Mar 2017 10:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cssCA-0008W2-5q for guix-patches@gnu.org; Tue, 28 Mar 2017 10:34:02 -0400 Subject: bug#26275: [PATCH] build: perl-build-system: Add `wrap' phase. Resent-Message-ID: Message-Id: MIME-Version: 1.0 From: Arun Isaac Date: Tue, 28 Mar 2017 20:03:13 +0530 In-reply-to: <20170327193850.12655-1-arunisaac@systemreboot.net> References: <20170327193850.12655-1-arunisaac@systemreboot.net> Content-Type: text/plain 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 > +(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. =