On Tue, 04 Aug 2020 at 11:51:42 +0100, [email protected] wrote:
> This package has Build-Depends on GTK 2 (libgtk2.0-dev), or produces
> binary packages with a Depends on GTK 2.
It looks as though libg3d actually only needs gdk-pixbuf (which is a
separate source package), so please consider the attached patch.
It builds successfully, but I'm intentionally not tagging this +patch
because I haven't confirmed that libg3d's gdk-pixbuf plugin still works
correctly with this change - please test carefully!
Thanks,
smcv
>From 6a79b1642e575382ca6ab31c2c4a452564ebc0ed Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Sun, 23 Jul 2023 20:48:11 +0100
Subject: [PATCH] Avoid build-dependency on obsolete GTK 2
Instead, use gdk-pixbuf directly, since that's what this package
actually needs.
Closes: #967575
---
debian/control | 2 +-
...ly-instead-of-via-the-obsolete-GTK-2.patch | 61 +++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 debian/patches/Use-gdk-pixbuf-directly-instead-of-via-the-obsolete-GTK-2.patch
diff --git a/debian/control b/debian/control
index 609d9ea..2c42fe2 100644
--- a/debian/control
+++ b/debian/control
@@ -12,9 +12,9 @@ Build-Depends:
debhelper-compat (= 13),
flex,
gtk-doc-tools,
+ libgdk-pixbuf-2.0-dev,
libglib2.0-dev,
libgsf-1-dev | libgsf-gnome-1-dev,
- libgtk2.0-dev,
libtool,
libxml2-dev,
libz-dev,
diff --git a/debian/patches/Use-gdk-pixbuf-directly-instead-of-via-the-obsolete-GTK-2.patch b/debian/patches/Use-gdk-pixbuf-directly-instead-of-via-the-obsolete-GTK-2.patch
new file mode 100644
index 0000000..a68bc21
--- /dev/null
+++ b/debian/patches/Use-gdk-pixbuf-directly-instead-of-via-the-obsolete-GTK-2.patch
@@ -0,0 +1,61 @@
+From: Simon McVittie <[email protected]>
+Date: Sun, 23 Jul 2023 20:45:58 +0100
+Subject: Use gdk-pixbuf directly, instead of via the obsolete GTK 2
+
+Bug-Debian: https://bugs.debian.org/967575
+---
+ configure.in | 10 ++--------
+ plugins/image/img_gdkpixbuf.c | 12 ------------
+ 2 files changed, 2 insertions(+), 20 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 79fc9da..0ec37bb 100644
+--- a/configure.in
++++ b/configure.in
+@@ -48,14 +48,8 @@ GTK_DOC_CHECK
+ AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([glib >= 2.0 is needed]), gmodule gobject)
+
+ # gdk-pixbuf
+-AM_PATH_GTK_2_0(2.0.0, have_gtk2=true)
+-if test "x$have_gtk2" = "xtrue" ; then
+-GDKPIXBUF_CFLAGS=$GTK_CFLAGS
+-GDKPIXBUF_LIBS=$GTK_LIBS
+-AC_SUBST(GDKPIXBUF_CFLAGS)
+-AC_SUBST(GDKPIXBUF_LIBS)
+-fi
+-AM_CONDITIONAL([HAVE_GDKPIXBUF], test "x$have_gtk2" = "xtrue")
++PKG_CHECK_MODULES([GDKPIXBUF], [gdk-pixbuf-2.0], [have_gdkpixbuf=true], [have_gdkpixbuf=false])
++AM_CONDITIONAL([HAVE_GDKPIXBUF], test "x$have_gdkpixbuf" = "xtrue")
+
+ # libxml2
+ PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.0.0, [have_libxml2=true], [have_libxml2=false])
+diff --git a/plugins/image/img_gdkpixbuf.c b/plugins/image/img_gdkpixbuf.c
+index 5a4984d..90b2178 100644
+--- a/plugins/image/img_gdkpixbuf.c
++++ b/plugins/image/img_gdkpixbuf.c
+@@ -24,7 +24,6 @@
+ #include <string.h>
+ #include <errno.h>
+
+-#include <gdk/gdk.h>
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+
+ #include <g3d/types.h>
+@@ -141,17 +140,6 @@ gchar **plugin_extensions(G3DContext *context)
+
+ static gboolean gdkpixbuf_init(void)
+ {
+- static gboolean init = TRUE;
+-
+- if(init) {
+- /* initialize GDK */
+- /* FIXME: problem if already initialized with gtk_init()? */
+- gint argc = 0;
+- if(!gdk_init_check(&argc, NULL))
+- return FALSE;
+- init = FALSE;
+- }
+- return TRUE;
+ }
+
+ static gboolean gdkpixbuf_postprocess(GdkPixbuf *pixbuf, G3DImage *image,
diff --git a/debian/patches/series b/debian/patches/series
index 6f52c0c..97c48c2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ Fix-build-with-automake-1.11.3.patch
Fix-implicit-declarations-of-functions.patch
Fix-spelling-errors.patch
Switch-libxml2-lookup-from-xml2-config-to-pkg-config.patch
+Use-gdk-pixbuf-directly-instead-of-via-the-obsolete-GTK-2.patch
--
2.40.1