[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: gcj: Add $libdir to RUNPATH.
From: |
Ricardo Wurmus |
Subject: |
01/01: gnu: gcj: Add $libdir to RUNPATH. |
Date: |
Fri, 08 May 2015 11:14:42 +0000 |
rekado pushed a commit to branch master
in repository guix.
commit ad12c43e972482dc9d38c7214fee751bad290ea7
Author: Ricardo Wurmus <address@hidden>
Date: Fri May 8 12:36:58 2015 +0200
gnu: gcj: Add $libdir to RUNPATH.
* gnu/packages/gcc.scm (gcj)[arguments]: Add build phase to add library
output
directory to RUNPATH.
---
gnu/packages/gcc.scm | 76 +++++++++++++++++++++++++++----------------------
1 files changed, 42 insertions(+), 34 deletions(-)
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 4512e54..b652521 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -415,38 +415,47 @@ Go. It also includes runtime support libraries for these
languages.")
"--enable-languages=java"
,@(remove (cut string-match "--enable-languages.*" <>)
,flags))))
- ((#:phases phases)
- `(alist-cons-after
- 'install 'install-javac-and-javap-wrappers
- (lambda _
- (let* ((javac (assoc-ref %build-inputs "javac.in"))
- (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
- (gcj (assoc-ref %outputs "out"))
- (gcjbin (string-append gcj "/bin/"))
- (jvm (string-append gcj "/lib/jvm/"))
- (target (string-append jvm "/bin/javac")))
-
- (symlink (string-append gcjbin "jcf-dump")
- (string-append jvm "/bin/javap"))
-
- (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
-
- ;; Create javac wrapper from the template javac.in by
- ;; replacing the @VARIABLES@ with paths.
- (copy-file javac target)
- (patch-shebang target)
- (substitute* target
- (("@JAVA@")
- (string-append jvm "/bin/java"))
- (("@ECJ_JAR@")
- (string-append gcj "/share/java/ecj.jar"))
- (("@RT_JAR@")
- (string-append jvm "/jre/lib/rt.jar"))
- (("@TOOLS_JAR@")
- (string-append jvm "/lib/tools.jar")))
- (chmod target #o755)
- #t))
- (alist-cons-after
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after
+ 'unpack 'add-lib-output-to-rpath
+ (lambda _
+ (substitute* "libjava/Makefile.in"
+ (("libgcj_bc_dummy_LINK = .* -shared" line)
+ (string-append line " -Wl,-rpath=$(libdir)"))
+ (("libgcj(_bc)?_la_LDFLAGS =" ldflags _)
+ (string-append ldflags " -Wl,-rpath=$(libdir)")))))
+ (add-after
+ 'install 'install-javac-and-javap-wrappers
+ (lambda _
+ (let* ((javac (assoc-ref %build-inputs "javac.in"))
+ (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
+ (gcj (assoc-ref %outputs "out"))
+ (gcjbin (string-append gcj "/bin/"))
+ (jvm (string-append gcj "/lib/jvm/"))
+ (target (string-append jvm "/bin/javac")))
+
+ (symlink (string-append gcjbin "jcf-dump")
+ (string-append jvm "/bin/javap"))
+
+ (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
+
+ ;; Create javac wrapper from the template javac.in by
+ ;; replacing the @VARIABLES@ with paths.
+ (copy-file javac target)
+ (patch-shebang target)
+ (substitute* target
+ (("@JAVA@")
+ (string-append jvm "/bin/java"))
+ (("@ECJ_JAR@")
+ (string-append gcj "/share/java/ecj.jar"))
+ (("@RT_JAR@")
+ (string-append jvm "/jre/lib/rt.jar"))
+ (("@TOOLS_JAR@")
+ (string-append jvm "/lib/tools.jar")))
+ (chmod target #o755)
+ #t)))
+ (add-after
'install 'remove-broken-or-conflicting-files
(lambda _
(let ((out (assoc-ref %outputs "out")))
@@ -456,8 +465,7 @@ Go. It also includes runtime support libraries for these
languages.")
"libjawt.so")
(find-files (string-append out "/bin")
".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"))))
- #t)
- ,phases)))))))
+ #t))))))))
(define ecj-bootstrap-4.8
(origin