← Back to team overview

openjdk team mailing list archive

Bug#850268: Please stop using deprecated GNOME libraries (libgnome-2-0, libgnomevfs2-0, libgconf2-4)

 

Control: tags 850268 + patch

On Thu, 05 Jan 2017 at 15:04:29 +0100, Michael Biebl wrote:
> On a typical stretch desktop/GNOME installation, openjdk-8-jre (*) seems to
> be the only remaining package which pulls in those old libraries via
>   Recommends: libgnome-2-0, libgnomevfs2-0, libgconf2-4

I had a look into this today after some discussion in #debian-gnome about it
being feasible to get rid of those packages from a default desktop
installation (according to mbiebl's latest check, to drop libgconf2-4 we
just need to fix synaptic and openjdk-8, and drop aisleriot).

I attach a possible patch. Please consider applying it for stretch. See below
if you need justification for why it is not a functional regression.

Thanks,
    S

---- justification for why this is OK ----

After unpacking the tar-in-tar sources, the mentions of GNOME-related
libraries outside debian/ seem to be:

jdk-jdk8u121-b13/src/solaris/native/sun/awt/gtk2_interface.c
    uses libgtk2.0-0, which is old but still supported

jdk-jdk8u121-b13/src/solaris/native/sun/net/spi/DefaultProxySelector.c
    has branch for modern GIO (libglib2.0-0)
    has branch for libgconf2-4 (old)

jdk-jdk8u121-b13/src/solaris/native/sun/nio/fs/GnomeFileTypeDetector.c
    has branch for modern GIO (libglib2.0-0)
    has branch for libgnomevfs-2-0 (old)

jdk-jdk8u121-b13/src/solaris/native/sun/xawt/gnome_interface.c
    uses libgnomevfs-2 and libgnome-2 (old)

Pulling on those threads a bit:

The default proxy selector native code is used by
jdk-jdk8u121-b13/src/share/classes/sun/net/spi/DefaultProxySelector.java.
DefaultProxySelector.c has internal code to select a proxy, and will only use
gconf if libglib2.0-0 doesn't have the necessary functions - but it has had
the necessary functions since at least 2.24. The oldest supported Debian and
Ubuntu releases, wheezy and precise, both have 2.32. So we can ignore
libgconf2-4 in favour of libglib2.0-0 (>= 2.24).

The file type detection code is used by
jdk-jdk8u121-b13/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
which does the failover between GIO and gnomevfs in Java instead of C.
Again, if we have a vaguely modern GIO, gnomevfs isn't even tried.
Again, libglib2.0-0 has had the necessary functions since at least 2.24.

gnome_interface.c is used to open URIs in the system default browser.
It is used by jdk-jdk8u121-b13/src/solaris/native/sun/xawt/awt_Desktop.c
which prefers to use gtk_show_uri() from GTK+ >= 2.14. The oldest
supported Debian and Ubuntu releases both have libgtk2.0-0 2.24, so we
can ignore the libgnomevfs-2, libgnome-2 code path.

The non-headless JRE already Depends on libgtk2.0-0, and the Recommends
on obsolete GNOME libraries are only in the non-headless JRE anyway.

I have included explicit versions (>= 2.14), (>= 2.24) in the proposed
patch because the OpenJDK packaging seems to be designed to backport
easily to EOL distributions like squeeze. If you are only targeting
semi-modern distributions like wheezy and precise, let alone actually
recent distributions, then those versioned dependencies are unnecessary.

---- end justification ----
diff -ru openjdk-8-8u121-b13/debian/changelog openjdk-8/debian/changelog
--- openjdk-8-8u121-b13/debian/changelog	2017-02-08 06:24:13.000000000 +0000
+++ openjdk-8/debian/changelog	2017-03-01 23:42:53.657921945 +0000
@@ -1,3 +1,17 @@
+openjdk-8 (8u121-b13-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Drop Recommends on obsolete GNOME libraries so they are not in a
+    default GNOME desktop installation:
+    - sun.net.spi.DefaultProxySelector prefers libglib2.0-0 (>= 2.24)
+      over obsolete libgconf2-4
+    - sun.nio.fs.GnomeFileTypeDetector prefers libglib2.0-0 (>= 2.24)
+      over libgnomevfs-2-0
+    - sun.xawt.awt_Desktop prefers libgtk2.0-0 (>= 2.14) over
+      libgnomevfs2-0
+
+ -- Simon McVittie <smcv@xxxxxxxxxx>  Wed, 01 Mar 2017 23:37:03 +0000
+
 openjdk-8 (8u121-b13-3) unstable; urgency=medium
 
   * Really don't build the JamVM VM.
diff -ru openjdk-8-8u121-b13/debian/rules openjdk-8/debian/rules
--- openjdk-8-8u121-b13/debian/rules	2017-02-08 06:24:13.000000000 +0000
+++ openjdk-8/debian/rules	2017-03-01 23:38:15.577876109 +0000
@@ -768,18 +768,8 @@
 endif
 dlopen_hl_recommends =
 dlopen_jre_depends = \
-	libgtk2.0-0, libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1
+	libglib2.0-0 (>= 2.24), libgtk2.0-0 (>= 2.14), libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1
 dlopen_jre_recommends =
-# these are not yet ready for multiarch
-ifneq (,$(DEB_HOST_MULTIARCH))
-  ifneq (,$(filter $(distrel),jessie wheezy squeeze precise trusty vivid wily))
-    dlopen_jre_recommends += , libgnome2-0, libgnomevfs2-0, libgconf2-4
-  else
-    dlopen_jre_recommends += , libgnome-2-0, libgnomevfs2-0, libgconf-2-4
-  endif
-else
-  dlopen_jre_depends += , libgnome2-0, libgnomevfs2-0, libgconf2-4
-endif
 
 plugin_name = IcedTeaPlugin.so
 browser_plugin_dirs = mozilla

References