diff --git a/pkgs/development/libraries/java/swt/builder.sh b/pkgs/development/libraries/java/swt/builder.sh deleted file mode 100644 index 9f678d7158bb..000000000000 --- a/pkgs/development/libraries/java/swt/builder.sh +++ /dev/null @@ -1,18 +0,0 @@ -source $stdenv/setup - -unzip $src src.zip -unzip src.zip - -export JAVA_HOME=${jdk} -echo $JAVA_HOME=${jdk} -sh ./build.sh make_swt make_atk - -mkdir -p $out/lib -cp *.so $out/lib - -mkdir out -javac -d out/ $(find org/ -name "*.java") - -mkdir -p $out/jars -cp version.txt out/ -cd out && jar -c * > $out/jars/swt.jar diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix index d942dd7b692f..e91c8bbca7b9 100644 --- a/pkgs/development/libraries/java/swt/default.nix +++ b/pkgs/development/libraries/java/swt/default.nix @@ -1,9 +1,6 @@ { stdenv, fetchurl, unzip, jdk, pkgconfig, gtk -, libXtst -, libXi -, mesa -, webkit -, libsoup +, libXtst, libXi, mesa, webkit, libsoup, xorg +, pango, gdk_pixbuf, glib }: let @@ -26,8 +23,6 @@ in stdenv.mkDerivation rec { fullVersion = "${version}-201202080800"; name = "swt-${version}"; - builder = ./builder.sh; - # Alas, the Eclipse Project apparently doesn't produce source-only # releases of SWT. So we just grab a binary release and extract # "src.zip" from that. @@ -36,6 +31,41 @@ in stdenv.mkDerivation rec { sha256 = metadata.sha256; }; - buildInputs = [unzip jdk pkgconfig gtk libXtst libXi mesa webkit libsoup]; - inherit jdk; + sourceRoot = "."; + + buildInputs = [ unzip jdk pkgconfig gtk libXtst libXi mesa webkit libsoup ]; + + NIX_LFLAGS = [ "-lX11" "-I${xorg.libX11}/lib" + "-lpango-1.0" "-I${pango}/lib" + "-lgdk_pixbuf-2.0" "-I${gdk_pixbuf}/lib" + "-lglib-2.0" "-I${glib}/lib"]; + + buildPhase = '' + unzip src.zip -d src + + cd src + sed -i "s#^LFLAGS =#LFLAGS = $NIX_LFLAGS #g" *.mak + export JAVA_HOME=${jdk} + + sh ./build.sh + + mkdir out + javac -d out/ $(find org/ -name "*.java") + ''; + + installPhase = '' + mkdir -p $out/lib + cp *.so $out/lib + + mkdir -p $out/jars + cp version.txt out/ + cd out && jar -c * > $out/jars/swt.jar + ''; + + meta = with stdenv.lib; { + homepage = http://www.eclipse.org/swt/; + description = "An widget toolkit for Java to access the user-interface facilities of the operating systems on which it is implemented"; + license = licenses.epl10; + maintainers = with maintainers; [ pSub ]; + }; }