gnu: r-rjava: Use OpenJDK 11.

See https://github.com/s-u/rJava/issues/307.

* gnu/packages/cran.scm (r-rjava)[arguments]: Use search-input-file.
[inputs]: Replace icedtea-8 with openjdk11.

Change-Id: I9e67210f1bfd585fb53845dad55a56a639a5d806
This commit is contained in:
Ricardo Wurmus 2023-11-01 19:32:10 +01:00
parent a96f1c1bc0
commit 0647f308b4
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -23314,29 +23314,24 @@ (define-public r-rjava
(properties `((upstream-name . "rJava")))
(build-system r-build-system)
(arguments
`(#:modules ((guix build utils)
(guix build r-build-system)
(ice-9 match))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-JAVA_HOME
(lambda* (#:key inputs #:allow-other-keys)
(let ((jdk (assoc-ref inputs "jdk")))
(setenv "JAVA_HOME" jdk)
(setenv "JAVA" (which "java"))
(setenv "JAR" (which "jar"))
(setenv "JAVAC" (which "javac"))
(setenv "JAVAH" (which "javah"))
(setenv "JAVA_CPPFLAGS"
(string-append "-I" jdk "/include "
"-I" jdk "/include/linux"))
(match (find-files (string-append jdk "/jre/lib/") "libjvm.so")
((lib) (setenv "JAVA_LIBS" lib))
(_ (error "Could not find libjvm.so"))))
#t)))))
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'set-JAVA_HOME
(lambda* (#:key inputs #:allow-other-keys)
(let ((jdk (assoc-ref inputs "jdk")))
(setenv "JAVA_HOME" jdk)
(setenv "JAVA" (which "java"))
(setenv "JAR" (which "jar"))
(setenv "JAVAC" (which "javac"))
(setenv "JAVAH" (which "javah"))
(setenv "JAVA_CPPFLAGS"
(string-append "-I" jdk "/include "
"-I" jdk "/include/linux"))
(setenv "JAVA_LIBS" (search-input-file inputs "/lib/libjvm.so"))))))))
(inputs
`(("icu4c" ,icu4c)
("jdk" ,icedtea-8 "jdk")
("jdk" ,openjdk11 "jdk")
("zlib" ,zlib)))
(home-page "https://www.rforge.net/rJava/")
(synopsis "Low-Level R to Java interface")