From 482685697719386ca3505e8beca2398f93aff08f Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 4 Nov 2023 23:10:24 +0200 Subject: gnu: icedtea-7: Fix building on powerpc-linux. * gnu/packages/java.scm (icedtea-7)[arguments]: Adjust custom 'install-libjvm phase to add support for powerpc-linux. Change-Id: Ie77a2b53fdef1e0ddc0351e6c2d0241d08b80508 --- gnu/packages/java.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index f482c4c16d..ac427b8eaa 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -518,6 +518,8 @@ (define-public icedtea-7 "/lib/arm") ("aarch64-linux" "/lib/aarch64") + ("powerpc-linux" + "/lib/ppc") ;; We need a catch-all, dropping ;; '-linux' works in most cases. (_ -- cgit v1.2.3 From 5392d9db46d6f931233be2f25688481181622bb4 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 2 Nov 2023 07:50:09 +0100 Subject: gnu: openjdk9: Install default certificates. * gnu/packages/java.scm (openjdk9)[arguments]: Add a phase to install certificates from nss-certs to the expected location. (openjdk10, openjdk11): Adapt to also install the certificates. Change-Id: I6ef626324386419e84a9c0eace5a278ca11c573c --- gnu/packages/java.scm | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index ac427b8eaa..65d8f57508 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -880,7 +880,14 @@ (define-public openjdk9 (build-system gnu-build-system) (outputs '("out" "jdk" "doc")) (arguments - `(#:tests? #f; require jtreg + `(#:imported-modules + ((guix build ant-build-system) + ,@%gnu-build-system-modules) + #:modules + ((guix build utils) + (guix build gnu-build-system) + (ice-9 popen)) + #:tests? #f; require jtreg #:make-flags '("all") #:disallowed-references ,(list (gexp-input icedtea-8) (gexp-input icedtea-8 "jdk")) @@ -973,6 +980,80 @@ (define (icedtea-or-openjdk? path) (find-files "." "\\.c$|\\.h$")) #t))) + ;; By default OpenJDK only generates an empty keystore. In order to + ;; be able to use certificates in Java programs we need to generate a + ;; keystore from a set of certificates. For convenience we use the + ;; certificates from the nss-certs package. + (add-after 'install 'install-keystore + (lambda* (#:key inputs outputs #:allow-other-keys) + (use-modules (ice-9 rdelim)) + (let* ((keystore "cacerts") + (certs-dir (search-input-directory inputs + "etc/ssl/certs")) + (keytool (string-append (assoc-ref outputs "jdk") + "/bin/keytool"))) + (define (extract-cert file target) + (call-with-input-file file + (lambda (in) + (call-with-output-file target + (lambda (out) + (let loop ((line (read-line in 'concat)) + (copying? #f)) + (cond + ((eof-object? line) #t) + ((string-prefix? "-----BEGIN" line) + (display line out) + (loop (read-line in 'concat) #t)) + ((string-prefix? "-----END" line) + (display line out) + #t) + (else + (when copying? (display line out)) + (loop (read-line in 'concat) copying?))))))))) + (define (import-cert cert) + (format #t "Importing certificate ~a\n" (basename cert)) + (let ((temp "tmpcert")) + (extract-cert cert temp) + (let ((port (open-pipe* OPEN_WRITE keytool + "-import" + "-alias" (basename cert) + "-keystore" keystore + "-storepass" "changeit" + "-file" temp))) + (display "yes\n" port) + (when (not (zero? (status:exit-val (close-pipe port)))) + (format #t "failed to import ~a\n" cert))) + (delete-file temp))) + + ;; This is necessary because the certificate directory contains + ;; files with non-ASCII characters in their names. + (setlocale LC_ALL "en_US.utf8") + (setenv "LC_ALL" "en_US.utf8") + + (copy-file (string-append (assoc-ref outputs "out") + "/lib/security/cacerts") + keystore) + (chmod keystore #o644) + (for-each import-cert (find-files certs-dir "\\.pem$")) + (mkdir-p (string-append (assoc-ref outputs "out") + "/lib/security")) + (mkdir-p (string-append (assoc-ref outputs "jdk") + "/lib/security")) + + ;; The cacerts files we are going to overwrite are chmod'ed as + ;; read-only (444) in icedtea-8 (which derives from this + ;; package). We have to change this so we can overwrite them. + (chmod (string-append (assoc-ref outputs "out") + "/lib/security/" keystore) #o644) + (chmod (string-append (assoc-ref outputs "jdk") + "/lib/security/" keystore) #o644) + + (install-file keystore + (string-append (assoc-ref outputs "out") + "/lib/security")) + (install-file keystore + (string-append (assoc-ref outputs "jdk") + "/lib/security"))))) ;; Some of the libraries in the lib/ folder link to libjvm.so. ;; But that shared object is located in the server/ folder, so it ;; cannot be found. This phase creates a symbolic link in the @@ -1046,6 +1127,7 @@ (define (icedtea-or-openjdk? path) ("icedtea-8:jdk" ,icedtea-8 "jdk") ;; XXX: The build system fails with newer versions of GNU Make. ("make@4.2" ,gnu-make-4.2) + ("nss-certs" ,nss-certs) ("unzip" ,unzip) ("which" ,which) ("zip" ,zip))) @@ -1128,6 +1210,7 @@ (define-public openjdk10 `(("openjdk9" ,openjdk9) ("openjdk9:jdk" ,openjdk9 "jdk") ("make@4.2" ,gnu-make-4.2) + ("nss-certs" ,nss-certs) ("unzip" ,unzip) ("which" ,which) ("zip" ,zip))))) @@ -1154,6 +1237,7 @@ (define-public openjdk11 #:modules `((guix build gnu-build-system) (guix build utils) (ice-9 match) + (ice-9 popen) (srfi srfi-1) (srfi srfi-26)) #:disallowed-references (list (gexp-input openjdk10) @@ -1396,6 +1480,7 @@ (define (icedtea-or-openjdk? path) openjdk10 `(,openjdk10 "jdk") gnu-make-4.2 + nss-certs pkg-config unzip which -- cgit v1.2.3 From 14e01e313da2d0650d4501233e4a10787df213f1 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 2 Nov 2023 07:50:11 +0100 Subject: gnu: Add java-jakarta-json. * gnu/packages/java.scm (java-jakarta-json): New variable. Change-Id: I2c123710f9d31bf71e8fb86ff0d336b6fcfa9674 --- gnu/packages/java.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 65d8f57508..b7137386c3 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -13655,6 +13655,33 @@ (define-public java-jsonp-impl parse, generate, transform and query) JSON messages. This package contains a reference implementation of that API."))) +(define-public java-jakarta-json + (package + (name "java-jakarta-json") + (version "2.1.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jakartaee/jsonp-api") + (commit (string-append version "-RELEASE")))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "jakarta-json.jar" + #:source-dir "api/src/main/java" + #:tests? #f; no tests + #:jdk ,openjdk11)) + (home-page "https://github.com/jakartaee/jsonp-api") + (synopsis "Portable API for JSON handling in Java") + (description "This project contains API and Compatible Implementation of +Jakarta JSON Processing specification. Jakarta JSON Processing provides +portable APIs to parse, generate, transform, and query JSON documents.") + ;; with classpath exception + (license license:epl2.0))) + (define-public java-xmp (package (name "java-xmp") -- cgit v1.2.3 From dd631a891ce9e5202121d613bb97535891271f94 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 2 Nov 2023 07:50:12 +0100 Subject: gnu: Add java-parsson. * gnu/packages/java.scm (java-parsson): New variable. Change-Id: Ie564924329e4e0a866e6ed5fe9135c841fb66ae8 --- gnu/packages/java.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index b7137386c3..7c8c4e0a36 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -13682,6 +13682,43 @@ (define-public java-jakarta-json ;; with classpath exception (license license:epl2.0))) +(define-public java-parsson + (package + (name "java-parsson") + (version "1.1.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/eclipse-ee4j/parsson") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "parsson.jar" + #:source-dir "impl/src/main/java" + #:test-dir "impl/src/test" + #:use-java-modules? #t + #:jdk ,openjdk11 + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'copy-resources + (lambda _ + (copy-recursively "impl/src/main/resources" + "build/classes")))))) + (inputs + (list java-jakarta-json)) + (native-inputs + (list java-junit)) + (home-page "https://github.com/eclipse-ee4j/parsson") + (synopsis "Implementation of Jakarta JSON API") + (description "Eclipse Parsson is an implementation of the Jakarta JSON +Processing specification.") + ;; with classpath exception + (license license:epl2.0))) + (define-public java-xmp (package (name "java-xmp") -- cgit v1.2.3