* 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:
parent
02a4d8ece5
commit
067726f3e2
13
pkgs/build-support/fetchfile/builder.sh
Executable file
13
pkgs/build-support/fetchfile/builder.sh
Executable 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
|
9
pkgs/build-support/fetchfile/default.nix
Normal file
9
pkgs/build-support/fetchfile/default.nix
Normal 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;
|
||||||
|
}
|
22
pkgs/development/compilers/j2sdk/builder.sh
Executable file
22
pkgs/development/compilers/j2sdk/builder.sh
Executable 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
|
10
pkgs/development/compilers/j2sdk/default.nix
Normal file
10
pkgs/development/compilers/j2sdk/default.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{stdenv, fetchurl}:
|
||||||
|
|
||||||
|
if stdenv.system == "i686-linux"
|
||||||
|
then
|
||||||
|
(import ./j2sdk-sun-linux.nix) {
|
||||||
|
stdenv = stdenv;
|
||||||
|
fetchurl = fetchurl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
false
|
22
pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix
Normal file
22
pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix
Normal 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;
|
||||||
|
}
|
@ -8,7 +8,7 @@ derivation {
|
|||||||
system = stdenv.system;
|
system = stdenv.system;
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
src = fetchurl {
|
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";
|
md5 = "b4aae3fcda73d976bd6ae6349b36a90c";
|
||||||
};
|
};
|
||||||
stdenv = stdenv;
|
stdenv = stdenv;
|
||||||
|
@ -235,6 +235,11 @@
|
|||||||
stdenv = stdenv;
|
stdenv = stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
j2sdk = (import ../development/compilers/j2sdk) {
|
||||||
|
fetchurl = fetchurl;
|
||||||
|
stdenv = stdenv;
|
||||||
|
};
|
||||||
|
|
||||||
pcre = (import ../development/libraries/pcre) {
|
pcre = (import ../development/libraries/pcre) {
|
||||||
fetchurl = fetchurl;
|
fetchurl = fetchurl;
|
||||||
stdenv = stdenv;
|
stdenv = stdenv;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user