[packages/xviewer] - updated to xviewer, added patch/bcond for libpeas 1.38/girepository-2

qboosh qboosh at pld-linux.org
Thu Apr 2 22:12:53 CEST 2026


commit ca5f921156e9765d56b0caa48140729967bb8b0b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Apr 2 22:13:15 2026 +0200

    - updated to xviewer, added patch/bcond for libpeas 1.38/girepository-2

 xviewer-girepository2.patch | 75 +++++++++++++++++++++++++++++++++++++++++++++
 xviewer.spec                | 28 +++++++++++++++--
 2 files changed, 100 insertions(+), 3 deletions(-)
---
diff --git a/xviewer.spec b/xviewer.spec
index 7b6bdb6..bc44b44 100644
--- a/xviewer.spec
+++ b/xviewer.spec
@@ -2,17 +2,19 @@
 # Conditional build:
 %bcond_without	apidocs	# API documentation
 %bcond_without	librsvg	# SVG scaling using librsvg
+%bcond_with	gir2	# girepository-2/libpeas 1.38 instead of girepository-1/libpeas 1.36
 
 Summary:	Image viewer which supports many formats
 Summary(pl.UTF-8):	Przeglądarka obrazów obsługująca wiele formatów
 Name:		xviewer
-Version:	3.4.11
+Version:	3.4.16
 Release:	1
 License:	GPL v2+
 Group:		X11/Applications/Graphics
 #Source0Download: https://github.com/linuxmint/xviewer/tags
 Source0:	https://github.com/linuxmint/xviewer/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	62aabaaf04402a465c89c44e7905bb8c
+# Source0-md5:	0f5a0cd5f0b35ad52a47f32ed79ef508
+Patch0:		%{name}-girepository2.patch
 URL:		https://github.com/linuxmint/xviewer
 BuildRequires:	cinnamon-desktop-devel >= 3.2.0
 BuildRequires:	docbook-dtd412-xml
@@ -20,14 +22,21 @@ BuildRequires:	exempi-devel >= 1.99.5
 BuildRequires:	gdk-pixbuf2-devel >= 2.19.1
 BuildRequires:	gettext-tools >= 0.19.7
 BuildRequires:	glib2-devel >= 1:2.38.0
-#BuildRequires:	gobject-introspection-devel >= 0.10.0
+%{!?with_gir2:BuildRequires:	gobject-introspection-devel >= 0.10.0}
 BuildRequires:	gtk+3-devel >= 3.0
 %{?with_apidocs:BuildRequires:	gtk-doc >= 1.16}
 BuildRequires:	lcms2-devel >= 2
 BuildRequires:	libexif-devel >= 1:0.6.14
 BuildRequires:	libjpeg-devel >= 8
+%if %{with gir2}
+BuildRequires:	libpeas-devel >= 1.38
+BuildRequires:	libpeas-gtk-devel >= 1.38
+%else
 BuildRequires:	libpeas-devel >= 0.7.4
+BuildRequires:	libpeas-devel < 1.38
 BuildRequires:	libpeas-gtk-devel >= 0.7.4
+BuildRequires:	libpeas-gtk-devel < 1.38
+%endif
 BuildRequires:	libportal-devel >= 0.5
 BuildRequires:	libportal-gtk3-devel >= 0.5
 %{?with_librsvg:BuildRequires:	librsvg-devel >= 2.36.2}
@@ -51,8 +60,13 @@ Requires:	glib2 >= 1:2.38.0
 Requires:	gtk+3 >= 3.0
 Requires:	hicolor-icon-theme
 Requires:	libexif >= 1:0.6.14
+%if %{with gir2}
+Requires:	libpeas >= 1.38
+Requires:	libpeas-gtk >= 1.38
+%else
 Requires:	libpeas >= 0.7.4
 Requires:	libpeas-gtk >= 0.7.4
+%endif
 %{?with_rsvg:Requires:	librsvg >= 2.36.2}
 Requires:	shared-mime-info >= 0.50
 Requires:	xapps-libs >= 2.5.0
@@ -80,8 +94,13 @@ Requires:	libjpeg-devel >= 8
 Requires:	glib2-devel >= 1:2.38.0
 Requires:	gtk+3-devel >= 3.0
 Requires:	lcms2-devel >= 2
+%if %{with gir2}
+Requires:	libpeas-devel >= 1.38
+Requires:	libpeas-gtk-devel >= 1.38
+%else
 Requires:	libpeas-devel >= 0.7.4
 Requires:	libpeas-gtk-devel >= 0.7.4
+%endif
 %{?with_librsvg:Requires:	librsvg-devel >= 2.36.2}
 Requires:	xorg-lib-libX11-devel
 Requires:	xapps-devel >= 2.5.0
@@ -108,6 +127,9 @@ Dokumentacja API Xviewer.
 
 %prep
 %setup -q
+%if %{with gir2}
+%patch -P0 -p1
+%endif
 
 %build
 %meson \
diff --git a/xviewer-girepository2.patch b/xviewer-girepository2.patch
new file mode 100644
index 0000000..3941325
--- /dev/null
+++ b/xviewer-girepository2.patch
@@ -0,0 +1,75 @@
+--- xviewer-3.4.16/src/xviewer-plugin-engine.c.orig	2026-01-08 17:33:18.000000000 +0100
++++ xviewer-3.4.16/src/xviewer-plugin-engine.c	2026-04-02 20:49:40.242800631 +0200
+@@ -34,7 +34,7 @@
+ #include <glib/gi18n.h>
+ #include <glib.h>
+ #include <gio/gio.h>
+-#include <girepository.h>
++#include <girepository/girepository.h>
+ 
+ #define XVIEWER_PLUGIN_DATA_DIR XVIEWER_DATA_DIR G_DIR_SEPARATOR_S "plugins"
+ 
+@@ -84,9 +84,17 @@ xviewer_plugin_engine_new (void)
+ 	gchar *typelib_path;
+ 	const gchar * const * system_data_dirs;
+ 	GError *error = NULL;
++	GIRepository *repo = gi_repository_dup_default ();
++
++	repo = gi_repository_dup_default ();
++	if (repo == NULL)
++	{
++		g_warning ("Could not get GI repository");
++		return NULL;
++	}
+ 
+ 	/* This should be moved to libpeas */
+-	if (g_irepository_require (g_irepository_get_default (),
++	if (gi_repository_require (repo,
+ 				   "Peas", "1.0", 0, &error) == NULL)
+ 	{
+ 		g_warning ("Error loading Peas typelib: %s\n",
+@@ -95,7 +103,7 @@ xviewer_plugin_engine_new (void)
+ 	}
+ 
+ 
+-	if (g_irepository_require (g_irepository_get_default (),
++	if (gi_repository_require (repo,
+ 				   "PeasGtk", "1.0", 0, &error) == NULL)
+ 	{
+ 		g_warning ("Error loading PeasGtk typelib: %s\n",
+@@ -105,13 +113,14 @@ xviewer_plugin_engine_new (void)
+ 
+ 	typelib_path = g_build_filename (LIBDIR, "xviewer", "girepository-1.0", NULL);
+ 
+-	if (g_irepository_require_private (g_irepository_get_default (), typelib_path,
++	if (gi_repository_require_private (repo, typelib_path,
+ 					   "Xviewer", "3.0", 0, &error) == NULL)
+ 	{
+ 		g_warning ("Error loading Xviewer typelib: %s\n",
+ 			   error->message);
+ 		g_clear_error (&error);
+ 	}
++	g_clear_object (&repo);
+ 
+ 	engine = XVIEWER_PLUGIN_ENGINE (g_object_new (XVIEWER_TYPE_PLUGIN_ENGINE,
+ 						  NULL));
+--- xviewer-3.4.16/src/main.c.orig	2026-01-08 17:33:18.000000000 +0100
++++ xviewer-3.4.16/src/main.c	2026-04-02 22:10:22.696566806 +0200
+@@ -27,7 +27,7 @@
+ #include "config.h"
+ #endif
+ #ifdef HAVE_INTROSPECTION
+-#include <girepository.h>
++#include <girepository/girepository.h>
+ #endif
+ 
+ #include "xviewer-application.h"
+@@ -102,7 +102,7 @@ main (int argc, char **argv)
+ 	 * Using gtk_get_option_group here initializes gtk during parsing */
+ 	g_option_context_add_group (ctx, gtk_get_option_group (FALSE));
+ #ifdef HAVE_INTROSPECTION
+-	g_option_context_add_group (ctx, g_irepository_get_option_group ());
++	g_option_context_add_group (ctx, gi_repository_get_option_group ());
+ #endif
+ 
+ 	if (!g_option_context_parse (ctx, &argc, &argv, &error)) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xviewer.git/commitdiff/ca5f921156e9765d56b0caa48140729967bb8b0b



More information about the pld-cvs-commit mailing list