From d5a188d4d6e2b6eae0780e954e38336cabe3cf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Sat, 20 Apr 2019 08:51:44 -0300 Subject: [PATCH] deepin.deepin-mutter: set plugins dir from environment variable --- .../deepin-mutter.plugins-dir.patch | 41 +++++++++++++++++++ .../desktops/deepin/deepin-mutter/default.nix | 10 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 pkgs/desktops/deepin/deepin-mutter/deepin-mutter.plugins-dir.patch diff --git a/pkgs/desktops/deepin/deepin-mutter/deepin-mutter.plugins-dir.patch b/pkgs/desktops/deepin/deepin-mutter/deepin-mutter.plugins-dir.patch new file mode 100644 index 00000000000..4a57b501e01 --- /dev/null +++ b/pkgs/desktops/deepin/deepin-mutter/deepin-mutter.plugins-dir.patch @@ -0,0 +1,41 @@ +From 8eeb4febcae517080d6638f8953e02335df79f01 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= +Date: Sat, 20 Apr 2019 00:28:47 -0300 +Subject: [PATCH] Get plugins dir from environment variable + +--- + src/compositor/meta-plugin-manager.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c +index ac5716db..d000100b 100644 +--- a/src/compositor/meta-plugin-manager.c ++++ b/src/compositor/meta-plugin-manager.c +@@ -56,14 +56,22 @@ meta_plugin_manager_set_plugin_type (GType gtype) + void + meta_plugin_manager_load (const gchar *plugin_name) + { +- const gchar *dpath = MUTTER_PLUGIN_DIR "/"; ++ const gchar *env_var; ++ const gchar *dpath; + gchar *path; + MetaModule *module; + ++ env_var = g_getenv ("DEEPIN_MUTTER_PLUGINS_DIR"); ++ g_debug ("$DEEPIN_MUTTER_PLUGINS_DIR: %s\n", env_var); ++ ++ dpath = env_var == NULL || strlen (env_var) == 0 ? MUTTER_PLUGIN_DIR : env_var; ++ g_debug ("dpath: %s\n", dpath); ++ + if (g_path_is_absolute (plugin_name)) + path = g_strdup (plugin_name); + else +- path = g_strconcat (dpath, plugin_name, ".so", NULL); ++ path = g_strconcat (dpath, "/", plugin_name, ".so", NULL); ++ g_debug ("path: %s\n", path); + + module = g_object_new (META_TYPE_MODULE, "path", path, NULL); + if (!module || !g_type_module_use (G_TYPE_MODULE (module))) +-- +2.21.0 + diff --git a/pkgs/desktops/deepin/deepin-mutter/default.nix b/pkgs/desktops/deepin/deepin-mutter/default.nix index fc26440a3ef..47419a8a762 100644 --- a/pkgs/desktops/deepin/deepin-mutter/default.nix +++ b/pkgs/desktops/deepin/deepin-mutter/default.nix @@ -44,8 +44,12 @@ stdenv.mkDerivation rec { xorg.libxkbfile ]; + patches = [ + ./deepin-mutter.plugins-dir.patch + ]; + postPatch = '' - searchHardCodedPaths + searchHardCodedPaths # debugging ''; configureFlags = [ @@ -57,6 +61,10 @@ stdenv.mkDerivation rec { NOCONFIGURE=1 ./autogen.sh ''; + postFixup = '' + searchHardCodedPaths $out # debugging + ''; + enableParallelBuilding = true; passthru.updateScript = deepin.updateScript { inherit name; };