2008-01-23 19:11:03 +01:00
|
|
|
buildInputs="$unzip"
|
2005-10-07 16:49:37 +02:00
|
|
|
source $stdenv/setup
|
2004-01-25 00:46:00 +01:00
|
|
|
|
2004-05-12 17:06:23 +02:00
|
|
|
src=$filename.bin
|
2004-01-25 00:46:00 +01:00
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
if ! test -e "$pathname"; then
|
|
|
|
echo ""
|
|
|
|
echo "SORRY!"
|
|
|
|
echo "You should download \`$(basename $pathname)' from Sun and place it in $(dirname $pathname)."
|
|
|
|
echo "Blame Sun, not us."
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
fi
|
2004-01-25 00:46:00 +01:00
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
actual=$(md5sum -b $pathname | cut -c1-32)
|
2004-01-25 00:46:00 +01:00
|
|
|
if test "$actual" != "$md5"; then
|
|
|
|
echo "hash is $actual, expected $md5"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
unzip $pathname || true
|
2004-01-25 00:46:00 +01:00
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
ensureDir $out
|
|
|
|
mv $dirname/* $out/
|
2004-01-25 00:46:00 +01:00
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
# Remove crap in the root directory.
|
2004-08-20 13:08:08 +02:00
|
|
|
for file in $out/*
|
|
|
|
do
|
|
|
|
if test -f $file ; then
|
|
|
|
rm $file
|
|
|
|
fi
|
|
|
|
done
|
2005-10-07 16:49:37 +02:00
|
|
|
|
2005-10-08 00:27:42 +02:00
|
|
|
# Set the dynamic linker.
|
|
|
|
rpath=
|
|
|
|
for i in $libraries; do
|
|
|
|
rpath=$rpath${rpath:+:}$i/lib
|
|
|
|
done
|
|
|
|
find $out -type f -perm +100 \
|
2006-10-27 14:43:32 +02:00
|
|
|
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
2005-10-08 00:27:42 +02:00
|
|
|
--set-rpath "$rpath" {} \;
|
|
|
|
|
2005-10-07 16:49:37 +02:00
|
|
|
# Unpack .pack files.
|
|
|
|
for i in $(find $out -name "*.pack"); do
|
|
|
|
echo "unpacking $i..."
|
|
|
|
$out/bin/unpack200 "$i" "$(dirname $i)/$(basename $i .pack).jar"
|
|
|
|
rm "$i"
|
|
|
|
done
|
2005-12-26 01:51:24 +01:00
|
|
|
|
|
|
|
# Put the *_md.h files in the right place.
|
|
|
|
cd $out/include && ln -s */*_md.h .
|