From c5a5c27a90a9daf028a0d2abafe0e120050c6f6e Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 17 Feb 2026 17:41:22 +0900 Subject: gnu: openjdk10: Modernize. * gnu/packages/java.scm (openjdk10) [arguments]: Use gexps. [native-inputs]: Delete labels. Change-Id: I11f214295ed911a492510e22e1f910fc29832e6f --- gnu/packages/java.scm | 113 +++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 56 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 1d1a4f77e14..c44bb9629ee 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1236,66 +1236,67 @@ new Date();")))) "openjdk-currency-time-bomb2.patch")))) (arguments (substitute-keyword-arguments (package-arguments openjdk9) - ((#:phases phases) - `(modify-phases ,phases - ,@(if (target-aarch64?) - `((replace 'patch-for-aarch64 - (lambda _ - (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp" - ;; This line is duplicated, so remove both occurrences, - ;; then add back one occurrence by substituting a - ;; comment that occurs once. - (("using MacroAssembler::call_VM_leaf_base;") "") - (("Interpreter specific version of call_VM_base") - (string-append "Interpreter specific version of call_VM_base\n" - " using MacroAssembler::call_VM_leaf_base;")))))) - '()) - (replace 'fix-java-shebangs - (lambda _ - ;; This file was "fixed" by patch-source-shebangs, but it requires - ;; this exact first line. - (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem" - (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n")))) - (add-after 'unpack 'remove-timestamping - (lambda _ - (substitute* "./src/hotspot/share/runtime/vm_version.cpp" - (("__DATE__") "") - (("__TIME__") "")))) - (replace 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (invoke "bash" "./configure" - ;; Add flags for compilation with gcc >= 10 - ,(string-append "--with-extra-cflags=-fcommon" + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + #$@(if (target-aarch64?) + #~((replace 'patch-for-aarch64 + (lambda _ + (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp" + ;; This line is duplicated, so remove both occurrences, + ;; then add back one occurrence by substituting a + ;; comment that occurs once. + (("using MacroAssembler::call_VM_leaf_base;") "") + (("Interpreter specific version of call_VM_base") + (string-append "Interpreter specific version of call_VM_base\n" + " using MacroAssembler::call_VM_leaf_base;")))))) + #~()) + (replace 'fix-java-shebangs + (lambda _ + ;; This file was "fixed" by patch-source-shebangs, but it requires + ;; this exact first line. + (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem" + (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n")))) + (add-after 'unpack 'remove-timestamping + (lambda _ + (substitute* "./src/hotspot/share/runtime/vm_version.cpp" + (("__DATE__") "") + (("__TIME__") "")))) + (replace 'configure + (lambda* (#:key inputs #:allow-other-keys) + (invoke "bash" "./configure" + ;; Add flags for compilation with gcc >= 10 + (string-append "--with-extra-cflags=-fcommon" " -fno-delete-null-pointer-checks" " -fno-lifetime-dse" ;; flags for compilation with gcc >= 14. " -Wno-error=int-conversion") - (string-append "--with-freetype=" - (assoc-ref inputs "freetype")) - "--disable-freetype-bundling" - "--disable-warnings-as-errors" - "--disable-hotspot-gtest" - "--with-giflib=system" - "--with-libjpeg=system" - "--with-native-debug-symbols=zipped" - (string-append "--prefix=" (assoc-ref outputs "out"))))) - (add-after 'unpack 'disable-warnings-as-errors - (lambda _ - ;; It looks like the "--disable-warnings-as-errors" option of - ;; the 'configure' phase is not working. - (substitute* "make/autoconf/generated-configure.sh" - (("-Werror") "")))))) - ((#:disallowed-references _ '()) - `(,(this-package-native-input "openjdk9") - ,(gexp-input (this-package-native-input "openjdk9") "jdk"))))) - (native-inputs - `(("openjdk9" ,openjdk9) - ("openjdk9:jdk" ,openjdk9 "jdk") - ("make@4.2" ,gnu-make-4.2) - ("nss-certs" ,nss-certs) - ("unzip" ,unzip) - ("which" ,which) - ("zip" ,zip))))) + (string-append "--with-freetype=" + (assoc-ref inputs "freetype")) + "--disable-freetype-bundling" + "--disable-warnings-as-errors" + "--disable-hotspot-gtest" + "--with-giflib=system" + "--with-libjpeg=system" + "--with-native-debug-symbols=zipped" + (string-append "--prefix=" #$output)))) + (add-after 'unpack 'disable-warnings-as-errors + (lambda _ + ;; It looks like the "--disable-warnings-as-errors" option of + ;; the 'configure' phase is not working. + (substitute* "make/autoconf/generated-configure.sh" + (("-Werror") "")))))) + ((#:disallowed-references refs '()) + (cons* (this-package-native-input "openjdk") + (gexp-input (this-package-native-input "openjdk") "jdk") + refs)))) + (native-inputs + (list gnu-make-4.2 + openjdk9 + `(,openjdk9 "jdk") + nss-certs + unzip + which + zip)))) (define-public openjdk11 (package -- cgit v1.3