summary refs log tree commit diff
path: root/gnu/packages/patches/obs-modules-location.patch
diff options
context:
space:
mode:
authorAlexey Abramov <levenson@mmer.org>2021-01-15 17:26:37 +0100
committerLudovic Courtès <ludo@gnu.org>2021-02-02 11:05:43 +0100
commit5be01dcdc1c8fa89fd120919258b574c844c13cb (patch)
tree6b104d2c8e05f5c48b009dd31adb7f8cc12cba3f /gnu/packages/patches/obs-modules-location.patch
parent65454c1caa60c8f07833aa920648188ab6bbca85 (diff)
downloadguix-5be01dcdc1c8fa89fd120919258b574c844c13cb.tar.gz
gnu: obs: Use an environment variable for plugins location.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/video.scm (obs): Use it.
* gnu/packages/patches/obs-modules-location.patch: Patch it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/patches/obs-modules-location.patch')
-rw-r--r--gnu/packages/patches/obs-modules-location.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/patches/obs-modules-location.patch b/gnu/packages/patches/obs-modules-location.patch
new file mode 100644
index 0000000000..18b286d006
--- /dev/null
+++ b/gnu/packages/patches/obs-modules-location.patch
@@ -0,0 +1,33 @@
+From d250434e6c8eb4f8c8cb47ef3cc6e6de8fa8f828 Mon Sep 17 00:00:00 2001
+From: Alexey Abramov <levenson@mmer.org>
+Date: Fri, 15 Jan 2021 17:07:17 +0100
+Subject: [PATCH] Use environment variable for a default module location
+
+diff --git a/libobs/obs-nix.c b/libobs/obs-nix.c
+index 382fa0546..481ea0f14 100644
+*** a/libobs/obs-nix.c
+--- b/libobs/obs-nix.c
+@@ -66,8 +66,19 @@
+ 
+ void add_default_module_paths(void)
+ {
+-	for (int i = 0; i < module_patterns_size; i++)
+-		obs_add_module_path(module_bin[i], module_data[i]);
++	char *bin_directory = getenv("OBS_PLUGINS_DIRECTORY");
++	char *data_directory = getenv("OBS_PLUGINS_DATA_DIRECTORY");
++	if (bin_directory && data_directory) {
++		struct dstr dstr_data_directory;
++		dstr_init_copy(&dstr_data_directory, data_directory);
++		dstr_cat(&dstr_data_directory, "/%module%");
++		obs_add_module_path(bin_directory, dstr_data_directory.array);
++		dstr_free(&dstr_data_directory);
++
++	} else {
++		for (int i = 0; i < module_patterns_size; i++)
++			obs_add_module_path(module_bin[i], module_data[i]);
++	}
+ }
+ 
+ /*
+-- 
+2.29.2
\ No newline at end of file