| 1 | Adjust search paths so GIR typelibs and GLib schemas are found.
|
| 2 | Adapted from Nixpkgs: <https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/gp/gpaste>.
|
| 3 |
|
| 4 | diff --git a/src/gnome-shell/extension.js b/src/gnome-shell/extension.js
|
| 5 | index cb862a30..6c24175b 100644
|
| 6 | |
| 7 | |
| 8 | @@ -4,6 +4,9 @@
|
| 9 | * Copyright (c) 2010-2023, Marc-Antoine Perennou <[email protected]>
|
| 10 | */
|
| 11 |
|
| 12 | +import GIRepository from 'gi://GIRepository';
|
| 13 | +GIRepository.Repository.dup_default().prepend_search_path('@typelibDir@');
|
| 14 | +
|
| 15 | import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
| 16 | import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js';
|
| 17 |
|
| 18 | diff --git a/src/gnome-shell/prefs.js b/src/gnome-shell/prefs.js
|
| 19 | index 4c0d9bde..6a376b32 100644
|
| 20 | |
| 21 | |
| 22 | @@ -4,6 +4,9 @@
|
| 23 | * Copyright (c) 2010-2023, Marc-Antoine Perennou <[email protected]>
|
| 24 | */
|
| 25 |
|
| 26 | +import GIRepository from 'gi://GIRepository';
|
| 27 | +GIRepository.Repository.prepend_search_path('@typelibDir@');
|
| 28 | +
|
| 29 | import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
| 30 |
|
| 31 | import GPasteGtk from 'gi://GPasteGtk?version=4';
|
| 32 | diff --git a/src/libgpaste/gpaste/gpaste-settings.c b/src/libgpaste/gpaste/gpaste-settings.c
|
| 33 | index 830f5e0b..c8df0e11 100644
|
| 34 | |
| 35 | |
| 36 | @@ -1039,7 +1039,10 @@ create_g_settings (void)
|
| 37 | }
|
| 38 | else
|
| 39 | {
|
| 40 | - return g_settings_new (G_PASTE_SETTINGS_NAME);
|
| 41 | + // library used by introspection requires schemas but we cannot set XDG_DATA_DIRS for the library
|
| 42 | + g_autoptr (GSettingsSchemaSource) schema_source = g_settings_schema_source_new_from_directory ("@gschemasCompiled@", NULL, FALSE, NULL);
|
| 43 | + g_autoptr (GSettingsSchema) schema = g_settings_schema_source_lookup (schema_source, G_PASTE_SETTINGS_NAME, FALSE);
|
| 44 | + return g_settings_new_full (schema, NULL, NULL);
|
| 45 | }
|
| 46 | }
|
| 47 |
|