nixpkgs/pkgs/applications/editors/eclipse/builder.sh
Eelco Dolstra b90781ec21 * Renamed orig-glibc -> orig-libc in some places, and in others, use
the new $NIX_GCC/nix-support/dynamic-linker file to locate the
  dynamic linker directly (don't hardcode ld-linux.so.2).

svn path=/nixpkgs/trunk/; revision=6873
2006-10-27 12:43:32 +00:00

46 lines
1.1 KiB
Bash
Executable file

source $stdenv/setup
source $makeWrapper
unpackFile $src
ensureDir $out
mv eclipse $out/
# 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
find $out \( -type f -a -perm +0100 \) \
-print \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--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"
ensureDir plugin-working-dir
workingdir="$(pwd)/plugin-working-dir"
for plugin in $plugins; do
if test -e $plugin/install; then
cd $workingdir
$plugin/install "$out/eclipse"
rm -rf $workingdir/*
else
# assume that it is a file
cp $plugin $out/eclipse/plugins
fi
done