diff --git a/pkgs/development/compilers/jdk/default.nix b/pkgs/development/compilers/jdk/default.nix index 6738c8366b4..547833c15cd 100644 --- a/pkgs/development/compilers/jdk/default.nix +++ b/pkgs/development/compilers/jdk/default.nix @@ -1,9 +1,11 @@ args: if args.stdenv.system == "i686-linux" || args.stdenv.system == "x86_64-linux" then - (import ./jdk6-linux.nix) args + (import ./jdk6-linux.nix) ( removeAttrs args ["cabextract"] ) else if args.stdenv.system == "powerpc-linux" then - (import ./jdk5-ibm-powerpc-linux.nix) (removeAttrs args ["pluginSupport" "xlibs" "installjdk"]) + (import ./jdk5-ibm-powerpc-linux.nix) (removeAttrs args ["pluginSupport" "xlibs" "installjdk" "cabextract"]) +else if args.stdenv.system == "i686-cygwin" then + (import ./jdk6-cygwin.nix) (removeAttrs args ["pluginSupport" "xlibs" "installjdk" "xlibs"]) else abort "the JDK is not supported on this platform" diff --git a/pkgs/development/compilers/jdk/jdk6-cygwin.nix b/pkgs/development/compilers/jdk/jdk6-cygwin.nix new file mode 100644 index 00000000000..766151dfe6b --- /dev/null +++ b/pkgs/development/compilers/jdk/jdk6-cygwin.nix @@ -0,0 +1,46 @@ +{ stdenv +, fetchurl +, unzip +, cabextract +, ... +}: + +assert stdenv.system == "i686-cygwin"; + +stdenv.mkDerivation rec { + name = "jdk-1.6.0_20"; + + src = fetchurl { + url = file:///tmp/jdk-6u20-windows-i586.exe ; + sha256 = "0w4afz8a9gi1iyhh47gvhiy59dfrzx0fnmywdff3v5cx696w25fh"; + }; + + buildInputs = [unzip cabextract]; + + buildCommand = '' + cabextract ${src} + mkdir -p $out + unzip -d $out tools.zip + find $out -name '*.exe' | xargs chmod a+x + find $out -name '*.dll' | xargs chmod a+x + + cd $out + $out/bin/unpack200.exe ./jre/lib/jsse.pack ./jre/lib/jsse.jar + $out/bin/unpack200.exe ./jre/lib/javaws.pack ./jre/lib/javaws.jar + $out/bin/unpack200.exe ./jre/lib/plugin.pack ./jre/lib/plugin.jar + $out/bin/unpack200.exe ./jre/lib/charsets.pack ./jre/lib/charsets.jar + $out/bin/unpack200.exe ./jre/lib/deploy.pack ./jre/lib/deploy.jar + $out/bin/unpack200.exe ./jre/lib/rt.pack ./jre/lib/rt.jar + $out/bin/unpack200.exe ./jre/lib/ext/localedata.pack ./jre/lib/ext/localedata.jar + $out/bin/unpack200.exe ./lib/tools.pack ./lib/tools.jar + + rm ./jre/lib/jsse.pack \ + ./jre/lib/javaws.pack \ + ./jre/lib/plugin.pack \ + ./jre/lib/charsets.pack \ + ./jre/lib/deploy.pack \ + ./jre/lib/rt.pack \ + ./jre/lib/ext/localedata.pack \ + ./lib/tools.pack + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0ac2592b0a8..8779e30a594 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2467,12 +2467,13 @@ let supportsJDK = system == "i686-linux" || system == "x86_64-linux" || + system == "i686-cygwin" || system == "powerpc-linux"; jdkdistro = installjdk: pluginSupport: (assert supportsJDK; (if pluginSupport then appendToName "plugin" else x: x) (import ../development/compilers/jdk { - inherit fetchurl stdenv unzip installjdk xlibs pluginSupport makeWrapper; + inherit fetchurl stdenv unzip installjdk xlibs pluginSupport makeWrapper cabextract; })); jikes = import ../development/compilers/jikes {