summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorMartin Bravenboer <martin.bravenboer@logicblox.com>2004-01-24 23:46:00 +0000
committerMartin Bravenboer <martin.bravenboer@logicblox.com>2004-01-24 23:46:00 +0000
commit067726f3e2db4286b300a67d1f338e5c72e9f986 (patch)
tree3980f9df6f584df20ba4c444f8e16947c787d5e8 /pkgs/development
parent02a4d8ece5d153b0a92b869eaab921c1e21c08da (diff)
* 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
Diffstat (limited to 'pkgs/development')
-rwxr-xr-xpkgs/development/compilers/j2sdk/builder.sh22
-rw-r--r--pkgs/development/compilers/j2sdk/default.nix10
-rw-r--r--pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix22
-rw-r--r--pkgs/development/interpreters/j2re/j2re-sun-linux.nix2
4 files changed, 55 insertions, 1 deletions
diff --git a/pkgs/development/compilers/j2sdk/builder.sh b/pkgs/development/compilers/j2sdk/builder.sh
new file mode 100755
index 0000000000000..3cf67f8f4ceed
--- /dev/null
+++ b/pkgs/development/compilers/j2sdk/builder.sh
@@ -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
diff --git a/pkgs/development/compilers/j2sdk/default.nix b/pkgs/development/compilers/j2sdk/default.nix
new file mode 100644
index 0000000000000..91b60e7fa2872
--- /dev/null
+++ b/pkgs/development/compilers/j2sdk/default.nix
@@ -0,0 +1,10 @@
+{stdenv, fetchurl}: 
+
+if stdenv.system == "i686-linux"
+  then
+    (import ./j2sdk-sun-linux.nix) {
+      stdenv   = stdenv;
+      fetchurl = fetchurl;
+    }
+  else
+    false
diff --git a/pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix b/pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix
new file mode 100644
index 0000000000000..e3b9c46dfda6f
--- /dev/null
+++ b/pkgs/development/compilers/j2sdk/j2sdk-sun-linux.nix
@@ -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;
+}
diff --git a/pkgs/development/interpreters/j2re/j2re-sun-linux.nix b/pkgs/development/interpreters/j2re/j2re-sun-linux.nix
index f5673950dba5f..9958bb85c13b8 100644
--- a/pkgs/development/interpreters/j2re/j2re-sun-linux.nix
+++ b/pkgs/development/interpreters/j2re/j2re-sun-linux.nix
@@ -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;