Bug#1118497: pluma: not compatible with pygobject >= 3.52
Package: pluma
Version: 1.26.1-2.1
Severity: important
Tags: patch upstream forky sid
X-Debbugs-Cc: pygobject@packages.debian.org
Control: block 1118363 by -1
pygobject >= 3.52 (available in experimental) has switched from
libgirepository-1.0 to libgirepository-2.0 as its way to access GObject
libraries such as GTK.
libgirepository-1.0 and libgirepository-2.0 can be installed on the same
system, but they cannot both be used within the same process, because
they both register a GObject type named "GIRepository". This means that
pygobject, libpeas, and apps like pluma all need to agree on which version
they are going to use.
As a result we need to do a coordinated transition from:
pygobject 3.50.x
older libpeas
older pygobject-dependent apps
to:
pygobject >= 3.52
libpeas >= 1.36.0-6~
newer pygobject-dependent apps
The symptom is that if you start pluma on a system that has the versions of
pygobject and libpeas from experimental:
sudo apt install libgirepository-2.0-0 pluma
sudo apt install python3-gi{,-cairo}/experimental libpeas-1.0-0/experimental gir1.2-peas-1.0/experimental
pluma /etc/os-release
it won't start, with messages similar to those below:
>** (pluma:14121): WARNING **: 12:13:10.775: Could not load Peas repository: Typelib file for namespace 'GIRepository', version '3.0' not found
>** (pluma:14121): WARNING **: 12:13:10.776: Could not load PeasGtk repository: Typelib file for namespace 'GIRepository', version '3.0' not found
>(pluma:14121): GLib-GObject-CRITICAL **: 12:13:10.787: cannot register existing type 'GIRepository'
>(pluma:14121): GLib-CRITICAL **: 12:13:10.787: g_once_init_leave_pointer: assertion 'result != 0' failed
>(pluma:14121): GLib-GObject-CRITICAL **: 12:13:10.787: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
>(pluma:14121): GLib-GObject-CRITICAL **: 12:13:10.787: g_object_add_weak_pointer: assertion 'G_IS_OBJECT (object)' failed
>(pluma:14121): GLib-CRITICAL **: 12:13:10.787: g_once_init_leave: assertion 'result != 0' failed
>(pluma:14121): GLib-GObject-CRITICAL **: 12:13:10.787: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
For GNOME apps, a similar issue is fixed in the latest experimental
uploads of eog, gedit, rhythmbox and totem, but now we need to do the
same for non-GNOME apps as well.
To resolve this in experimental, please apply the attached patches and
upload to experimental (or the GNOME team can NMU this for you if
required, please let us know). Do not upload to unstable at this stage:
it will not work.
For your convenience the patches are also available from:
git fetch https://salsa.debian.org/smcv/pluma.git wip/smcv/libgirepository-2.0
and I will update that location with the bug number when I receive it.
I'd have sent a merge request, but they are not currently enabled for
this package's git repo.
After we get a transition slot from the release team, we will need to
include pluma in a coordinated upload to unstable of pygobject, libpeas
and several affected apps. Again, this can either be a maintainer upload
or an NMU.
(The patch to the upstream source was taken from Fedora, which has
already done the equivalent of this transition; thanks to Leigh Scott.)
Thanks,
smcv
>From 27e0c379a0f3479768ea3f0714829c430531aace Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Mon, 20 Oct 2025 23:40:24 +0100
Subject: [PATCH 1/2] Build with a libpeas that uses libgirepository-2.0
Add patch from Fedora to enable that.
Helps: #1099164, #1118363
Closes: #-1
---
debian/control | 4 +-
.../1001-Rebuild-for-libpeas1-changes.patch | 84 +++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 87 insertions(+), 2 deletions(-)
create mode 100644 debian/patches/1001-Rebuild-for-libpeas1-changes.patch
diff --git a/debian/control b/debian/control
index d1977ba..9a26006 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Build-Depends: debhelper-compat (= 13),
libglib2.0-dev,
libgtk-3-dev,
libgtksourceview-4-dev,
- libpeas-dev,
+ libpeas-dev (>= 1.36.0-6~),
libsm-dev,
libx11-dev,
libxml2-dev,
@@ -33,7 +33,7 @@ Homepage: http://www.mate-desktop.org/
Package: pluma
Architecture: any
-Depends: gir1.2-peas-1.0,
+Depends: gir1.2-peas-1.0 (>= 1.36.0-6~),
gir1.2-pluma-1.0 (= ${binary:Version}),
iso-codes,
mate-desktop-common,
diff --git a/debian/patches/1001-Rebuild-for-libpeas1-changes.patch b/debian/patches/1001-Rebuild-for-libpeas1-changes.patch
new file mode 100644
index 0000000..9dec38d
--- /dev/null
+++ b/debian/patches/1001-Rebuild-for-libpeas1-changes.patch
@@ -0,0 +1,84 @@
+From: Leigh Scott <leigh123linux@gmail.com>
+Date: Wed, 10 Sep 2025 13:19:12 +0100
+Subject: Rebuild for libpeas1 changes
+
+Recent libpeas versions add patches from the (as yet unreleased) 1.38
+upstream branch to make it compatible with pygobject >= 3.52, by using
+libgirepository-2.0 instead of libgirepository-1.0. Do similarly here.
+
+This leaks some references to the global singleton GIRepository
+instance, but that should be harmless since it's a global singleton.
+
+[smcv: Added commit message]
+
+Origin: vendor, Fedora, https://src.fedoraproject.org/rpms/pluma/c/f84adcd8673eed0592fa8cbd02122da0f9338bf0?branch=rawhide
+Bug-Debian: https://bugs.debian.org/1099164
+Bug-Debian: https://bugs.debian.org/1118363
+---
+ pluma/pluma-plugins-engine.c | 8 ++++----
+ pluma/pluma.c | 4 ++--
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/pluma/pluma-plugins-engine.c b/pluma/pluma-plugins-engine.c
+index cb5e2c4..c53a31f 100644
+--- a/pluma/pluma-plugins-engine.c
++++ b/pluma/pluma-plugins-engine.c
+@@ -36,7 +36,7 @@
+ #include <string.h>
+
+ #include <glib/gi18n.h>
+-#include <girepository.h>
++#include <girepository/girepository.h>
+
+ #include "pluma-plugins-engine.h"
+ #include "pluma-debug.h"
+@@ -68,21 +68,21 @@ pluma_plugins_engine_init (PlumaPluginsEngine *engine)
+ engine->priv->plugin_settings = g_settings_new (PLUMA_SCHEMA_ID);
+
+ /* This should be moved to libpeas */
+- if (!g_irepository_require (g_irepository_get_default (),
++ if (!gi_repository_require (gi_repository_dup_default (),
+ "Peas", "1.0", 0, &error))
+ {
+ g_warning ("Could not load Peas repository: %s", error->message);
+ g_clear_error (&error);
+ }
+
+- if (!g_irepository_require (g_irepository_get_default (),
++ if (!gi_repository_require (gi_repository_dup_default (),
+ "PeasGtk", "1.0", 0, &error))
+ {
+ g_warning ("Could not load PeasGtk repository: %s", error->message);
+ g_clear_error (&error);
+ }
+
+- if (!g_irepository_require_private (g_irepository_get_default (),
++ if (!gi_repository_require_private (gi_repository_dup_default (),
+ LIBDIR "/girepository-1.0",
+ "Pluma", "1.0", 0, &error))
+ {
+diff --git a/pluma/pluma.c b/pluma/pluma.c
+index d81b9ae..7b2ec0a 100644
+--- a/pluma/pluma.c
++++ b/pluma/pluma.c
+@@ -44,7 +44,7 @@
+ #include <gdk/gdkx.h>
+
+ #ifdef HAVE_INTROSPECTION
+-#include <girepository.h>
++#include <girepository/girepository.h>
+ #endif
+
+ #include "pluma-app.h"
+@@ -527,7 +527,7 @@ main (int argc, char *argv[])
+ g_option_context_add_group (context, egg_sm_client_get_option_group ());
+
+ #ifdef HAVE_INTROSPECTION
+- g_option_context_add_group (context, g_irepository_get_option_group ());
++ g_option_context_add_group (context, gi_repository_get_option_group ());
+ #endif
+
+ if (!g_option_context_parse (context, &argc, &argv, &error))
+--
+2.51.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 3abdedd..7aee226 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-filebrowser-fix-warning-Wincompatible-pointer-types.patch
+1001-Rebuild-for-libpeas1-changes.patch
2001_fix-bin-sh-path-in-shebang.patch
--
2.51.0
>From 5afab9e86d8be330ce6c7bdab458ad500e018fbb Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Mon, 20 Oct 2025 23:41:44 +0100
Subject: [PATCH 2/2] Update changelog
---
debian/changelog | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 962bf36..d7c1105 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+pluma (1.26.1-2.2) UNRELEASED; urgency=medium
+
+ * d/control: Build with a libpeas that uses libgirepository-2.0.
+ - d/p/1001-Rebuild-for-libpeas1-changes.patch:
+ Add patch from Fedora to enable that.
+ (Helps: #1099164, #1118363) (Closes: #-1)
+
+ -- Simon McVittie <smcv@debian.org> Mon, 20 Oct 2025 23:41:23 +0100
+
pluma (1.26.1-2.1) unstable; urgency=medium
* Non-maintainer upload, with permission.
--
2.51.0
Reply to: