summary refs log tree commit diff
path: root/pkgs/development/compilers/jdk
diff options
context:
space:
mode:
authorMartin Bravenboer <martin.bravenboer@logicblox.com>2006-08-31 01:51:41 +0000
committerMartin Bravenboer <martin.bravenboer@logicblox.com>2006-08-31 01:51:41 +0000
commit6bae4d7e4e724ae0932f8660488fdea89ba4a264 (patch)
tree92203e54cb2891091c5f8b9f18597b996f80913a /pkgs/development/compilers/jdk
parente3e3031d697d7ef4580f6ba07c277008fd17661c (diff)
downloadnixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar.gz
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar.bz2
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar.lz
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar.xz
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.tar.zst
nixpkgs-6bae4d7e4e724ae0932f8660488fdea89ba4a264.zip
Prelim. support for JDK on PowerPC using IBM's SDK
svn path=/nixpkgs/trunk/; revision=6405
Diffstat (limited to 'pkgs/development/compilers/jdk')
-rw-r--r--pkgs/development/compilers/jdk/default.nix11
-rw-r--r--pkgs/development/compilers/jdk/ibm-builder.sh39
-rw-r--r--pkgs/development/compilers/jdk/jdk5-ibm-powerpc-linux.nix17
3 files changed, 62 insertions, 5 deletions
diff --git a/pkgs/development/compilers/jdk/default.nix b/pkgs/development/compilers/jdk/default.nix
index 14cf14bd376..824a560d9c5 100644
--- a/pkgs/development/compilers/jdk/default.nix
+++ b/pkgs/development/compilers/jdk/default.nix
@@ -1,7 +1,8 @@
 args:
 
-if args.stdenv.system == "i686-linux"
-  then
-    (import ./jdk5-sun-linux.nix) args
-  else
-    false
+if args.stdenv.system == "i686-linux"  then
+  (import ./jdk5-sun-linux.nix) args
+else if args.stdenv.system == "powerpc-linux"  then
+ (import ./jdk5-ibm-powerpc-linux.nix) args
+else
+  false
diff --git a/pkgs/development/compilers/jdk/ibm-builder.sh b/pkgs/development/compilers/jdk/ibm-builder.sh
new file mode 100644
index 00000000000..2040dde035d
--- /dev/null
+++ b/pkgs/development/compilers/jdk/ibm-builder.sh
@@ -0,0 +1,39 @@
+source $stdenv/setup
+
+if ! test -e "$pathname"; then
+    echo ""
+    echo "SORRY!"
+    echo "You should download \`$(basename $pathname)' from IBM and place it in $(dirname $pathname)."
+    echo "Blame IBM, not us."
+    echo ""
+    exit 1
+fi
+
+actual=$(md5sum -b $pathname | cut -c1-32)
+if test "$actual" != "$md5"; then
+    echo "hash is $actual, expected $md5"
+    exit 1
+fi
+
+tar zxf $pathname || true
+
+ensureDir $out
+mv $dirname/* $out/
+
+# Remove crap in the root directory.
+for file in $out/*
+do
+  if test -f $file ; then
+    rm $file
+  fi
+done
+
+# Set the dynamic linker.
+rpath=
+for i in $libraries; do
+    rpath=$rpath${rpath:+:}$i/lib
+done
+glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
+find $out -type f -perm +100 \
+    -exec patchelf --interpreter $glibc/lib/ld-linux.so.* \
+    --set-rpath "$rpath" {} \;
diff --git a/pkgs/development/compilers/jdk/jdk5-ibm-powerpc-linux.nix b/pkgs/development/compilers/jdk/jdk5-ibm-powerpc-linux.nix
new file mode 100644
index 00000000000..d11034c0dfe
--- /dev/null
+++ b/pkgs/development/compilers/jdk/jdk5-ibm-powerpc-linux.nix
@@ -0,0 +1,17 @@
+{ swingSupport ? true
+, stdenv, fetchurl, unzip, libX11 ? null, libXext ? null
+}:
+
+assert stdenv.system == "powerpc-linux";
+
+assert swingSupport -> libX11 != null && libXext != null;
+
+(stdenv.mkDerivation {
+  name = "jdk-1.5.0";
+  builder = ./ibm-builder.sh;
+  dirname = "ibm-java2-ppc-50";
+  pathname = "/tmp/ibm-java2-sdk-50-linux-ppc.tgz";
+  md5 = "6bed4ae0b24d3eea2914f2f6dcc0ceb4";
+  libraries =
+    (if swingSupport then [libX11 libXext] else []);
+} // {inherit swingSupport;})