deja-dup: fix nautilus extension breaking nautilus

When deja-dup is installed, Nautilus segfaults on start due to
the missing gsettings schemas.

This commit hardcodes path to the compiled schemas file to the extension.
gstqt5
Jan Tojnar 2018-06-18 11:15:50 +02:00
parent 4b649a99d8
commit 3ab1993b1f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 43 additions and 0 deletions

View File

@ -19,8 +19,13 @@ stdenv.mkDerivation rec {
src = ./fix-paths.patch;
inherit coreutils;
})
./hardcode-gsettings.patch
];
postPatch = ''
substituteInPlace deja-dup/nautilus/NautilusExtension.c --subst-var-by DEJA_DUP_GSETTINGS_PATH $out/share/gsettings-schemas/${name}/glib-2.0/schemas
'';
nativeBuildInputs = [
meson ninja pkgconfig vala_0_40 gettext itstool
appstream-glib desktop-file-utils libxml2 wrapGAppsHook

View File

@ -0,0 +1,38 @@
--- a/deja-dup/nautilus/NautilusExtension.c
+++ b/deja-dup/nautilus/NautilusExtension.c
@@ -24,6 +24,8 @@
#include <glib/gi18n-lib.h>
GList *dirs = NULL;
+GSettingsSchemaSource *schema_source = NULL;
+GSettingsSchema *schema = NULL;
GSettings *settings = NULL;
// This will treat a < b iff a is 'lower' in the file tree than b
@@ -313,7 +315,13 @@
bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
- settings = g_settings_new("org.gnome.DejaDup");
+ schema_source = g_settings_schema_source_new_from_directory ("@DEJA_DUP_GSETTINGS_PATH@",
+ g_settings_schema_source_get_default (), TRUE, NULL);
+
+ schema = g_settings_schema_source_lookup (schema_source,
+ "org.gnome.DejaDup", FALSE);
+
+ settings = g_settings_new_full (schema, NULL, NULL);
g_signal_connect(settings, "changed::include-list",
update_include_excludes, NULL);
g_signal_connect(settings, "changed::exclude-list",
@@ -329,7 +337,11 @@
void nautilus_module_shutdown(void)
{
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
g_object_unref(settings);
+ schema_source = NULL;
+ schema = NULL;
settings = NULL;
update_include_excludes(); /* will clear it now that settings is NULL */