summary refs log tree commit diff
path: root/pkgs/development/libraries/wtk
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/wtk')
-rw-r--r--pkgs/development/libraries/wtk/builder.sh42
-rw-r--r--pkgs/development/libraries/wtk/default.nix22
2 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/libraries/wtk/builder.sh b/pkgs/development/libraries/wtk/builder.sh
new file mode 100644
index 0000000000000..bf65b96c7cacc
--- /dev/null
+++ b/pkgs/development/libraries/wtk/builder.sh
@@ -0,0 +1,42 @@
+source $stdenv/setup
+
+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 $pathname | cut -c1-32)
+if test "$actual" != "$md5"; then
+    echo "hash is $actual, expected $md5"
+    exit 1
+fi
+
+mkdir unzipped
+pushd unzipped
+unzip $pathname || true
+popd
+
+ensureDir $out
+mv unzipped/* $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
+find $out -type f -perm +100 \
+    -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" {} \;
+find $out -type f -perm +100 \
+    -exec patchelf --set-rpath "$rpath" {} \;
diff --git a/pkgs/development/libraries/wtk/default.nix b/pkgs/development/libraries/wtk/default.nix
new file mode 100644
index 0000000000000..123d0a9216a13
--- /dev/null
+++ b/pkgs/development/libraries/wtk/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, unzip, xlibs }:
+
+assert stdenv.system == "i686-linux";
+
+stdenv.mkDerivation {
+  name = "sun-java-wtk-2.5.2_01";
+
+  pathname = "/tmp/sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh";
+  md5 = "6b70b6e6d426eac121db8a087991589f";
+
+  builder = ./builder.sh;
+
+  buildInputs = [ unzip ];
+
+  libraries = [ xlibs.libXpm xlibs.libXt xlibs.libX11 xlibs.libICE xlibs.libSM stdenv.gcc.gcc ];
+
+  meta = {
+    homepage = http://java.sun.com/products/sjwtoolkit/download.html;
+    description = "Sun Java Wireless Toolkit 2.5.2_01 for CLDC";
+    license = "unfree";
+  };
+}