~ruther/guix-local

2f12a4609035f23a717d665fdcee16a3c4de651f — Maxim Cournoyer 3 years ago eda94d1
gnu: gpaste: Update to 42.1.

* gnu/packages/gnome-xyz.scm (gpaste): Update to 42.1.
[meson]: Delete argument.
[phases]{fix-introspection-install-dir}: Use #$output.
[native-inputs]: Remove autoconf, automake and libtool.
[inputs]: Remove graphene.  Add gtk and libadwaita.  Sort.
* gnu/packages/patches/gpaste-fix-paths.patch: Update patch.
2 files changed, 43 insertions(+), 17 deletions(-)

M gnu/packages/gnome-xyz.scm
M gnu/packages/patches/gpaste-fix-paths.patch
M gnu/packages/gnome-xyz.scm => gnu/packages/gnome-xyz.scm +18 -13
@@ 776,7 776,7 @@ notebooks and tiling window managers.")
(define-public gpaste
  (package
    (name "gpaste")
    (version "3.42.2")
    (version "42.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference


@@ 785,19 785,25 @@ notebooks and tiling window managers.")
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1k5qvgzwl357k72qfim5zfas2a0n6j24jnlm1v472l7h6gb6lssm"))
                "1dlqa69zvzzdxyh21qfrx2nhpfy0fbihxpgkxqmramcgv3h5k4q3"))
              (patches
               (search-patches "gpaste-fix-paths.patch"))))
    (build-system meson-build-system)
    (native-inputs
     (list autoconf automake gettext-minimal gobject-introspection
     (list gettext-minimal
           gobject-introspection
           (list glib "bin")            ; for glib-compile-resources
           libtool pkg-config vala))
           pkg-config
           vala))
    (inputs
     (list appstream-glib libarchive gjs mutter graphene))
     (list appstream-glib
           gjs
           gtk
           mutter
           libadwaita
           libarchive))
    (arguments
     (list #:meson meson-0.59      ;positional arguments error with meson 0.60
           #:glib-or-gtk? #true
     (list #:glib-or-gtk? #true
           #:configure-flags
           #~(list
              (string-append "-Dcontrol-center-keybindings-dir="


@@ 809,12 815,11 @@ notebooks and tiling window managers.")
           #:phases
           #~(modify-phases %standard-phases
               (add-after 'unpack 'fix-introspection-install-dir
                 (lambda* (#:key outputs #:allow-other-keys)
                   (let ((out (assoc-ref outputs "out")))
                     (substitute* '("src/gnome-shell/extension.js"
                                    "src/gnome-shell/prefs.js")
                       (("@typelibPath@")
                        (string-append out "/lib/girepository-1.0/")))))))))
                 (lambda _
                   (substitute* '("src/gnome-shell/extension.js"
                                  "src/gnome-shell/prefs.js")
                     (("@typelibPath@")
                      (string-append #$output "/lib/girepository-1.0/"))))))))
    (home-page "https://github.com/Keruspe/GPaste")
    (synopsis "Clipboard management system for GNOME Shell")
    (description "GPaste is a clipboard manager, a tool which allows you to

M gnu/packages/patches/gpaste-fix-paths.patch => gnu/packages/patches/gpaste-fix-paths.patch +25 -4
@@ 1,5 1,7 @@
This is copied from NixOS, which is under MIT licence.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/gnome/misc/gpaste/
diff --git a/src/gnome-shell/extension.js b/src/gnome-shell/extension.js
index c8773fd6..9efbed67 100644
--- a/src/gnome-shell/extension.js
+++ b/src/gnome-shell/extension.js
@@ -6,6 +6,8 @@


@@ 10,15 12,34 @@ https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/gnome/misc/gpaste/
+
 imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION;
 imports.gi.versions.GLib = '2.0';
 imports.gi.versions.GPaste = '1.0';
 imports.gi.versions.GPaste = '2';
diff --git a/src/gnome-shell/prefs.js b/src/gnome-shell/prefs.js
index 32244ab2..74b85572 100644
--- a/src/gnome-shell/prefs.js
+++ b/src/gnome-shell/prefs.js
@@ -6,6 +6,8 @@
 
 const Gettext = imports.gettext;
 imports.gi.versions.GPasteGtk = '4';
 
+imports.gi.GIRepository.Repository.prepend_search_path('@typelibPath@');
+
 //const { GPaste } = imports.gi;
 
 const ExtensionUtils = imports.misc.extensionUtils;
 
 const { GPasteGtk } = imports.gi;
diff --git a/src/libgpaste/gpaste/gpaste-settings.c b/src/libgpaste/gpaste/gpaste-settings.c
index 7e53eb64..57c399fc 100644
--- a/src/libgpaste/gpaste/gpaste-settings.c
+++ b/src/libgpaste/gpaste/gpaste-settings.c
@@ -1013,7 +1013,11 @@ 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
+        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);
+        g_settings_schema_source_unref (schema_source);
+        return g_settings_new_full (schema, NULL, NULL);
     }
 }