diff --git a/pkgs/applications/editors/eclipse/builder.sh b/pkgs/applications/editors/eclipse/builder.sh index b703b3bc5ad..330263b4658 100755 --- a/pkgs/applications/editors/eclipse/builder.sh +++ b/pkgs/applications/editors/eclipse/builder.sh @@ -5,4 +5,29 @@ unpackFile $src ensureDir $out mv eclipse $out/ -makeWrapper $out/eclipse/eclipse $out/bin/eclipse +# Unpack the jars that contain .so files. +#echo "unpacking some jars..." +#for i in $(find $out -name "*.linux*.jar"); do +# echo $i +# cd $(dirname $i) && $jdk/bin/jar -x < $i +# rm $i +#done + +# Set the dynamic linker and RPATH. +rpath= +for i in $libraries; do + rpath=$rpath${rpath:+:}$i/lib +done +glibc=$(cat $NIX_GCC/nix-support/orig-glibc) +find $out \( -type f -a -perm +0100 \) \ + -print \ + -exec patchelf --interpreter $glibc/lib/ld-linux.so.* \ + --set-rpath "$rpath" {} \; +#find $out \( -type f -a -name "*.so*" \) \ +# -print \ +# -exec patchelf --set-rpath "$rpath" {} \; + +# Make a wrapper script so that the proper JDK is found. +makeWrapper $out/eclipse/eclipse $out/bin/eclipse \ + --prefix PATH ":" "$jdk/bin" \ + --prefix LD_LIBRARY_PATH ":" "$rpath" diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 13e04cd965c..2abe04bce75 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -1,4 +1,4 @@ -{fetchurl, stdenv, makeWrapper}: +{fetchurl, stdenv, makeWrapper, patchelf, jdk, gtk, glib, libXtst}: let { body = @@ -6,7 +6,9 @@ let { name = "eclipse-sdk-3.1"; builder = ./builder.sh; src = bindist; - inherit makeWrapper; + inherit makeWrapper jdk; + buildInputs = [patchelf]; + libraries = [gtk glib libXtst]; }; bindist = diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 7fa7da7436f..20901e68596 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -1580,7 +1580,10 @@ rec { }; eclipse = (import ../applications/editors/eclipse) { - inherit fetchurl stdenv makeWrapper; + inherit fetchurl stdenv makeWrapper jdk; + inherit (gtkLibs) gtk glib; + inherit (xlibs) libXtst; + patchelf = patchelfNew; }; monodevelop = (import ../applications/editors/monodevelop) {