all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 18b286d006e413152430532aa4ba19abdc3f7348 1063 bytes (raw)
name: gnu/packages/patches/obs-modules-location.patch 	 # note: path name is non-authoritative(*)

 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
 
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

debug log:

solving 18b286d006 ...
found 18b286d006 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.