nixpkgs/pkgs/development/compilers/jdk/dlj-bundle-builder.sh
Martin Bravenboer fb91f1b319 M pkgs/development/compilers/jdk/jdk6-linux.nix
M    pkgs/development/compilers/jdk/dlj-bundle-builder.sh

Various fixes to get javaws and mozillaPlugin to work. Requires gcc3.3
libstdc++ to be in the dynamic library path.


svn path=/nixpkgs/trunk/; revision=8434
2007-03-27 22:02:55 +00:00

61 lines
1.4 KiB
Bash

source $stdenv/setup
source $makeWrapper
echo "Unpacking distribution"
unzip ${src} || true
# set the dynamic linker of unpack200, necessary for construct script
echo "patching unpack200"
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" --set-rpath "" */bin/unpack200 || fail
echo "constructing JDK and JRE installations"
if test -z "$installjdk"; then
sh ${construct} . tmp-linux-jdk tmp-linux-jre
ensureDir $out
cp -R tmp-linux-jre/* $out
else
sh ${construct} . $out tmp-linux-jre
fi
echo "removing files at top level of installation"
for file in $out/*
do
if test -f $file ; then
rm $file
fi
done
rm -rf $out/docs
# construct the rpath
rpath=
for i in $libraries; do
rpath=$rpath${rpath:+:}$i/lib
done
if test -z "$installjdk"; then
rpath=$rpath${rpath:+:}$out/lib/$architecture/jli
else
rpath=$rpath${rpath:+:}$out/jre/lib/$architecture/jli
fi
# set all the dynamic linkers
find $out -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
mv $out/bin/javaws $out/bin/javaws.bin
makeWrapper "$out/bin/javaws.bin" "$out/bin/javaws" \
--suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
function mozillaExtraLibPath() {
p=$1
if test -e "$p"; then
echo "$libstdcpp5/lib" > $p/extra-library-path
fi
}
mozillaExtraLibPath "$out/jre/plugin/i386/ns7"
mozillaExtraLibPath "$out/plugin/i386/ns7"