|
1 | | -{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }: |
| 1 | +{ lib, stdenv, fetchurl, unzip, setJavaClassPath }: |
2 | 2 | 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 | + |
3 | 21 | jce-policies = fetchurl { |
4 | 22 | # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK! |
5 | 23 | url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip"; |
6 | 24 | sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0"; |
7 | 25 | }; |
8 | 26 |
|
9 | 27 | jdk = stdenv.mkDerivation rec { |
10 | | - name = "zulu11.43.21-ca-jdk11.0.9"; |
| 28 | + pname = "zulu${dist.zuluVersion}-ca-jdk"; |
| 29 | + version = dist.jdkVersion; |
11 | 30 |
|
12 | 31 | 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/"; |
16 | 35 | }; |
17 | 36 |
|
18 | 37 | nativeBuildInputs = [ unzip ]; |
19 | | - buildInputs = [ freetype ]; |
20 | 38 |
|
21 | 39 | installPhase = '' |
22 | 40 | mkdir -p $out |
|
41 | 59 | mkdir -p $out/nix-support |
42 | 60 | printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs |
43 | 61 |
|
44 | | - install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/lib/libfontmanager.dylib |
45 | | -
|
46 | 62 | # Set JAVA_HOME automatically. |
47 | 63 | cat <<EOF >> $out/nix-support/setup-hook |
48 | 64 | if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi |
|
0 commit comments