1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 08:01:14 +00:00
nixpkgs/pkgs/applications/editors/eclipse/builder.sh
Marc Weber 807aae2fd6 updated eclipse binary to 3.5M6
thereby allowing the user to copy the whole store path to a user
location so that update sites work properly

svn path=/nixpkgs/trunk/; revision=14773
2009-03-30 10:32:53 +00:00

41 lines
1,015 B
Bash
Executable file

source $stdenv/setup
unpackFile $src
ensureDir $out
mv eclipse $out/
# 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" {} \;
# Make a wrapper script so that the proper JDK is found.
# don't use makeWrapper in order to change the last line.
ensureDir $out/bin
cat >> $out/bin/eclipse << EOF
#! /bin/sh -e
export PATH=${jdk}/bin\${PATH:+:}\$PATH
export LD_LIBRARY_PATH=$rpath\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH
exec \$(dirname $0)/../eclipse/eclipse $@
EOF
chmod +x $out/bin/eclipse
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