From cdce1070e8f3d980b05541d6adeef87ca498ba08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Schr=C3=B6der?= Date: Tue, 4 Nov 2025 22:23:34 +0100 Subject: [PATCH] corretto25: init at 25.0.1.9.1 --- pkgs/development/compilers/corretto/25.nix | 41 +++++++++++++++++++ .../compilers/corretto/mk-corretto.nix | 17 +++++--- ...l_of_wformat_during_test_compilation.patch | 13 ++++++ pkgs/top-level/all-packages.nix | 1 + pkgs/top-level/java-packages.nix | 1 + 5 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/compilers/corretto/25.nix create mode 100644 pkgs/development/compilers/corretto/remove_removal_of_wformat_during_test_compilation.patch diff --git a/pkgs/development/compilers/corretto/25.nix b/pkgs/development/compilers/corretto/25.nix new file mode 100644 index 000000000000..1b9b5bdf5761 --- /dev/null +++ b/pkgs/development/compilers/corretto/25.nix @@ -0,0 +1,41 @@ +{ + fetchFromGitHub, + gradle_9, + jdk25, + lib, + stdenv, + rsync, + pandoc, + runCommand, + testers, +}: + +let + corretto = import ./mk-corretto.nix rec { + inherit + lib + stdenv + rsync + runCommand + testers + ; + jdk = jdk25; + gradle = gradle_9; + version = "25.0.1.9.1"; + src = fetchFromGitHub { + owner = "corretto"; + repo = "corretto-25"; + rev = version; + hash = "sha256-eAjepqxp5LVQgP/HcxwwdjbXxy5jUOJC4HYntcHNX0o="; + }; + extraNativeBuildInputs = [ pandoc ]; + }; +in +corretto.overrideAttrs ( + final: prev: { + patches = (prev.patches or [ ]) ++ [ + # See patches in openjdk/generic.nix. + ./remove_removal_of_wformat_during_test_compilation.patch + ]; + } +) diff --git a/pkgs/development/compilers/corretto/mk-corretto.nix b/pkgs/development/compilers/corretto/mk-corretto.nix index 9fdc03d3059e..ecb52296902d 100644 --- a/pkgs/development/compilers/corretto/mk-corretto.nix +++ b/pkgs/development/compilers/corretto/mk-corretto.nix @@ -6,6 +6,7 @@ stdenv, gradle, extraConfig ? [ ], + extraNativeBuildInputs ? [ ], rsync, runCommand, testers, @@ -29,11 +30,14 @@ jdk.overrideAttrs ( finalAttrs: oldAttrs: { inherit pname version src; - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ - jdk - gradle - rsync - ]; + nativeBuildInputs = + oldAttrs.nativeBuildInputs + ++ [ + jdk + gradle + rsync + ] + ++ extraNativeBuildInputs; dontConfigure = true; @@ -41,7 +45,8 @@ jdk.overrideAttrs ( let extra_config = builtins.concatStringsSep " " extraConfig; in - '' + (oldAttrs.postPatch or "") + + '' # The rpm/deb task definitions require a Gradle plugin which we don't # have and so the build fails. We'll simply remove them here because # they are not needed anyways. diff --git a/pkgs/development/compilers/corretto/remove_removal_of_wformat_during_test_compilation.patch b/pkgs/development/compilers/corretto/remove_removal_of_wformat_during_test_compilation.patch new file mode 100644 index 000000000000..077fb2330e96 --- /dev/null +++ b/pkgs/development/compilers/corretto/remove_removal_of_wformat_during_test_compilation.patch @@ -0,0 +1,13 @@ +diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk +index fd1c54eaf..c1e240a19 100644 +--- a/make/common/TestFilesCompilation.gmk ++++ b/make/common/TestFilesCompilation.gmk +@@ -112,7 +112,7 @@ define SetupTestFilesCompilationBody + CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ + LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \ + LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \ +- DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \ ++ DISABLED_WARNINGS_gcc := undef unused-but-set-variable \ + unused-const-variable unused-function unused-value \ + unused-variable, \ + DISABLED_WARNINGS_clang := format-nonliteral \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f64fe70796bc..88549314f609 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4190,6 +4190,7 @@ with pkgs; corretto11 = javaPackages.compiler.corretto11; corretto17 = javaPackages.compiler.corretto17; corretto21 = javaPackages.compiler.corretto21; + corretto25 = javaPackages.compiler.corretto25; inherit (callPackage ../development/compilers/crystal { }) crystal_1_14 diff --git a/pkgs/top-level/java-packages.nix b/pkgs/top-level/java-packages.nix index 974c4d59611d..7c222e5f8300 100644 --- a/pkgs/top-level/java-packages.nix +++ b/pkgs/top-level/java-packages.nix @@ -47,6 +47,7 @@ in corretto11 = callPackage ../development/compilers/corretto/11.nix { }; corretto17 = callPackage ../development/compilers/corretto/17.nix { }; corretto21 = callPackage ../development/compilers/corretto/21.nix { }; + corretto25 = callPackage ../development/compilers/corretto/25.nix { }; openjdk8 = mkOpenjdk "8"; openjdk11 = mkOpenjdk "11";