@@ -0,0 +1,43 @@
1+{ stdenv, fetchurl, unzip, setJavaClassPath }:
2+let
3+ jdk = stdenv.mkDerivation {
4+ name = "zulu1.8.0_66-8.11.0.1";
5+
6+ src = fetchurl {
7+ url = http://cdn.azulsystems.com/zulu/bin/zulu1.8.0_66-8.11.0.1-macosx.zip;
8+ sha256 = "0pvbpb3vf0509xm2x1rh0p0w4wmx50zf15604p28z1k8ai1a23sz";
9+ curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-linux/";
10+ };
11+
12+ buildInputs = [ unzip ];
13+
14+ installPhase = ''
15+ mkdir -p $out
16+ mv * $out
17+
18+ # jni.h expects jni_md.h to be in the header search path.
19+ ln -s $out/include/darwin/*_md.h $out/include/
20+ '';
21+
22+ preFixup = ''
23+ # Propagate the setJavaClassPath setup hook from the JRE so that
24+ # any package that depends on the JRE has $CLASSPATH set up
25+ # properly.
26+ mkdir -p $out/nix-support
27+ echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs
28+
29+ # Set JAVA_HOME automatically.
30+ cat <<EOF >> $out/nix-support/setup-hook
31+ if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
32+ EOF
33+ '';
34+
35+ passthru = {
36+ jre = jdk;
37+ home = jdk;
38+ };
39+
40+ meta.platforms = stdenv.lib.platforms.darwin;
41+
42+ };
43+in jdk