From 5d6fdd8abbb576357844701b9cbffed033099128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Thu, 30 Jan 2014 18:22:16 +0100 Subject: [PATCH 1/3] oraclejdk7: add missing dependencies --- pkgs/development/compilers/jdk/jdk7-linux.nix | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/jdk/jdk7-linux.nix b/pkgs/development/compilers/jdk/jdk7-linux.nix index 6e1fec4d18c..fabcb5751bf 100644 --- a/pkgs/development/compilers/jdk/jdk7-linux.nix +++ b/pkgs/development/compilers/jdk/jdk7-linux.nix @@ -6,6 +6,19 @@ , installjdk ? true , pluginSupport ? true , installjce ? false +, glib +, libxml2 +, libav_0_8 +, ffmpeg_0_6 +, libxslt +, mesa_noglu +, freetype +, fontconfig +, gnome +, cairo +, alsaLib +, atk +, gdk_pixbuf }: assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; @@ -87,7 +100,7 @@ stdenv.mkDerivation rec { # construct the rpath rpath= for i in $libraries; do - rpath=$rpath''${rpath:+:}$i/lib + rpath=$rpath''${rpath:+:}$i/lib''${rpath:+:}$i/lib64 done if test -z "$installjdk"; then @@ -102,6 +115,8 @@ stdenv.mkDerivation rec { fi rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/jli + rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/server + rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/xawt rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture} # set all the dynamic linkers @@ -128,8 +143,8 @@ stdenv.mkDerivation rec { * libXt is only needed on amd64 */ libraries = - [stdenv.gcc.libc] ++ - (if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []); + [stdenv.gcc.libc glib libxml2 libav_0_8 ffmpeg_0_6 libxslt mesa_noglu xlibs.libXxf86vm alsaLib fontconfig freetype gnome.pango gnome.gtk cairo atk gdk_pixbuf] ++ + (if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt xlibs.libXrender stdenv.gcc.gcc] else []); passthru.mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins"; From 264dcdddf19f1c36a5a5de44e282c21a143cac98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Thu, 30 Jan 2014 19:40:42 +0100 Subject: [PATCH 2/3] Fixes --- pkgs/development/compilers/jdk/jdk7-linux.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/jdk/jdk7-linux.nix b/pkgs/development/compilers/jdk/jdk7-linux.nix index fabcb5751bf..12c1a598551 100644 --- a/pkgs/development/compilers/jdk/jdk7-linux.nix +++ b/pkgs/development/compilers/jdk/jdk7-linux.nix @@ -143,7 +143,7 @@ stdenv.mkDerivation rec { * libXt is only needed on amd64 */ libraries = - [stdenv.gcc.libc glib libxml2 libav_0_8 ffmpeg_0_6 libxslt mesa_noglu xlibs.libXxf86vm alsaLib fontconfig freetype gnome.pango gnome.gtk cairo atk gdk_pixbuf] ++ + [stdenv.gcc.libc glib libxml2 libav_0_8 ffmpeg_0_6 libxslt mesa_noglu xlibs.libXxf86vm] ++ (if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt xlibs.libXrender stdenv.gcc.gcc] else []); passthru.mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins"; From 303c418035b6f91581e07fb742968a7dd28a8eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Fri, 7 Feb 2014 15:07:12 +0100 Subject: [PATCH 3/3] Workaround for relocation error This works around "java: relocation error: java: symbol , version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference" --- pkgs/development/compilers/jdk/jdk7-linux.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/jdk/jdk7-linux.nix b/pkgs/development/compilers/jdk/jdk7-linux.nix index 12c1a598551..106b9fa02d7 100644 --- a/pkgs/development/compilers/jdk/jdk7-linux.nix +++ b/pkgs/development/compilers/jdk/jdk7-linux.nix @@ -126,6 +126,12 @@ stdenv.mkDerivation rec { find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; + # HACK: For some reason, appending atk to the global patchelf rpath paths causes: + # java: relocation error: java: symbol , version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference + # Because only libglass.so needs atk, we put it only in it's rpath. + # This seems to work fine. + patchelf --set-rpath "$rpath:${atk}/lib" $out/jre/lib/${architecture}/libglass.so + if test -z "$pluginSupport"; then rm -f $out/bin/javaws if test -n "$installjdk"; then @@ -143,7 +149,7 @@ stdenv.mkDerivation rec { * libXt is only needed on amd64 */ libraries = - [stdenv.gcc.libc glib libxml2 libav_0_8 ffmpeg_0_6 libxslt mesa_noglu xlibs.libXxf86vm] ++ + [stdenv.gcc.libc glib libxml2 libav_0_8 ffmpeg_0_6 libxslt mesa_noglu xlibs.libXxf86vm alsaLib fontconfig freetype gnome.pango gnome.gtk cairo gdk_pixbuf] ++ (if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt xlibs.libXrender stdenv.gcc.gcc] else []); passthru.mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins";