* Use unzip to unpack the JDK. Then unpack the *.pack files. The

advantage is that we don't have to run the Sun installer (which is
  impure).

  TODO: make sure that all the other JDK versions still work.

svn path=/nixpkgs/trunk/; revision=4029
This commit is contained in:
Eelco Dolstra 2005-10-07 14:49:37 +00:00
parent 073ad0c8fc
commit 881f4b0db1
4 changed files with 28 additions and 20 deletions

33
pkgs/development/compilers/jdk/builder.sh Executable file → Normal file
View file

@ -1,29 +1,38 @@
#!/bin/sh source $stdenv/setup
. $stdenv/setup || exit 1
src=$filename.bin src=$filename.bin
cp $pathname $src || exit 1 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
actual=$(md5sum -b $src | cut -c1-32) actual=$(md5sum -b $pathname | cut -c1-32)
if test "$actual" != "$md5"; then if test "$actual" != "$md5"; then
echo "hash is $actual, expected $md5" echo "hash is $actual, expected $md5"
exit 1 exit 1
fi fi
chmod u+x $src || exit 1 unzip $pathname || true
alias more=cat ensureDir $out
mv $dirname/* $out/
yes yes | ./$src || exit 1 # Remove crap in the root directory.
mkdir $out || exit 1
mv $dirname/* $out/ || exit 1
# remove crap in the root directory
for file in $out/* for file in $out/*
do do
if test -f $file ; then if test -f $file ; then
rm $file rm $file
fi fi
done done
# 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

View file

@ -1,9 +1,9 @@
{stdenv, fetchurl}: {stdenv, fetchurl, unzip}:
if stdenv.system == "i686-linux" if stdenv.system == "i686-linux"
then then
(import ./jdk5-sun-linux.nix) { (import ./jdk5-sun-linux.nix) {
inherit stdenv fetchurl; inherit stdenv fetchurl unzip;
} }
else else
false false

View file

@ -8,17 +8,16 @@
* *
* @author Martin Bravenboer <martin@cs.uu.nl> * @author Martin Bravenboer <martin@cs.uu.nl>
*/ */
{stdenv, fetchurl}: {stdenv, fetchurl, unzip}:
assert stdenv.system == "i686-linux"; assert stdenv.system == "i686-linux";
derivation { stdenv.mkDerivation {
name = "jdk-1.5.0"; name = "jdk-1.5.0";
builder = ./builder.sh;
filename = "jdk-1_5_0_05"; filename = "jdk-1_5_0_05";
dirname = "jdk1.5.0_05"; dirname = "jdk1.5.0_05";
system = stdenv.system;
builder = ./builder.sh;
pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin"; pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin";
md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3"; md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3";
stdenv = stdenv; buildInputs = [unzip];
} }

View file

@ -506,7 +506,7 @@ rec {
"/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home" "/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home"
else else
(import ../development/compilers/jdk) { (import ../development/compilers/jdk) {
inherit fetchurl stdenv; inherit fetchurl stdenv unzip;
}; };
j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) { j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) {