1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-24 19:08:30 +00:00
nixpkgs/pkgs/development/compilers/jdk/dlj-bundle-builder.sh
Rob Vermaas 5a3a3a4e17 * Fix JDK/JRE error: /nix/store/.../jre/lib/i386/xawt/libmawt.so: file not recognized: File format not recognized.
Patch provided by Ambrus Kaposi.


svn path=/nixpkgs/trunk/; revision=33439
2012-03-27 11:19:00 +00:00

56 lines
1.2 KiB
Bash

source $stdenv/setup
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
echo "constructing JDK and JRE installations"
if test -z "$installjdk"; then
sh ${construct} . tmp-linux-jdk tmp-linux-jre
mkdir -p $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
jrePath=$out
else
jrePath=$out/jre
fi
rpath=$rpath${rpath:+:}$jrePath/lib/$architecture/jli
# set all the dynamic linkers
find $out -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
if test -z "$pluginSupport"; then
rm -f $out/bin/javaws
fi
mkdir $jrePath/lib/$architecture/plugins
ln -s $jrePath/lib/$architecture/libnpjp2.so $jrePath/lib/$architecture/plugins