[vlc-commits] dirs: add VLC_LIB_PATH environment variable
Rémi Denis-Courmont
git at videolan.org
Thu Feb 8 23:16:13 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 7 23:33:17 2018 +0200| [75308a48f28fe67290d6f579657442e303452320] | committer: Rémi Denis-Courmont
dirs: add VLC_LIB_PATH environment variable
This works essentially like VLC_DATA_PATH; it handles executables and
other architecture-dependent files. The use case is also essentially
the same - override installation path for in-tree execution.
Note: for the time being, VLC_PLUGIN_PATH trumps VLC_LIB_PATH for the
purpose of finding LibVLC plugins.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=75308a48f28fe67290d6f579657442e303452320
---
src/linux/dirs.c | 4 +++-
src/posix/dirs.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/linux/dirs.c b/src/linux/dirs.c
index 48ecb2c326..70753da967 100644
--- a/src/linux/dirs.c
+++ b/src/linux/dirs.c
@@ -33,7 +33,9 @@
static char *config_GetLibDirRaw(void)
{
- char *path = NULL;
+ char *path = getenv("VLC_LIB_PATH");
+ if (path != NULL)
+ return strdup(path);
/* Find the path to libvlc (i.e. ourselves) */
FILE *maps = fopen ("/proc/self/maps", "rte");
diff --git a/src/posix/dirs.c b/src/posix/dirs.c
index 31f4a17530..cfa1f22440 100644
--- a/src/posix/dirs.c
+++ b/src/posix/dirs.c
@@ -54,7 +54,8 @@ char *config_GetDataDir (void)
*/
char *config_GetLibDir (void)
{
- return strdup (PKGLIBDIR);
+ const char *path = getenv("VLC_LIB_PATH");
+ return strdup((path != NULL) ? path : PKGLIBDIR);
}
#endif
More information about the vlc-commits
mailing list