1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 10:30:43 +02:00
guix/gnu/packages/patches/gpaste-fix-paths.patch
Attila Lendvai 4567f589d8
gnu: gpaste: Update to 45.2.
This fixes the build of the main app, but the GNOME Shell extension
remains broken.

* gnu/packages/gnome-xyz.scm (gpaste): Update to 45.2.
[inputs]: Remove ‘mutter’.
[arguments]: In ‘fix-introspection-install-dir’, adjust typelib variable
name.
* gnu/packages/patches/gpaste-fix-paths.patch: Update.

Change-Id: Ia80bddf9bf0978cd7a51a399ca3bf8f425377a6f
2025-05-14 22:45:20 +02:00

47 lines
2 KiB
Diff

Adjust search paths so GIR typelibs and GLib schemas are found.
Adapted from Nixpkgs: <https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/gp/gpaste>.
diff --git a/src/gnome-shell/extension.js b/src/gnome-shell/extension.js
index cb862a30..6c24175b 100644
--- a/src/gnome-shell/extension.js
+++ b/src/gnome-shell/extension.js
@@ -4,6 +4,9 @@
* Copyright (c) 2010-2023, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
*/
+import GIRepository from 'gi://GIRepository';
+GIRepository.Repository.prepend_search_path('@typelibDir@');
+
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
diff --git a/src/gnome-shell/prefs.js b/src/gnome-shell/prefs.js
index 4c0d9bde..6a376b32 100644
--- a/src/gnome-shell/prefs.js
+++ b/src/gnome-shell/prefs.js
@@ -4,6 +4,9 @@
* Copyright (c) 2010-2023, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
*/
+import GIRepository from 'gi://GIRepository';
+GIRepository.Repository.prepend_search_path('@typelibDir@');
+
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
import GPasteGtk from 'gi://GPasteGtk?version=4';
diff --git a/src/libgpaste/gpaste/gpaste-settings.c b/src/libgpaste/gpaste/gpaste-settings.c
index 830f5e0b..c8df0e11 100644
--- a/src/libgpaste/gpaste/gpaste-settings.c
+++ b/src/libgpaste/gpaste/gpaste-settings.c
@@ -1039,7 +1039,10 @@ create_g_settings (void)
}
else
{
- return g_settings_new (G_PASTE_SETTINGS_NAME);
+ // library used by introspection requires schemas but we cannot set XDG_DATA_DIRS for the library
+ g_autoptr (GSettingsSchemaSource) schema_source = g_settings_schema_source_new_from_directory ("@gschemasCompiled@", NULL, FALSE, NULL);
+ g_autoptr (GSettingsSchema) schema = g_settings_schema_source_lookup (schema_source, G_PASTE_SETTINGS_NAME, FALSE);
+ return g_settings_new_full (schema, NULL, NULL);
}
}