From: iyzsong@member.fsf.org (宋文武)
To: guix-devel@gnu.org
Subject: [PATCH] gnu: icedtea: Patch dynamically loaded libraries with absolute paths.
Date: Thu, 08 Sep 2016 23:34:22 +0800 [thread overview]
Message-ID: <87zini4d8h.fsf@member.fsf.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
I think this will fix the fontconfig issue (eg: #24327).
Not tested (build) any jdk version yet...
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-icedtea-Patch-dynamically-loaded-libraries-with-.patch --]
[-- Type: text/x-patch, Size: 2364 bytes --]
From 3dbe71f7cd7b99851bd616f1ab6e1269f1fc6e2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Thu, 8 Sep 2016 23:25:23 +0800
Subject: [PATCH] gnu: icedtea: Patch dynamically loaded libraries with
absolute paths.
* gnu/packages/java.scm (icedtea-6)[arguments]: Add 'patch-jni-libs' phase.
---
gnu/packages/java.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 7387235..932ecc5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -525,6 +525,32 @@ build process and its dependencies, whereas Make uses Makefile format.")
(("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
(("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
(("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
+ (add-after 'unpack 'patch-jni-libs
+ ;; Hardcode dynamically loaded libraries.
+ (lambda _
+ (let* ((library-path (search-path-as-string->list
+ (getenv "LIBRARY_PATH")))
+ (find-library (lambda (name)
+ (search-path
+ library-path
+ (string-append "lib" name ".so")))))
+ (for-each
+ (lambda (file)
+ (catch 'encoding-error
+ (lambda ()
+ (substitute* file
+ (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
+ _ name version)
+ (format #f "\"~a\"" (find-library name)))
+ (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
+ (format #f "\"~a\"" (find-library name)))))
+ (lambda _
+ ;; Those are safe to skip.
+ (format (current-error-port)
+ "warning: failed to substitute: ~a~%"
+ file))))
+ (find-files "openjdk.src/jdk/src/solaris/native" "\\.c|\\.h"))
+ #t)))
(add-before 'configure 'set-additional-paths
(lambda* (#:key inputs #:allow-other-keys)
(let* ((gcjdir (assoc-ref %build-inputs "gcj"))
--
2.8.4
next reply other threads:[~2016-09-08 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 15:34 宋文武 [this message]
2016-09-10 1:31 ` [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries 宋文武
2016-09-13 11:25 ` Ludovic Courtès
2016-09-14 9:05 ` 宋文武
2016-09-14 14:50 ` 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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zini4d8h.fsf@member.fsf.org \
--to=iyzsong@member.fsf.org \
--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 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).