From 253d0485a9307c4e08afc058d7dafcd56025f9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 20 Apr 2021 00:26:01 +0200 Subject: [PATCH] java fixlet --- gnu/packages/java.scm | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 3c4013ab6f..b780f7a85f 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1749,6 +1749,9 @@ IcedTea build harness.") ((guix build ant-build-system) (guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references ((,icedtea-7 "jdk")) + ,@(substitute-keyword-arguments (package-arguments icedtea-7) ((#:modules modules) `((guix build utils) @@ -1792,10 +1795,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (define remove + (@ (srfi srfi-1) remove)) + (define (icedtea-or-openjdk? path) (or (string-contains path "openjdk") (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? (search-path-as-string->list (getenv "LIBRARY_PATH")))) @@ -1898,6 +1904,9 @@ new Date();")) #:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,icedtea-8 (,icedtea-8 "jdk")) + #:phases (modify-phases %standard-phases (add-after 'patch-source-shebangs 'fix-java-shebangs @@ -1936,18 +1945,20 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (define remove + (@ (srfi srfi-1) remove)) + (define (icedtea-or-openjdk? path) (or (string-contains path "openjdk") (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? (search-path-as-string->list (getenv "LIBRARY_PATH")))) (find-library (lambda (name) - (or (search-path - library-path - (string-append "lib" name ".so")) - (string-append "lib" name ".so"))))) + (search-path + library-path + (string-append "lib" name ".so"))))) (for-each (lambda (file) (catch 'decoding-error @@ -2090,7 +2101,9 @@ new Date();")) "--with-libjpeg=system" "--with-native-debug-symbols=zipped" (string-append "--prefix=" (assoc-ref outputs "out"))) - #t)))))) + #t)))) + ((#:disallowed-references _ '()) + `(,openjdk9 (,openjdk9 "jdk"))))) (native-inputs `(("openjdk9" ,openjdk9) ("openjdk9:jdk" ,openjdk9 "jdk") @@ -2120,6 +2133,9 @@ new Date();")) (arguments `(#:imported-modules ((guix build syscalls) ,@%gnu-build-system-modules) + + #:disallowed-references (,openjdk10 (,openjdk10 "jdk")) + #:tests? #f; requires jtreg ;; TODO package jtreg #:configure-flags @@ -2150,10 +2166,13 @@ new Date();")) (add-after 'unpack 'patch-jni-libs ;; Hardcode dynamically loaded libraries. (lambda _ - (use-modules (srfi srfi-1)) + (define remove + (@ (srfi srfi-1) remove)) + (define (icedtea-or-openjdk? path) (or (string-contains path "openjdk") (string-contains path "icedtea"))) + (let* ((library-path (remove icedtea-or-openjdk? (search-path-as-string->list (getenv "LIBRARY_PATH")))) -- 2.31.1