* Added the j2sdk of Sun for Linux. Downloading this thing is

a big problem, so I decided to require to user to get the
          file and put it in some location in the file system. wget
          doesn't seem to accept the file scheme however, so I had to
          move the copying into the builder itself. The builder checks
          the md5 hash of the downloaded file. Maybe having a separate
          'fetchfile' would be useful to make a file in the outside
          world pure. I tried to add this to build-support, but this
          obviously did not work. I still committed it. Just remove it
          if you think that it sucks.

svn path=/nixpkgs/trunk/; revision=716
This commit is contained in:
Martin Bravenboer 2004-01-24 23:46:00 +00:00
parent 02a4d8ece5
commit 067726f3e2
7 changed files with 82 additions and 1 deletions

View file

@ -0,0 +1,13 @@
#! /bin/sh
. $stdenv/setup
echo "copying $url into $out..."
cp "$pathname" "$out" || exit 1
actual=$(md5sum -b $out | cut -c1-32)
if test "$actual" != "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
fi

View file

@ -0,0 +1,9 @@
{stdenv}: {pathname, md5}: derivation {
name = baseNameOf (toString url);
system = stdenv.system;
builder = ./builder.sh;
stdenv = stdenv;
pathname = pathname;
md5 = md5;
id = md5;
}

View file

@ -0,0 +1,22 @@
#!/bin/sh
. $stdenv/setup || exit 1
version=j2sdk1.4.2_03
src=$version.bin
cp $pathname $src || exit 1
actual=$(md5sum -b $src | cut -c1-32)
if test "$actual" != "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
fi
chmod u+x $src || exit 1
alias more=cat
yes yes | ./$src || exit 1
mkdir $out || exit 1
mv $version/* $out/ || exit 1

View file

@ -0,0 +1,10 @@
{stdenv, fetchurl}:
if stdenv.system == "i686-linux"
then
(import ./j2sdk-sun-linux.nix) {
stdenv = stdenv;
fetchurl = fetchurl;
}
else
false

View file

@ -0,0 +1,22 @@
/**
* This Nix expression requires the user to download the j2sdk
* distribution to /tmp. Please obtain j2sdk-1_4_2_03-linux-i586.bin
* from java.sun.com by hand and place it in /tmp. Blame Sun, not me.
*
* Note that this is not necessary if someone has already pushed a
* binary.
*
* @author Martin Bravenboer <martin@cs.uu.nl>
*/
{stdenv, fetchurl}:
assert stdenv.system == "i686-linux";
derivation {
name = "j2sdk-1.4.2";
system = stdenv.system;
builder = ./builder.sh;
pathname = /tmp/j2sdk-1_4_2_03-linux-i586.bin;
md5 = "859aa6750161477acec83b7bb5d9998d";
stdenv = stdenv;
}

View file

@ -8,7 +8,7 @@ derivation {
system = stdenv.system;
builder = ./builder.sh;
src = fetchurl {
url = http://www.java.sun.com/webapps/download/AutoDL?BundleId=9500;
url = http://java.sun.com/webapps/download/AutoDL?BundleId=9500;
md5 = "b4aae3fcda73d976bd6ae6349b36a90c";
};
stdenv = stdenv;

View file

@ -235,6 +235,11 @@
stdenv = stdenv;
};
j2sdk = (import ../development/compilers/j2sdk) {
fetchurl = fetchurl;
stdenv = stdenv;
};
pcre = (import ../development/libraries/pcre) {
fetchurl = fetchurl;
stdenv = stdenv;