zulu8: add support for GTK+ Look and Feel
This commit is contained in:
parent
6e3d7fbb7c
commit
20b4ec5151
|
@ -1,7 +1,24 @@
|
||||||
{ stdenv, lib, fetchurl, unzip, makeWrapper, setJavaClassPath
|
{ stdenv
|
||||||
, zulu, glib, libxml2, ffmpeg_3, libxslt, libGL, alsaLib
|
, lib
|
||||||
, fontconfig, freetype, pango, gtk2, cairo, gdk-pixbuf, atk, xorg
|
, fetchurl
|
||||||
, swingSupport ? true }:
|
, autoPatchelfHook
|
||||||
|
, unzip
|
||||||
|
, makeWrapper
|
||||||
|
, setJavaClassPath
|
||||||
|
, zulu
|
||||||
|
# minimum dependencies
|
||||||
|
, alsaLib
|
||||||
|
, fontconfig
|
||||||
|
, freetype
|
||||||
|
, xorg
|
||||||
|
# runtime dependencies
|
||||||
|
, cups
|
||||||
|
# runtime dependencies for GTK+ Look and Feel
|
||||||
|
, gtkSupport ? stdenv.isLinux
|
||||||
|
, cairo
|
||||||
|
, glib
|
||||||
|
, gtk3
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "8.48.0.53";
|
version = "8.48.0.53";
|
||||||
|
@ -14,14 +31,12 @@ let
|
||||||
hash = if stdenv.isDarwin then sha256_darwin else sha256_linux;
|
hash = if stdenv.isDarwin then sha256_darwin else sha256_linux;
|
||||||
extension = if stdenv.isDarwin then "zip" else "tar.gz";
|
extension = if stdenv.isDarwin then "zip" else "tar.gz";
|
||||||
|
|
||||||
libraries = [
|
runtimeDependencies = [
|
||||||
stdenv.cc.libc glib libxml2 ffmpeg_3 libxslt libGL
|
cups
|
||||||
xorg.libXxf86vm alsaLib fontconfig freetype pango
|
] ++ lib.optionals gtkSupport [
|
||||||
gtk2 cairo gdk-pixbuf atk
|
cairo glib gtk3
|
||||||
] ++ (lib.optionals swingSupport (with xorg; [
|
];
|
||||||
xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp
|
runtimeLibraryPath = lib.makeLibraryPath runtimeDependencies;
|
||||||
xorg.libXt xorg.libXrender stdenv.cc.cc
|
|
||||||
]));
|
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
inherit version openjdk platform hash extension;
|
inherit version openjdk platform hash extension;
|
||||||
|
@ -33,26 +48,28 @@ in stdenv.mkDerivation {
|
||||||
sha256 = hash;
|
sha256 = hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin unzip;
|
buildInputs = lib.optionals stdenv.isLinux [
|
||||||
|
alsaLib # libasound.so wanted by lib/libjsound.so
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
stdenv.cc.cc # libstdc++.so.6
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXext
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libXrender
|
||||||
|
xorg.libXtst
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
autoPatchelfHook makeWrapper
|
||||||
|
] ++ lib.optionals stdenv.isDarwin [
|
||||||
|
unzip
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -r ./* "$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
|
mkdir -p $out/nix-support
|
||||||
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
|
||||||
|
|
||||||
|
@ -60,9 +77,19 @@ in stdenv.mkDerivation {
|
||||||
cat <<EOF >> $out/nix-support/setup-hook
|
cat <<EOF >> $out/nix-support/setup-hook
|
||||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
||||||
EOF
|
EOF
|
||||||
|
'' + lib.optionalString stdenv.isLinux ''
|
||||||
|
# We cannot use -exec since wrapProgram is a function but not a command.
|
||||||
|
for bin in $( find "$out" -executable -type f ); do
|
||||||
|
if patchelf --print-interpreter "$bin" &> /dev/null; then
|
||||||
|
wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
rpath = lib.strings.makeLibraryPath libraries;
|
preFixup = ''
|
||||||
|
find "$out" -name libfontmanager.so -exec \
|
||||||
|
patchelf --add-needed libfontconfig.so {} \;
|
||||||
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
home = zulu;
|
home = zulu;
|
||||||
|
|
Loading…
Reference in New Issue