xfce-polkit: fix link failure by adding missing gtk+-3.0 dependency

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>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Zhang Peng 2026-03-24 20:59:27 +08:00 committed by Khem Raj
parent b94c5bcfaa
commit f3a7f4cee0
No known key found for this signature in database
GPG Key ID: BB053355919D3314
2 changed files with 56 additions and 3 deletions

View File

@ -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

View File

@ -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"