2017-09-21 23:56:54 +01:00
|
|
|
{ stdenv, lib, fetchurl, unzip, makeWrapper, setJavaClassPath
|
2018-02-24 12:06:44 +00:00
|
|
|
, zulu, glib, libxml2, libav_0_8, ffmpeg, libxslt, libGL, alsaLib
|
2019-05-22 12:03:39 +01:00
|
|
|
, fontconfig, freetype, gnome2, cairo, gdk-pixbuf, atk, xorg
|
2017-09-21 23:56:54 +01:00
|
|
|
, swingSupport ? true }:
|
|
|
|
|
|
|
|
let
|
2018-04-07 16:34:47 +01:00
|
|
|
version = "8.28.0.1";
|
|
|
|
openjdk = "8.0.163";
|
2017-09-21 23:56:54 +01:00
|
|
|
|
2018-04-07 16:34:47 +01:00
|
|
|
sha256_linux = "1z8s3a948nvv92wybnhkyr27ipibcy45k0zv5h5gp37ynd91df45";
|
|
|
|
sha256_darwin = "0i0prjijsgg0yyycplpp9rlfl428126rqz7bb31pchrhi6jhk699";
|
2017-09-21 23:56:54 +01:00
|
|
|
|
|
|
|
platform = if stdenv.isDarwin then "macosx" else "linux";
|
|
|
|
hash = if stdenv.isDarwin then sha256_darwin else sha256_linux;
|
|
|
|
extension = if stdenv.isDarwin then "zip" else "tar.gz";
|
|
|
|
|
|
|
|
libraries = [
|
2018-02-24 12:06:44 +00:00
|
|
|
stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL
|
2017-09-21 23:56:54 +01:00
|
|
|
xorg.libXxf86vm alsaLib fontconfig freetype gnome2.pango
|
2019-05-22 12:03:39 +01:00
|
|
|
gnome2.gtk cairo gdk-pixbuf atk
|
2017-09-21 23:56:54 +01:00
|
|
|
] ++ (lib.optionals swingSupport (with xorg; [
|
|
|
|
xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp
|
|
|
|
xorg.libXt xorg.libXrender stdenv.cc.cc
|
|
|
|
]));
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2017-09-21 23:56:54 +01:00
|
|
|
inherit version openjdk platform hash extension;
|
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zulu";
|
2017-09-21 23:56:54 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://cdn.azul.com/zulu/bin/zulu${version}-jdk${openjdk}-${platform}_x64.${extension}";
|
|
|
|
sha256 = hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin unzip;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r ./* "$out/"
|
|
|
|
|
|
|
|
jrePath="$out/jre"
|
|
|
|
|
|
|
|
rpath=$rpath''${rpath:+:}$jrePath/lib/amd64/jli
|
|
|
|
rpath=$rpath''${rpath:+:}$jrePath/lib/amd64/server
|
|
|
|
rpath=$rpath''${rpath:+:}$jrePath/lib/amd64/xawt
|
|
|
|
rpath=$rpath''${rpath:+:}$jrePath/lib/amd64
|
|
|
|
|
|
|
|
# set all the dynamic linkers
|
|
|
|
find $out -type f -perm -0100 \
|
|
|
|
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "$rpath" {} \;
|
|
|
|
|
|
|
|
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
|
|
|
|
|
|
|
|
mkdir -p $out/nix-support
|
2017-11-17 18:26:21 +00:00
|
|
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
2017-09-21 23:56:54 +01:00
|
|
|
|
|
|
|
# Set JAVA_HOME automatically.
|
|
|
|
cat <<EOF >> $out/nix-support/setup-hook
|
2019-11-01 19:30:09 +00:00
|
|
|
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
2017-09-21 23:56:54 +01:00
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
rpath = stdenv.lib.strings.makeLibraryPath libraries;
|
|
|
|
|
|
|
|
passthru = {
|
2019-09-09 00:38:31 +01:00
|
|
|
home = zulu;
|
2017-09-21 23:56:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.azul.com/products/zulu/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
description = "Certified builds of OpenJDK";
|
|
|
|
longDescription = ''
|
|
|
|
Certified builds of OpenJDK that can be deployed across multiple
|
|
|
|
operating systems, containers, hypervisors and Cloud platforms.
|
|
|
|
'';
|
|
|
|
maintainers = with maintainers; [ nequissimus fpletz ];
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
};
|
|
|
|
}
|