diff mbox series

[meta-xfce,15/15] xfce-polkit: fix link failure by adding missing gtk+-3.0 dependency

Message ID 20260323114152.4178269-16-peng.zhang1.cn@windriver.com
State New
Headers show
Series meta-xfce: upgrade core components to 4.21.x and fix cascading build issues | expand

Commit Message

Zhang Peng March 23, 2026, 11:41 a.m. UTC
From: Zhang Peng <peng.zhang1.cn@windriver.com>

After libxfce4ui upgrade to 4.21.x, its pkgconfig moves gtk+-3.0
to Requires.private, so the linker no longer automatically pulls in
libgtk-3. This causes an undefined reference to 'gtk_combo_box_set_model'
when linking xfce-polkit.

Add patch for explicit PKG_CHECK_MODULES for gtk+-3.0 in configure.ac and wire
GTK3_CFLAGS/GTK3_LIBS into src/Makefile.am.

Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
---
 ...d-missing-direct-dependency-on-gtk-3.patch | 52 +++++++++++++++++++
 .../xfce-polkit/xfce-polkit_0.3.bb            |  7 +--
 2 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 meta-xfce/recipes-apps/xfce-polkit/files/0001-configure.ac-add-missing-direct-dependency-on-gtk-3.patch
diff mbox series

Patch

diff --git a/meta-xfce/recipes-apps/xfce-polkit/files/0001-configure.ac-add-missing-direct-dependency-on-gtk-3.patch b/meta-xfce/recipes-apps/xfce-polkit/files/0001-configure.ac-add-missing-direct-dependency-on-gtk-3.patch
new file mode 100644
index 0000000000..bc20d2f854
--- /dev/null
+++ b/meta-xfce/recipes-apps/xfce-polkit/files/0001-configure.ac-add-missing-direct-dependency-on-gtk-3.patch
@@ -0,0 +1,52 @@ 
+From a89bd475c3cf7dc39618bcc9979fc618d7acd537 Mon Sep 17 00:00:00 2001
+From: Zhang Peng <peng.zhang1.cn@windriver.com>
+Date: Mon, 23 Mar 2026 16:52:58 +0800
+Subject: [PATCH] configure.ac: add missing direct dependency on gtk+-3.0
+
+xfce-polkit sources directly call GTK+ symbols (gtk_combo_box_set_model,
+gtk_widget_show, etc.), but only libxfce4ui-2 was listed as a dependency.
+Since libxfce4ui-2 correctly places gtk+-3.0 in Requires.private, the
+client must declare its own direct dependency on gtk+-3.0.
+
+See https://people.freedesktop.org/~dbn/pkg-config-guide.html#writing
+
+Upstream-Status: Submitted [https://github.com/ncopa/xfce-polkit/pull/14]
+
+Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
+---
+ configure.ac    | 1 +
+ src/Makefile.am | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 88f2432..15c09c9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,6 +4,7 @@ AC_PROG_CC
+
+ PKG_CHECK_MODULES([GLIB], [glib-2.0])
+ PKG_CHECK_MODULES([LIBXFCE4UI], [libxfce4ui-2])
++PKG_CHECK_MODULES([GTK3], [gtk+-3.0])
+ PKG_CHECK_MODULES([POLKIT_AGENT], [polkit-agent-1])
+
+ AC_CONFIG_FILES([
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 514605a..f13e4cb 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -10,11 +10,13 @@ xfce_polkit_SOURCES = \
+
+ xfce_polkit_CFLAGS = @GLIB_CFLAGS@ \
+	@LIBXFCE4UI_CFLAGS@ \
++	@GTK3_CFLAGS@ \
+	@POLKIT_AGENT_CFLAGS@
+
+
+ xfce_polkit_LDADD = @GLIB_LIBS@ \
+	@LIBXFCE4UI_LIBS@ \
++	@GTK3_LIBS@ \
+	@POLKIT_AGENT_LIBS@
+
+
+--
+2.50.0
diff --git a/meta-xfce/recipes-apps/xfce-polkit/xfce-polkit_0.3.bb b/meta-xfce/recipes-apps/xfce-polkit/xfce-polkit_0.3.bb
index 880e73849c..167cc538b9 100644
--- a/meta-xfce/recipes-apps/xfce-polkit/xfce-polkit_0.3.bb
+++ b/meta-xfce/recipes-apps/xfce-polkit/xfce-polkit_0.3.bb
@@ -7,7 +7,8 @@  DEPENDS = "libxfce4ui polkit"
 inherit xfce-app features_check
 REQUIRED_DISTRO_FEATURES = "polkit"
 
-SRC_URI = " \
-    git://github.com/ncopa/${BPN}.git;branch=master;protocol=https \
-"
+SRC_URI = "\
+           git://github.com/ncopa/${BPN}.git;branch=master;protocol=https \
+           file://0001-configure.ac-add-missing-direct-dependency-on-gtk-3.patch \
+           "
 SRCREV = "6d3282cc1734c305850d48f5bf4b4d94e88885e9"