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 Ludovic Courtès
parent 185709221d
commit 92b02d0c18
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

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