unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 4c7d116e3f98e618ad3ba05d2e07fd49735cbdb2 1755 bytes (raw)
name: gnu/packages/patches/zathura-plugindir-environment-variable.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
33
34
35
36
37
38
39
40
41
42
43
44
 
From f41ea6573185ec326870004e579354e5dd829672 Mon Sep 17 00:00:00 2001
From: Paul van der Walt <paul@denknerd.org>
Date: Sun, 1 Mar 2015 22:57:43 +0100
Subject: [PATCH] Search for Zathura plugins (for reading different file
 formats) in the environment variable ZATHURA_PLUGIN_DIR. Command line option
 -p still takes precedence.

Patch by Paul van der Walt <paul@denknerd.org>.
---
 zathura/zathura.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/zathura/zathura.c b/zathura/zathura.c
index 589dd28..d3c9887 100644
--- a/zathura/zathura.c
+++ b/zathura/zathura.c
@@ -413,12 +413,24 @@ zathura_set_plugin_dir(zathura_t* zathura, const char* dir)
   g_return_if_fail(zathura != NULL);
   g_return_if_fail(zathura->plugins.manager != NULL);
 
+  // Get the new environment variable, if any.
+  const gchar* envvar_plugin_dir = g_getenv("ZATHURA_PLUGIN_DIR");
+
   if (dir != NULL) {
+    // This bit sets the plugin dir from command-line.
     girara_list_t* paths = girara_split_path_array(dir);
     GIRARA_LIST_FOREACH(paths, char*, iter, path)
     zathura_plugin_manager_add_dir(zathura->plugins.manager, path);
     GIRARA_LIST_FOREACH_END(paths, char*, iter, path);
     girara_list_free(paths);
+  } else if (envvar_plugin_dir != NULL) {
+    // Set plugins dir to the contents of environment variable
+    // ZATHURA_PLUGIN_DIR.
+    girara_list_t* paths = girara_split_path_array(envvar_plugin_dir);
+    GIRARA_LIST_FOREACH(paths, char*, iter, path)
+    zathura_plugin_manager_add_dir(zathura->plugins.manager, path);
+    GIRARA_LIST_FOREACH_END(paths, char*, iter, path);
+    girara_list_free(paths);
   } else {
 #ifdef ZATHURA_PLUGINDIR
     girara_list_t* paths = girara_split_path_array(ZATHURA_PLUGINDIR);
-- 
2.3.1


debug log:

solving 4c7d116 ...
found 4c7d116 in https://yhetil.org/guix-devel/1425253673-32604-3-git-send-email-paul@denknerd.org/ ||
	https://yhetil.org/guix-devel/1425290046-9612-4-git-send-email-paul@denknerd.org/ ||
	https://yhetil.org/guix-devel/874mq4iayt.fsf@denknerd.org/

applying [1/1] https://yhetil.org/guix-devel/1425253673-32604-3-git-send-email-paul@denknerd.org/
diff --git a/gnu/packages/patches/zathura-plugindir-environment-variable.patch b/gnu/packages/patches/zathura-plugindir-environment-variable.patch
new file mode 100644
index 0000000..4c7d116

1:26: trailing whitespace.
 
1:48: trailing whitespace.
-- 
Checking patch gnu/packages/patches/zathura-plugindir-environment-variable.patch...
1:50: new blank line at EOF.
+
Applied patch gnu/packages/patches/zathura-plugindir-environment-variable.patch cleanly.
warning: 3 lines add whitespace errors.

skipping https://yhetil.org/guix-devel/1425290046-9612-4-git-send-email-paul@denknerd.org/ for 4c7d116
skipping https://yhetil.org/guix-devel/874mq4iayt.fsf@denknerd.org/ for 4c7d116
index at:
100644 4c7d116e3f98e618ad3ba05d2e07fd49735cbdb2	gnu/packages/patches/zathura-plugindir-environment-variable.patch

(*) 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).