openjdk: add zulu javaFX java package on darwin

This commit is contained in:
Thibault Gagnaux 2021-11-24 17:45:06 +01:00
parent 5e4685f943
commit 2c62693eba
No known key found for this signature in database
GPG key ID: 44BD0764ACAE8E25

View file

@ -1,4 +1,10 @@
{ lib, stdenv, fetchurl, unzip, setJavaClassPath }: { lib
, stdenv
, fetchurl
, unzip
, setJavaClassPath
, enableJavaFX ? false
}:
let let
# Details from https://www.azul.com/downloads/?version=java-16-sts&os=macos&package=jdk # Details from https://www.azul.com/downloads/?version=java-16-sts&os=macos&package=jdk
# Note that the latest build may differ by platform # Note that the latest build may differ by platform
@ -7,14 +13,18 @@ let
arch = "x64"; arch = "x64";
zuluVersion = "16.30.15"; zuluVersion = "16.30.15";
jdkVersion = "16.0.1"; jdkVersion = "16.0.1";
sha256 = "1jihn125dmxr9y5h9jq89zywm3z6rbwv5q7msfzsf2wzrr13jh0z"; sha256 =
if enableJavaFX then "cbb3b96d80a0675893f21dc51ba3f532049c501bd7dc4c8d1ee930e63032c745"
else "1jihn125dmxr9y5h9jq89zywm3z6rbwv5q7msfzsf2wzrr13jh0z";
}; };
aarch64-darwin = { aarch64-darwin = {
arch = "aarch64"; arch = "aarch64";
zuluVersion = "16.30.19"; zuluVersion = "16.30.19";
jdkVersion = "16.0.1"; jdkVersion = "16.0.1";
sha256 = "1i0bcjx3acb5dhslf6cabdcnd6mrz9728vxw9hb4al5y3f5fll4w"; sha256 =
if enableJavaFX then "a49b23abfd83784d2ac935fc24e25ab7cb09b8ffc8e47c32ed446e05b8a21396"
else "1i0bcjx3acb5dhslf6cabdcnd6mrz9728vxw9hb4al5y3f5fll4w";
}; };
}."${stdenv.hostPlatform.system}"; }."${stdenv.hostPlatform.system}";
@ -24,12 +34,14 @@ let
sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0"; sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0";
}; };
javaPackage = if enableJavaFX then "ca-fx-jdk" else "ca-jdk";
jdk = stdenv.mkDerivation rec { jdk = stdenv.mkDerivation rec {
pname = "zulu${dist.zuluVersion}-ca-jdk"; pname = "zulu${dist.zuluVersion}-${javaPackage}";
version = dist.jdkVersion; version = dist.jdkVersion;
src = fetchurl { src = fetchurl {
url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-ca-jdk${dist.jdkVersion}-macosx_${dist.arch}.tar.gz"; url = "https://cdn.azul.com/zulu/bin/zulu${dist.zuluVersion}-${javaPackage}${dist.jdkVersion}-macosx_${dist.arch}.tar.gz";
inherit (dist) sha256; inherit (dist) sha256;
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/"; curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/";
}; };
@ -77,4 +89,5 @@ let
meta = import ./meta.nix lib; meta = import ./meta.nix lib;
}; };
in jdk in
jdk