Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pcasaretto committed Mar 1, 2024
1 parent f82ab17 commit e2534cf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
5 changes: 2 additions & 3 deletions pkgs/development/compilers/corretto/17.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
, xcbuild
, zip
, coreutils
, xattr
, setfile
, darwin
}:

let
corretto = import ./mk-corretto.nix {
inherit lib stdenv autoconf rsync runCommand testers which xcbuild zip coreutils xattr setfile;
inherit lib stdenv autoconf rsync runCommand testers which xcbuild zip coreutils darwin;
jdk = jdk17;
gradle = gradle_7;
version = "17.0.8.8.1";
Expand Down
19 changes: 16 additions & 3 deletions pkgs/development/compilers/corretto/mk-corretto.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
, xcbuild
, zip
, coreutils
, xattr
, setfile
, darwin
}:

# Each Corretto version is based on a corresponding OpenJDK version. So
Expand All @@ -28,12 +27,26 @@ let
# The version scheme is different between OpenJDK & Corretto.
# See https://github.com/corretto/corretto-17/blob/release-17.0.8.8.1/build.gradle#L40
# "major.minor.security.build.revision"
#
appleFrameworks = darwin.apple_sdk_11_0.frameworks;
metalFrameworks = [
appleFrameworks.Accelerate
appleFrameworks.Metal
appleFrameworks.MetalKit
appleFrameworks.MetalPerformanceShaders
];

in
jdk.overrideAttrs (finalAttrs: oldAttrs: {
inherit pname version src;
name = "${pname}-${version}";

nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ jdk gradle rsync ] ++ lib.optionals stdenv.isDarwin [ coreutils zip autoconf which xcbuild xattr setfile ];
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ jdk gradle rsync ] ++ lib.optionals stdenv.isDarwin
(
[ coreutils zip autoconf which xcbuild darwin.xattr darwin.stubs.setfile ]
++
metalFrameworks
);

configurePhase = ''
runHook preConfigure
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/java-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ in {

corretto11 = callPackage ../development/compilers/corretto/11.nix { };
corretto17 = callPackage ../development/compilers/corretto/17.nix {
xattr=darwin.xattr;
setfile=darwin.stubs.setfile;
darwin=darwin;
};
corretto19 = callPackage ../development/compilers/corretto/19.nix { };

Expand Down

0 comments on commit e2534cf

Please sign in to comment.