all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
To: guix-devel@gnu.org
Cc: Alex Sassmannshausen <alex@pompo.co>
Subject: [PATCH 2/3] build/perl-build-system: Add `wrap` phase.
Date: Wed, 16 Nov 2016 14:27:33 +0100	[thread overview]
Message-ID: <20161116132734.5943-3-alex@pompo.co> (raw)
In-Reply-To: <20161116132734.5943-1-alex@pompo.co>

* guix/build/perl-build-system.scm (wrap): New procedure.
  (%standard-phases): Add `wrap` phase.
---
 guix/build/perl-build-system.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/guix/build/perl-build-system.scm b/guix/build/perl-build-system.scm
index 8f480ea..861d75c 100644
--- a/guix/build/perl-build-system.scm
+++ b/guix/build/perl-build-system.scm
@@ -19,7 +19,7 @@
 (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 match)
+  #:use-module (srfi srfi-1)
   #:export (%standard-phases
             perl-build))
 
@@ -47,6 +47,15 @@
     (format #t "running `perl' with arguments ~s~%" args)
     (zero? (apply system* "perl" args))))
 
+;; Use `wrap-language-program' to return an executable wrapper for perl.
+(define wrap
+  (wrap-language-programs
+   (lambda (inputs outputs)
+     (string-append (assoc-ref outputs "out") "/lib/perl5/site_perl/"
+                    ;; As in python, assume version at end of `perl' string.
+                    (last (string-split (assoc-ref inputs "perl") #\-))))
+   "PERL5LIB"))
+
 (define-syntax-rule (define-w/gnu-fallback* (name args ...) body ...)
   (define* (name args ... #:rest rest)
     (if (access? "Build" X_OK)
@@ -70,9 +79,11 @@
 
 (define %standard-phases
   ;; Everything is as with the GNU Build System except for the `configure',
-  ;; `build', `check', and `install' phases.
+  ;; `build', `check', and `install' phases.  We also add a `wrap' phase to
+  ;; wrap perl binaries with a complete PERL5LIB path.
   (modify-phases gnu:%standard-phases
     (replace 'install install)
+    (add-after 'install 'wrap wrap)
     (replace 'check check)
     (replace 'build build)
     (replace 'configure configure)))
-- 
2.10.2

  parent reply	other threads:[~2016-11-16 13:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 13:27 [PATCH 0/3] Add a generalized `wrap-language-programs` Alex Sassmannshausen
2016-11-16 13:27 ` [PATCH 1/3] build/utils: Add `wrap-language-programs` Alex Sassmannshausen
2016-11-18 23:07   ` Ludovic Courtès
2016-11-16 13:27 ` Alex Sassmannshausen [this message]
2016-11-16 13:27 ` [PATCH 3/3] build/python-build-system: Refactor `wrap` Alex Sassmannshausen
     [not found] ` <582C6035.1070202@crazy-compilers.com>
2016-11-17 15:58   ` [PATCH 0/3] Add a generalized `wrap-language-programs` Alex Sassmannshausen
2016-11-17 17:09     ` Alex Sassmannshausen
2016-11-17 17:16       ` Hartmut Goebel
2016-11-17 21:15     ` Leo Famulari
2016-11-18  8:02       ` Alex Sassmannshausen
2016-11-18  8:34         ` Leo Famulari
2016-11-18  9:07           ` Alex Sassmannshausen
2016-11-18  8:41       ` Hartmut Goebel
2016-11-18  9:10     ` Ludovic Courtès
2016-11-18 15:16       ` Alex Sassmannshausen
2016-11-18 22:52 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161116132734.5943-3-alex@pompo.co \
    --to=alex.sassmannshausen@gmail.com \
    --cc=alex@pompo.co \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.