mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-30 16:10:36 +00:00
corretto: introduce source.json files per version
This commit aligns the various corretto builds further with their corresponding openjdk builds by also using "source.json" files for each corretto version. The individual "corretto-XX.nix" files have been removed and and mk-corretto.nix has been adapted to be able to compile from data extracted from the "source.json" files (similar to openjdk/generic.nix).
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
{
|
||||
fetchFromGitHub,
|
||||
gradle_8,
|
||||
jdk11,
|
||||
lib,
|
||||
stdenv,
|
||||
rsync,
|
||||
runCommand,
|
||||
testers,
|
||||
}:
|
||||
|
||||
let
|
||||
corretto = import ./mk-corretto.nix rec {
|
||||
inherit
|
||||
lib
|
||||
stdenv
|
||||
rsync
|
||||
runCommand
|
||||
testers
|
||||
;
|
||||
jdk = jdk11;
|
||||
gradle = gradle_8;
|
||||
version = "11.0.30.7.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "corretto";
|
||||
repo = "corretto-11";
|
||||
rev = version;
|
||||
hash = "sha256-SUdJlTYE+RRAZa8DhFW0EYW1kHmuNDG+hk+/3MXtx1w=";
|
||||
};
|
||||
};
|
||||
in
|
||||
corretto.overrideAttrs (oldAttrs: {
|
||||
patches = (oldAttrs.patches or [ ]) ++ [
|
||||
./corretto11-gradle8.patch
|
||||
];
|
||||
|
||||
})
|
||||
6
pkgs/development/compilers/corretto/11/source.json
Normal file
6
pkgs/development/compilers/corretto/11/source.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"hash": "sha256-SUdJlTYE+RRAZa8DhFW0EYW1kHmuNDG+hk+/3MXtx1w=",
|
||||
"owner": "corretto",
|
||||
"repo": "corretto-11",
|
||||
"rev": "refs/tags/11.0.30.7.1"
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
fetchFromGitHub,
|
||||
fetchurl,
|
||||
gradle_8,
|
||||
jdk17,
|
||||
lib,
|
||||
stdenv,
|
||||
rsync,
|
||||
runCommand,
|
||||
testers,
|
||||
}:
|
||||
|
||||
let
|
||||
corretto = import ./mk-corretto.nix rec {
|
||||
inherit
|
||||
lib
|
||||
stdenv
|
||||
rsync
|
||||
runCommand
|
||||
testers
|
||||
;
|
||||
jdk = jdk17;
|
||||
gradle = gradle_8;
|
||||
version = "17.0.17.10.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "corretto";
|
||||
repo = "corretto-17";
|
||||
rev = version;
|
||||
hash = "sha256-Z8+g5jXjcWNTYU9Xvze7scu348okMauGMhSZwX1sS9w=";
|
||||
};
|
||||
};
|
||||
in
|
||||
corretto.overrideAttrs (
|
||||
final: prev: {
|
||||
# Corretto17 has incorporated this patch already so it fails to apply.
|
||||
# We thus skip it here.
|
||||
# See https://github.com/corretto/corretto-17/pull/158
|
||||
patches =
|
||||
lib.remove (fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/community/openjdk17/FixNullPtrCast.patch?id=41e78a067953e0b13d062d632bae6c4f8028d91c";
|
||||
sha256 = "sha256-LzmSew51+DyqqGyyMw2fbXeBluCiCYsS1nCjt9hX6zo=";
|
||||
}) (prev.patches or [ ])
|
||||
++ [ ./corretto17-gradle8.patch ];
|
||||
}
|
||||
)
|
||||
6
pkgs/development/compilers/corretto/17/source.json
Normal file
6
pkgs/development/compilers/corretto/17/source.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"hash": "sha256-Z8+g5jXjcWNTYU9Xvze7scu348okMauGMhSZwX1sS9w=",
|
||||
"owner": "corretto",
|
||||
"repo": "corretto-17",
|
||||
"rev": "refs/tags/17.0.17.10"
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
fetchFromGitHub,
|
||||
gradle_8,
|
||||
jdk21,
|
||||
lib,
|
||||
stdenv,
|
||||
rsync,
|
||||
runCommand,
|
||||
testers,
|
||||
}:
|
||||
|
||||
let
|
||||
corretto = import ./mk-corretto.nix rec {
|
||||
inherit
|
||||
lib
|
||||
stdenv
|
||||
rsync
|
||||
runCommand
|
||||
testers
|
||||
;
|
||||
jdk = jdk21;
|
||||
gradle = gradle_8;
|
||||
version = "21.0.9.11.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "corretto";
|
||||
repo = "corretto-21";
|
||||
rev = version;
|
||||
hash = "sha256-d62rXVgVlOM3M18c8GioFtMi/GhmCEMLQwy/EWAJW7I=";
|
||||
};
|
||||
};
|
||||
in
|
||||
corretto.overrideAttrs (oldAttrs: {
|
||||
patches = (oldAttrs.patches or [ ]) ++ [
|
||||
./corretto21-gradle8.patch
|
||||
];
|
||||
|
||||
})
|
||||
6
pkgs/development/compilers/corretto/21/source.json
Normal file
6
pkgs/development/compilers/corretto/21/source.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"hash": "sha256-d62rXVgVlOM3M18c8GioFtMi/GhmCEMLQwy/EWAJW7I=",
|
||||
"owner": "corretto",
|
||||
"repo": "corretto-21",
|
||||
"rev": "refs/tags/21.0.9.11.1"
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
)
|
||||
6
pkgs/development/compilers/corretto/25/source.json
Normal file
6
pkgs/development/compilers/corretto/25/source.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"hash": "sha256-eAjepqxp5LVQgP/HcxwwdjbXxy5jUOJC4HYntcHNX0o=",
|
||||
"owner": "corretto",
|
||||
"repo": "corretto-25",
|
||||
"rev": "refs/tags/25.0.1.9.1"
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
{
|
||||
jdk,
|
||||
version,
|
||||
src,
|
||||
majorVersion, # jdk wording is "featureVersion"
|
||||
jdk11,
|
||||
jdk17,
|
||||
jdk21,
|
||||
jdk25,
|
||||
lib,
|
||||
fetchurl,
|
||||
stdenv,
|
||||
gradle,
|
||||
nixpkgs-openjdk-updater,
|
||||
extraConfig ? [ ],
|
||||
extraNativeBuildInputs ? [ ],
|
||||
rsync,
|
||||
runCommand,
|
||||
testers,
|
||||
@@ -23,24 +26,68 @@
|
||||
# See https://github.com/corretto/corretto-17/blob/release-17.0.8.8.1/build.gradle#L40
|
||||
# "major.minor.security.build.revision"
|
||||
let
|
||||
majorVersion = builtins.head (lib.strings.splitString "." version); # same as "featureVersion" for OpenJDK
|
||||
sourceFile = ./. + "/${majorVersion}/source.json";
|
||||
source = nixpkgs-openjdk-updater.openjdkSource {
|
||||
inherit sourceFile;
|
||||
featureVersionPrefix = majorVersion;
|
||||
};
|
||||
version = lib.removePrefix "refs/tags/" source.src.rev; # "17.0.8.8.1"
|
||||
jdk =
|
||||
{
|
||||
"11" = jdk11;
|
||||
"17" = jdk17;
|
||||
"21" = jdk21;
|
||||
"25" = jdk25;
|
||||
}
|
||||
.${majorVersion};
|
||||
is11 = majorVersion == "11";
|
||||
is17 = majorVersion == "17";
|
||||
is21 = majorVersion == "21";
|
||||
is25 = majorVersion == "25";
|
||||
pname = "corretto${majorVersion}";
|
||||
in
|
||||
jdk.overrideAttrs (
|
||||
finalAttrs: oldAttrs: {
|
||||
inherit pname version src;
|
||||
inherit pname version;
|
||||
inherit (source) src;
|
||||
|
||||
nativeBuildInputs =
|
||||
oldAttrs.nativeBuildInputs
|
||||
++ [
|
||||
jdk
|
||||
gradle
|
||||
rsync
|
||||
]
|
||||
++ extraNativeBuildInputs;
|
||||
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [
|
||||
jdk
|
||||
gradle
|
||||
rsync
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
patches =
|
||||
if is11 then
|
||||
(oldAttrs.patches or [ ])
|
||||
++ [
|
||||
./11/gradle8.patch
|
||||
]
|
||||
else if is17 then
|
||||
# Corretto17 has incorporated this patch already so it fails to apply.
|
||||
# We thus skip it here.
|
||||
# See https://github.com/corretto/corretto-17/pull/158
|
||||
lib.remove (fetchurl {
|
||||
url = "https://git.alpinelinux.org/aports/plain/community/openjdk17/FixNullPtrCast.patch?id=41e78a067953e0b13d062d632bae6c4f8028d91c";
|
||||
sha256 = "sha256-LzmSew51+DyqqGyyMw2fbXeBluCiCYsS1nCjt9hX6zo=";
|
||||
}) (oldAttrs.patches or [ ])
|
||||
++ [ ./17/gradle8.patch ]
|
||||
else if is21 then
|
||||
(oldAttrs.patches or [ ])
|
||||
++ [
|
||||
./21/gradle8.patch
|
||||
]
|
||||
else if is25 then
|
||||
(oldAttrs.patches or [ ])
|
||||
++ [
|
||||
# See patches in openjdk/generic.nix.
|
||||
./25/remove_removal_of_wformat_during_test_compilation.patch
|
||||
]
|
||||
else
|
||||
(oldAttrs.patches or [ ]);
|
||||
|
||||
postPatch =
|
||||
let
|
||||
extra_config = builtins.concatStringsSep " " extraConfig;
|
||||
|
||||
@@ -49,12 +49,18 @@ in
|
||||
};
|
||||
in
|
||||
mkLinuxDarwin openjdkLinux openjdkDarwin;
|
||||
|
||||
mkCorretto =
|
||||
majorVersion:
|
||||
callPackage ../development/compilers/corretto/mk-corretto.nix {
|
||||
inherit majorVersion;
|
||||
};
|
||||
in
|
||||
rec {
|
||||
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 { };
|
||||
corretto11 = mkCorretto "11";
|
||||
corretto17 = mkCorretto "17";
|
||||
corretto21 = mkCorretto "21";
|
||||
corretto25 = mkCorretto "25";
|
||||
|
||||
openjdk8 = mkOpenjdk "8";
|
||||
openjdk11 = mkOpenjdk "11";
|
||||
|
||||
Reference in New Issue
Block a user