summaryrefslogtreecommitdiff
path: root/media-gfx/eom/files/eom-1.28.1-girepository-2.0-detection.patch
blob: be596ab4df070014fb0115d9868a63a443642180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 6d827dca2d80159b3dadad7b1741ebaa92880149 Mon Sep 17 00:00:00 2001
From: Victor Kareh <vkareh@redhat.com>
Date: Mon, 26 Jan 2026 15:15:05 -0500
Subject: [PATCH] configure: Only use girepository-2.0 if libpeas uses it too

Fixes header conflicts on systems where glib has girepository-2.0 but
libpeas still uses the old gobject-introspection-1.0 headers.
---
 configure.ac | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f3d0316..fb5b4be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,9 +118,16 @@ if test "$found_introspection" = "yes"; then
 	AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
 
 	# Check for girepository-2.0 API (moved to glib in version 1.80+)
-	PKG_CHECK_EXISTS([girepository-2.0],
-		[AC_DEFINE([HAVE_GIREPOSITORY_2], [1], [Using girepository-2.0 API])],
-		[])
+	# We can only use girepository-2.0 if libpeas also uses it, otherwise we get conflicts
+	PKG_CHECK_EXISTS([girepository-2.0], [
+		# Check if libpeas requires girepository-2.0
+		if pkg-config --print-requires libpeas-1.0 | grep -q "girepository-2.0"; then
+			AC_DEFINE([HAVE_GIREPOSITORY_2], [1], [Using girepository-2.0 API])
+			have_girepository_2=yes
+		else
+			have_girepository_2=no
+		fi
+	], [have_girepository_2=no])
 else
 	have_introspection=no
 fi
@@ -434,6 +441,7 @@ Configure summary:
 	RSVG support ...............:  ${have_rsvg}
 	Colour management support ..:  ${have_lcms}
 	GObject Introspection.......:  ${have_introspection}
+	GIRepository 2.0............:  ${have_girepository_2:-no}
 	Native Language support.....:  ${USE_NLS}
 	Thumbnailer.................:  ${eom_thumbnailer}
 "
-- 
2.52.0