mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gnu: openjdk: Fix library substitution when libraries aren't found.
* gnu/packages/java.scm (icedtea-8, openjdk9, openjdk11)[arguments]:
Change 'find-library' to always return a string. Change 'find-library'
callers to use 'string-append' rather than 'format'. Starting from
97a43db8b4
, 'find-library' could return #f
and JNI substitutions would emit a literal "#f".
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
92b02d0c18
commit
522a48a228
1 changed files with 14 additions and 12 deletions
|
@ -1800,9 +1800,10 @@ (define (icedtea-or-openjdk? path)
|
|||
(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
|
||||
|
@ -1810,9 +1811,9 @@ (define (icedtea-or-openjdk? path)
|
|||
(substitute* file
|
||||
(("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
|
||||
_ name version)
|
||||
(format #f "\"~a\"" (find-library name)))
|
||||
(string-append "\"" (find-library name) "\""))
|
||||
(("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
|
||||
(format #f "\"~a\"" (find-library name)))))
|
||||
(string-append "\"" (find-library name) "\""))))
|
||||
(lambda _
|
||||
;; Those are safe to skip.
|
||||
(format (current-error-port)
|
||||
|
@ -1955,9 +1956,9 @@ (define (icedtea-or-openjdk? path)
|
|||
(substitute* file
|
||||
(("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
|
||||
_ name version)
|
||||
(format #f "\"~a\"" (find-library name)))
|
||||
(string-append "\"" (find-library name) "\""))
|
||||
(("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
|
||||
(format #f "\"~a\"" (find-library name)))))
|
||||
(string-append "\"" (find-library name) "\""))))
|
||||
(lambda _
|
||||
;; Those are safe to skip.
|
||||
(format (current-error-port)
|
||||
|
@ -2158,9 +2159,10 @@ (define (icedtea-or-openjdk? path)
|
|||
(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
|
||||
|
@ -2168,9 +2170,9 @@ (define (icedtea-or-openjdk? path)
|
|||
(substitute* file
|
||||
(("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
|
||||
_ name version)
|
||||
(format #f "\"~a\"" (find-library name)))
|
||||
(string-append "\"" (find-library name) "\""))
|
||||
(("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
|
||||
(format #f "\"~a\"" (find-library name)))))
|
||||
(string-append "\"" (find-library name) "\""))))
|
||||
(lambda _
|
||||
;; Those are safe to skip.
|
||||
(format (current-error-port)
|
||||
|
|
Loading…
Reference in a new issue