diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-10-07 14:12:33 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 14:12:33 +0400 |
commit | a1791e8543589efdaa5733636352e3c9542c49d8 (patch) | |
tree | d8c6f65db0b81affcfb25764a16978637f32c8dc /pkgs/development | |
parent | 40fc02bb30343a79c827fce478436d9d72ab0f86 (diff) | |
parent | 9d7c9cc32e9d7a382707c3d62580f9416b9c5b09 (diff) | |
download | nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar.gz nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar.bz2 nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar.lz nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar.xz nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.tar.zst nixlib-a1791e8543589efdaa5733636352e3c9542c49d8.zip |
Merge pull request #19167 from abbradar/java-gui
jre8: minimize minimal build and add more GUI dependencies to the regular one
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/openjdk/8.nix | 52 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/swing-use-gtk.patch | 26 |
2 files changed, 59 insertions, 19 deletions
diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index 50199852ae2f..2969dab92260 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -1,8 +1,11 @@ -{ stdenv, fetchurl, cpio, pkgconfig, file, which, unzip, zip, xorg, cups, freetype -, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib +{ stdenv, lib, fetchurl, cpio, pkgconfig, file, which, unzip, zip, cups, freetype +, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir +, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor +, libjpeg, giflib , setJavaClassPath , minimal ? false , enableInfinality ? true # font rendering patch +, enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf }: let @@ -65,10 +68,11 @@ let nativeBuildInputs = [ pkgconfig ]; buildInputs = [ - cpio file which unzip zip - xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst - xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir - cups freetype alsaLib perl liberation_ttf fontconfig bootjdk zlib + cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib + libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst + libXi libXinerama libXcursor lndir fontconfig + ] ++ lib.optionals (!minimal && enableGnome2) [ + gtk2 gnome_vfs GConf glib ]; prePatch = '' @@ -82,10 +86,12 @@ let ./fix-java-home-jdk8.patch ./read-truststore-from-env-jdk8.patch ./currency-date-range-jdk8.patch - ] ++ (if enableInfinality then [ + ] ++ lib.optionals (!minimal && enableInfinality) [ ./004_add-fontconfig.patch ./005_enable-infinality.patch - ] else []); + ] ++ lib.optionals (!minimal && enableGnome2) [ + ./swing-use-gtk.patch + ]; preConfigure = '' chmod +x configure @@ -101,21 +107,22 @@ let "--enable-unlimited-crypto" "--disable-debug-symbols" "--disable-freetype-bundling" + "--with-zlib=system" + "--with-giflib=system" + "--with-stdc++lib=dynamic" # glibc 2.24 deprecated readdir_r so we need this # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html "--with-extra-cflags=\"-Wno-error=deprecated-declarations\"" - ] ++ (if minimal then [ - "--disable-headful" - "--with-zlib=bundled" - "--with-giflib=bundled" - ] else [ - "--with-zlib=system" - ]); + ] ++ lib.optional minimal "--disable-headful"; - NIX_LDFLAGS= if minimal then null else "-lfontconfig"; + NIX_LDFLAGS= lib.optionals (!minimal) [ + "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" + ] ++ lib.optionals (!minimal && enableGnome2) [ + "-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" + ]; - buildFlags = "all"; + buildFlags = [ "all" ]; installPhase = '' mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk @@ -135,12 +142,19 @@ let # Remove crap from the installation. rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample + ${lib.optionalString minimal '' + rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so + rm $out/lib/openjdk/jre/bin/policytool + rm $out/lib/openjdk/bin/{policytool,appletviewer} + ''} # Move the JRE to a separate output and setup fallback fonts mv $out/lib/openjdk/jre $jre/lib/openjdk/ mkdir $out/lib/openjdk/jre - mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback - lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback + ${lib.optionalString (!minimal) '' + mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback + lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback + ''} lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre rm -rf $out/lib/openjdk/jre/bina diff --git a/pkgs/development/compilers/openjdk/swing-use-gtk.patch b/pkgs/development/compilers/openjdk/swing-use-gtk.patch new file mode 100644 index 000000000000..9538aade6726 --- /dev/null +++ b/pkgs/development/compilers/openjdk/swing-use-gtk.patch @@ -0,0 +1,26 @@ +diff -ru3 a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java +--- a/jdk/src/share/classes/javax/swing/UIManager.java 2016-07-26 00:41:37.000000000 +0300 ++++ b/jdk/src/share/classes/javax/swing/UIManager.java 2016-10-02 22:46:01.890071761 +0300 +@@ -607,11 +607,9 @@ + if (osType == OSInfo.OSType.WINDOWS) { + return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + } else { +- String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop")); + Toolkit toolkit = Toolkit.getDefaultToolkit(); +- if ("gnome".equals(desktop) && +- toolkit instanceof SunToolkit && +- ((SunToolkit) toolkit).isNativeGTKAvailable()) { ++ if (toolkit instanceof SunToolkit && ++ ((SunToolkit) toolkit).isNativeGTKAvailable()) { + // May be set on Linux and Solaris boxs. + return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; + } +@@ -1341,7 +1339,7 @@ + lafName = (String) lafData.remove("defaultlaf"); + } + if (lafName == null) { +- lafName = getCrossPlatformLookAndFeelClassName(); ++ lafName = getSystemLookAndFeelClassName(); + } + lafName = swingProps.getProperty(defaultLAFKey, lafName); + |