unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: hop: Fix RPATHs.
@ 2015-05-05 16:02 Eric Bavier
  2015-05-05 19:59 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Bavier @ 2015-05-05 16:02 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 85 bytes --]

This patch fixes the hop package in light of the new validate-runpath 
phase.

`~Eric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-hop-Fix-RPATHs.patch --]
[-- Type: text/x-diff; name=0001-gnu-hop-Fix-RPATHs.patch, Size: 4036 bytes --]

From 21fc758523acd674148a74afdda6ccb1aa588c77 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Tue, 5 May 2015 11:01:06 -0500
Subject: [PATCH] gnu: hop: Fix RPATHs.

* gnu/packages/scheme.scm (inputs): Move patchelf input to...
  (native-inputs): ...here.  New field.
  (arguments)[phases]: Use augment-rpath for patch-rpath phase.
---
 gnu/packages/scheme.scm |   48 +++++++++++++++++------------------------------
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 77d0d84..ae85979 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -238,7 +238,7 @@ Scheme and C programs and between Scheme and Java programs.")
              (patches (list (search-patch "hop-bigloo-4.0b.patch")))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (alist-replace
         'configure
         (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -249,41 +249,27 @@ Scheme and C programs and between Scheme and Java programs.")
         (alist-cons-after
          'strip 'patch-rpath
          (lambda* (#:key outputs #:allow-other-keys)
-           ;; Patch the RPATH of every installed library to point to $out/lib
-           ;; instead of $TMPDIR.  Note that "patchelf --set-rpath" produces
-           ;; invalid binaries when used before stripping.
-           (let ((out    (assoc-ref outputs "out"))
-                 (tmpdir (getcwd)))
-             (every (lambda (lib)
-                      (let* ((in    (open-pipe* OPEN_READ "patchelf"
-                                                "--print-rpath" lib))
-                             (rpath (read-line in)))
-                        (and (zero? (close-pipe in))
-                             (let ((rpath* (regexp-substitute/global
-                                            #f (regexp-quote tmpdir) rpath
-                                            'pre out 'post)))
-                               (or (equal? rpath rpath*)
-                                   (begin
-                                     (format #t "~a: changing RPATH from `~a' to `~a'~%"
-                                             lib rpath rpath*)
-                                     (zero?
-                                      (system* "patchelf" "--set-rpath"
-                                               rpath* lib))))))))
-                    (append (find-files (string-append out "/bin")
-                                        ".*")
-                            (find-files (string-append out "/lib")
-                                        "\\.so$")))))
+           ;; Add $out/lib to the RPATH of every installed library and
+           ;; executable.  Note that "patchelf --set-rpath" produces invalid
+           ;; binaries when used before stripping.
+           (let* ((out (assoc-ref outputs "out"))
+                  (lib (string-append out "/lib")))
+             (with-directory-excursion out
+               (every (cut augment-rpath <> lib)
+                      (append (find-files "bin" ".*")
+                              (find-files "lib" "\\.so$"))))))
          %standard-phases))
        #:tests? #f                                ; no test suite
        #:modules ((guix build gnu-build-system)
                   (guix build utils)
-                  (ice-9 popen)
-                  (ice-9 regex)
-                  (ice-9 rdelim)
-                  (srfi srfi-1))))
+                  (guix build rpath)
+                  (srfi srfi-26)
+                  (srfi srfi-1))
+       #:imported-modules (,@%gnu-build-system-modules
+                           (guix build rpath))))
+    (native-inputs `(("patchelf" ,patchelf)))
     (inputs `(("bigloo" ,bigloo)
-              ("which" ,which)
-              ("patchelf" ,patchelf)))
+              ("which" ,which)))
     (home-page "http://hop.inria.fr/")
     (synopsis "Multi-tier programming language for the Web 2.0")
     (description
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gnu: hop: Fix RPATHs.
  2015-05-05 16:02 [PATCH] gnu: hop: Fix RPATHs Eric Bavier
@ 2015-05-05 19:59 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-05-05 19:59 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <bavier@member.fsf.org> skribis:

> From 21fc758523acd674148a74afdda6ccb1aa588c77 Mon Sep 17 00:00:00 2001
> From: Eric Bavier <bavier@member.fsf.org>
> Date: Tue, 5 May 2015 11:01:06 -0500
> Subject: [PATCH] gnu: hop: Fix RPATHs.
>
> * gnu/packages/scheme.scm (inputs): Move patchelf input to...
>   (native-inputs): ...here.  New field.
>   (arguments)[phases]: Use augment-rpath for patch-rpath phase.

Great, please push.

Eventually we should try to avoid using PatchELF since it’s somewhat
broken (definitely broken on mips and arm) and hackish anyway.  I tried
getting ‘-copt -Wl,-rpath=foo’ passed to bigloo here, but somehow failed
to do that.

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-05 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 16:02 [PATCH] gnu: hop: Fix RPATHs Eric Bavier
2015-05-05 19:59 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).