* 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:
parent
073ad0c8fc
commit
881f4b0db1
4 changed files with 28 additions and 20 deletions
33
pkgs/development/compilers/jdk/builder.sh
Executable file → Normal file
33
pkgs/development/compilers/jdk/builder.sh
Executable file → Normal file
|
@ -1,29 +1,38 @@
|
|||
#!/bin/sh
|
||||
source $stdenv/setup
|
||||
|
||||
. $stdenv/setup || exit 1
|
||||
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
|
||||
echo "hash is $actual, expected $md5"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chmod u+x $src || exit 1
|
||||
unzip $pathname || true
|
||||
|
||||
alias more=cat
|
||||
ensureDir $out
|
||||
mv $dirname/* $out/
|
||||
|
||||
yes yes | ./$src || exit 1
|
||||
|
||||
mkdir $out || exit 1
|
||||
mv $dirname/* $out/ || exit 1
|
||||
|
||||
# remove crap in the root directory
|
||||
# Remove crap in the root directory.
|
||||
for file in $out/*
|
||||
do
|
||||
if test -f $file ; then
|
||||
rm $file
|
||||
fi
|
||||
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
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{stdenv, fetchurl}:
|
||||
{stdenv, fetchurl, unzip}:
|
||||
|
||||
if stdenv.system == "i686-linux"
|
||||
then
|
||||
(import ./jdk5-sun-linux.nix) {
|
||||
inherit stdenv fetchurl;
|
||||
inherit stdenv fetchurl unzip;
|
||||
}
|
||||
else
|
||||
false
|
||||
|
|
|
@ -8,17 +8,16 @@
|
|||
*
|
||||
* @author Martin Bravenboer <martin@cs.uu.nl>
|
||||
*/
|
||||
{stdenv, fetchurl}:
|
||||
{stdenv, fetchurl, unzip}:
|
||||
|
||||
assert stdenv.system == "i686-linux";
|
||||
|
||||
derivation {
|
||||
stdenv.mkDerivation {
|
||||
name = "jdk-1.5.0";
|
||||
builder = ./builder.sh;
|
||||
filename = "jdk-1_5_0_05";
|
||||
dirname = "jdk1.5.0_05";
|
||||
system = stdenv.system;
|
||||
builder = ./builder.sh;
|
||||
pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin";
|
||||
md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3";
|
||||
stdenv = stdenv;
|
||||
buildInputs = [unzip];
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ rec {
|
|||
"/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home"
|
||||
else
|
||||
(import ../development/compilers/jdk) {
|
||||
inherit fetchurl stdenv;
|
||||
inherit fetchurl stdenv unzip;
|
||||
};
|
||||
|
||||
j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) {
|
||||
|
|
Loading…
Reference in a new issue