(darwin) openjdk8: 8.0.202 -> 8.0.292

Also adds aarch64-darwin support

(cherry picked from commit 00090e0fa4)
Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
Andrew Childs 2021-05-27 17:13:36 +09:00 committed by Domen Kožar
parent 58240d3c21
commit 1629efe286
No known key found for this signature in database
GPG Key ID: C2FFBCAFD2C24246

View File

@ -1,25 +1,43 @@
{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
{ lib, stdenv, fetchurl, unzip, setJavaClassPath }:
let
# Details from https://www.azul.com/downloads/?version=java-8-lts&os=macos&package=jdk
# Note that the latest build may differ by platform
dist = {
x86_64-darwin = {
arch = "x64";
zuluVersion = "8.54.0.21";
jdkVersion = "8.0.292";
sha256 = "1pgl0bir4r5v349gkxk54k6v62w241q7vw4gjxhv2g6pfq6hv7in";
};
aarch64-darwin = {
arch = "aarch64";
zuluVersion = "8.54.0.21";
jdkVersion = "8.0.292";
sha256 = "05w89wfjlfbpqfjnv6wisxmaf13qb28b2223f9264jyx30qszw1c";
};
}."${stdenv.hostPlatform.system}";
jce-policies = fetchurl {
# Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip";
sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0";
};
jdk = stdenv.mkDerivation {
jdk = stdenv.mkDerivation rec {
# @hlolli: Later version than 1.8.0_202 throws error when building jvmci.
# dyld: lazy symbol binding failed: Symbol not found: _JVM_BeforeHalt
# Referenced from: ../libjava.dylib Expected in: .../libjvm.dylib
name = "zulu1.8.0_202-8.36.0.1";
pname = "zulu${dist.zuluVersion}-ca-jdk";
version = dist.jdkVersion;
src = fetchurl {
url = "https://cdn.azul.com/zulu/bin/zulu8.36.0.1-ca-jdk8.0.202-macosx_x64.zip";
sha256 = "0s92l1wlf02vjx8dvrsla2kq7qwxnmgh325b38mgqy872016jm9p";
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-linux/";
url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz";
inherit (dist) sha256;
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/";
};
nativeBuildInputs = [ unzip ];
buildInputs = [ freetype ];
installPhase = ''
mkdir -p $out
@ -44,8 +62,6 @@ let
mkdir -p $out/nix-support
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi