From 779b015a0358e04efce228cc5aad67ecc94a3333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 23 Mar 2009 20:36:48 +0000 Subject: [PATCH] Adding the Sun Wireless ToolKit for i686-linux at least. svn path=/nixpkgs/trunk/; revision=14666 --- pkgs/development/libraries/wtk/builder.sh | 42 ++++++++++++++++++++++ pkgs/development/libraries/wtk/default.nix | 21 +++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 3 files changed, 67 insertions(+) create mode 100644 pkgs/development/libraries/wtk/builder.sh create mode 100644 pkgs/development/libraries/wtk/default.nix diff --git a/pkgs/development/libraries/wtk/builder.sh b/pkgs/development/libraries/wtk/builder.sh new file mode 100644 index 00000000000..bf65b96c7ca --- /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 00000000000..3298b5fe6f7 --- /dev/null +++ b/pkgs/development/libraries/wtk/default.nix @@ -0,0 +1,21 @@ +{ 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"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ecea429abf8..2405f9f9373 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3929,6 +3929,10 @@ let wxGTK28 = wxGTK28deps null; + wtk = import ../development/libraries/wtk { + inherit fetchurl stdenv unzip xlibs; + }; + x264 = import ../development/libraries/x264 { inherit fetchurl stdenv; };