gnu: openjdk: Clean up runtime dependencies between Java versions.

* gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11): Do not consider
icedtea/openjdk input paths when rewriting JNI libraries.

Signed-off-by: Andreas Enge <andreas@enge.fr>
This commit is contained in:
Carlo Zancanaro 2021-04-17 16:33:06 +10:00 committed by Andreas Enge
parent 381915bfb2
commit 97a43db8b4
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -2,7 +2,7 @@
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org> ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
;;; Copyright © 2017, 2019 Carlo Zancanaro <carlo@zancanaro.id.au> ;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro <carlo@zancanaro.id.au>
;;; Copyright © 2017-2020 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2017-2020 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com> ;;; Copyright © 2016, 2017, 2018 Alex Vong <alexvong1995@gmail.com>
@ -1792,8 +1792,13 @@ (define-public icedtea-8
(add-after 'unpack 'patch-jni-libs (add-after 'unpack 'patch-jni-libs
;; Hardcode dynamically loaded libraries. ;; Hardcode dynamically loaded libraries.
(lambda _ (lambda _
(let* ((library-path (search-path-as-string->list (use-modules (srfi srfi-1))
(getenv "LIBRARY_PATH"))) (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) (find-library (lambda (name)
(search-path (search-path
library-path library-path
@ -1931,12 +1936,18 @@ (define-public openjdk9
(add-after 'unpack 'patch-jni-libs (add-after 'unpack 'patch-jni-libs
;; Hardcode dynamically loaded libraries. ;; Hardcode dynamically loaded libraries.
(lambda _ (lambda _
(let* ((library-path (search-path-as-string->list (use-modules (srfi srfi-1))
(getenv "LIBRARY_PATH"))) (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) (find-library (lambda (name)
(search-path (or (search-path
library-path library-path
(string-append "lib" name ".so"))))) (string-append "lib" name ".so"))
(string-append "lib" name ".so")))))
(for-each (for-each
(lambda (file) (lambda (file)
(catch 'decoding-error (catch 'decoding-error
@ -2139,8 +2150,13 @@ (define-public openjdk11
(add-after 'unpack 'patch-jni-libs (add-after 'unpack 'patch-jni-libs
;; Hardcode dynamically loaded libraries. ;; Hardcode dynamically loaded libraries.
(lambda _ (lambda _
(let* ((library-path (search-path-as-string->list (use-modules (srfi srfi-1))
(getenv "LIBRARY_PATH"))) (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) (find-library (lambda (name)
(search-path (search-path
library-path library-path