From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries. Date: Sat, 10 Sep 2016 09:31:05 +0800 Message-ID: <871t0sy206.fsf@member.fsf.org> References: <87zini4d8h.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biX8M-0000le-Ka for guix-devel@gnu.org; Fri, 09 Sep 2016 21:31:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biX8J-0004aZ-Fz for guix-devel@gnu.org; Fri, 09 Sep 2016 21:31:06 -0400 Received: from smtp22.openmailbox.org ([62.4.1.56]:40889 helo=smtp7.openmailbox.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biX8J-0004aH-9g for guix-devel@gnu.org; Fri, 09 Sep 2016 21:31:03 -0400 In-Reply-To: <87zini4d8h.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Thu, 08 Sep 2016 23:34:22 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain The previous patch failed with icedtea-6, which has uncatched 'decoding-error' in addition to 'encoding-error'. And it seems that only icedtea-8 needs patch, since in icedtea-7 the USE_SYSTEM_GTK, USE_SYSTEM_FONTCONFIG, etc make it links with those libraries instead of dlopen them. So, now only patch icedtea-8: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-icedtea-8-Hardcode-dynamically-loaded-libraries.patch >From 1d0dce6f0c40fa35162ecb441b53b32f77dd5b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Thu, 8 Sep 2016 23:25:23 +0800 Subject: [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries. Fixes . * gnu/packages/java.scm (icedtea-8)[arguments]: Add 'patch-jni-libs' phase. --- gnu/packages/java.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 7387235..36c10d0 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -994,6 +994,33 @@ build process and its dependencies, whereas Make uses Makefile format.") (delete 'patch-paths) (delete 'set-additional-paths) (delete 'patch-patches) + (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))) ;; FIXME: This phase is needed but fails with this version of ;; IcedTea. (delete 'install-keystore) -- 2.8.4 --=-=-=--