deepin.deepin-mutter: set plugins dir from environment variable

This commit is contained in:
José Romildo Malaquias 2019-04-20 08:51:44 -03:00
parent 1c137e36ea
commit d5a188d4d6
2 changed files with 50 additions and 1 deletions

View file

@ -0,0 +1,41 @@
From 8eeb4febcae517080d6638f8953e02335df79f01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
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

View file

@ -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; };