blob: 4e1130aee8d99fdf34c5dde31d4152c0292ddadb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
From f77bb3648eb998b9225499f85463fcbbda305474 Mon Sep 17 00:00:00 2001
From: Alexey Abramov <levenson@mmer.org>
Date: Sat, 19 Jul 2025 11:08:04 +0200
Subject: [PATCH] Use environment variable for a default module location
diff --git a/libobs/obs-nix.c b/libobs/obs-nix.c
index d28269687..a0950a0b1 100644
--- a/libobs/obs-nix.c
+++ b/libobs/obs-nix.c
@@ -67,26 +67,18 @@ static const struct obs_nix_hotkeys_vtable *hotkeys_vtable = NULL;
void add_default_module_paths(void)
{
- char *module_bin_path = os_get_executable_path_ptr("../" OBS_PLUGIN_PATH);
- char *module_data_path = os_get_executable_path_ptr("../" OBS_DATA_PATH "/obs-plugins/%module%");
+ 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);
- if (module_bin_path && module_data_path) {
- char *abs_module_bin_path = os_get_abs_path_ptr(module_bin_path);
- char *abs_module_install_path = os_get_abs_path_ptr(OBS_INSTALL_PREFIX "/" OBS_PLUGIN_DESTINATION);
-
- if (abs_module_bin_path &&
- (!abs_module_install_path || strcmp(abs_module_bin_path, abs_module_install_path) != 0)) {
- obs_add_module_path(module_bin_path, module_data_path);
- }
- bfree(abs_module_install_path);
- bfree(abs_module_bin_path);
- }
-
- bfree(module_bin_path);
- bfree(module_data_path);
-
- for (int i = 0; i < module_patterns_size; i++) {
- obs_add_module_path(module_bin[i], module_data[i]);
+ } else {
+ for (int i = 0; i < module_patterns_size; i++)
+ obs_add_module_path(module_bin[i], module_data[i]);
}
}
--
2.50.1
|