Skip to content

Commit 1b006e3

Browse files
(darwin) openjdk11: 11.0.9 -> 11.0.11
Also adds aarch64-darwin support
1 parent 00090e0 commit 1b006e3

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

  • pkgs/development/compilers/openjdk/darwin

pkgs/development/compilers/openjdk/darwin/11.nix

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1-
{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
1+
{ lib, stdenv, fetchurl, unzip, setJavaClassPath }:
22
let
3+
# Details from https://www.azul.com/downloads/?version=java-11-lts&os=macos&package=jdk
4+
# Note that the latest build may differ by platform
5+
dist = {
6+
x86_64-darwin = {
7+
arch = "x64";
8+
zuluVersion = "11.48.21";
9+
jdkVersion = "11.0.11";
10+
sha256 = "0v0n7h7i04pvna41wpdq2k9qiy70sbbqzqzvazfdvgm3gb22asw6";
11+
};
12+
13+
aarch64-darwin = {
14+
arch = "aarch64";
15+
zuluVersion = "11.48.21";
16+
jdkVersion = "11.0.11";
17+
sha256 = "066whglrxx81c95grv2kxdbvyh32728ixhml2v44ildh549n4lhc";
18+
};
19+
}."${stdenv.hostPlatform.system}";
20+
321
jce-policies = fetchurl {
422
# Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
523
url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip";
624
sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0";
725
};
826

927
jdk = stdenv.mkDerivation rec {
10-
name = "zulu11.43.21-ca-jdk11.0.9";
28+
pname = "zulu${dist.zuluVersion}-ca-jdk";
29+
version = dist.jdkVersion;
1130

1231
src = fetchurl {
13-
url = "https://cdn.azul.com/zulu/bin/${name}-macosx_x64.tar.gz";
14-
sha256 = "1j19fb5mwdkfn6y8wfsnvxsz6wfpcab4xv439fqssxy520n6q4zs";
15-
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-mac/";
32+
url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz";
33+
inherit (dist) sha256;
34+
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/";
1635
};
1736

1837
nativeBuildInputs = [ unzip ];
19-
buildInputs = [ freetype ];
2038

2139
installPhase = ''
2240
mkdir -p $out
@@ -41,8 +59,6 @@ let
4159
mkdir -p $out/nix-support
4260
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
4361
44-
install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/lib/libfontmanager.dylib
45-
4662
# Set JAVA_HOME automatically.
4763
cat <<EOF >> $out/nix-support/setup-hook
4864
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi

0 commit comments

Comments
 (0)