about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/wtk
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/wtk')
-rw-r--r--nixpkgs/pkgs/development/libraries/wtk/builder.sh27
-rw-r--r--nixpkgs/pkgs/development/libraries/wtk/default.nix26
2 files changed, 53 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/wtk/builder.sh b/nixpkgs/pkgs/development/libraries/wtk/builder.sh
new file mode 100644
index 000000000000..86f2719537cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wtk/builder.sh
@@ -0,0 +1,27 @@
+source $stdenv/setup
+
+mkdir unzipped
+pushd unzipped
+unzip $src || true
+popd
+
+mkdir -p $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 -0100 \
+    -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
+find $out -type f -perm -0100 \
+    -exec patchelf --set-rpath "$rpath" {} \;
diff --git a/nixpkgs/pkgs/development/libraries/wtk/default.nix b/nixpkgs/pkgs/development/libraries/wtk/default.nix
new file mode 100644
index 000000000000..94dea0edae1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wtk/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, requireFile, unzip, xorg }:
+
+assert stdenv.hostPlatform.system == "i686-linux";
+
+stdenv.mkDerivation rec {
+  pname = "sun-java-wtk";
+  version = "2.5.2_01";
+
+  src = requireFile {
+    url = "http://java.sun.com/products/sjwtoolkit/download.html";
+    name = "sun_java_wireless_toolkit-${version}-linuxi486.bin.sh";
+    sha256 = "1cjb9c27847wv0hq3j645ckn4di4vsfvp29fr4zmdqsnvk4ahvj1";
+  };
+
+  builder = ./builder.sh;
+
+  nativeBuildInputs = [ unzip ];
+
+  libraries = [ xorg.libXpm xorg.libXt xorg.libX11 xorg.libICE xorg.libSM stdenv.cc.cc ];
+
+  meta = {
+    homepage = "http://java.sun.com/products/sjwtoolkit/download.html";
+    description = "Sun Java Wireless Toolkit 2.5.2_01 for CLDC";
+    license = lib.licenses.unfree;
+  };
+}