nixpkgs/pkgs/development/interpreters/jre/builder.sh
Eelco Dolstra e17d20b6d2 * Purify the JRE.
svn path=/nixpkgs/trunk/; revision=7936
2007-02-20 17:04:37 +00:00

34 lines
662 B
Bash

source $stdenv/setup
unzip $src || true
ensureDir $out
echo "Moving sources to the right location"
mv $version/* $out/
echo "Removing files at top level"
for file in $out/*
do
if test -f $file ; then
rm $file
fi
done
rm -rf $out/docs
# Set the dynamic linker.
rpath=
for i in $libraries; do
rpath=$rpath${rpath:+:}$i/lib
done
find $out -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
# 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