summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/backup
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-06-18 11:15:50 +0200
committerJan Tojnar <jtojnar@gmail.com>2018-06-18 21:46:00 +0200
commit3ab1993b1fb977764547e42529b4d21dc3b50112 (patch)
tree910f4b26e88c46dd462087a790feb4aee92507ac /pkgs/applications/backup
parent4b649a99d8461c980e7028a693387dc48033c1f7 (diff)
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.
Diffstat (limited to 'pkgs/applications/backup')
-rw-r--r--pkgs/applications/backup/deja-dup/default.nix5
-rw-r--r--pkgs/applications/backup/deja-dup/hardcode-gsettings.patch38
2 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/applications/backup/deja-dup/default.nix b/pkgs/applications/backup/deja-dup/default.nix
index ef7aa96beb06..7e3c3b2e8b39 100644
--- a/pkgs/applications/backup/deja-dup/default.nix
+++ b/pkgs/applications/backup/deja-dup/default.nix
@@ -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
diff --git a/pkgs/applications/backup/deja-dup/hardcode-gsettings.patch b/pkgs/applications/backup/deja-dup/hardcode-gsettings.patch
new file mode 100644
index 000000000000..50bf2ba4fbd5
--- /dev/null
+++ b/pkgs/applications/backup/deja-dup/hardcode-gsettings.patch
@@ -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 */