diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 21:31:56 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-20 21:31:56 +0200 |
| commit | 348eb8074fe0d314ca08fa39f4584019621e3f92 (patch) | |
| tree | 263918474b6f832479be27ed5ae1e5908b0801f8 | |
| parent | aaefca67b304688efb0f4c893aab469d61f8f0bf (diff) | |
| download | vis-348eb8074fe0d314ca08fa39f4584019621e3f92.tar.gz vis-348eb8074fe0d314ca08fa39f4584019621e3f92.tar.xz | |
vis-lua: load files from directory specified with ./configure --sharedir=DIR
Close #231
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | vis-lua.c | 10 |
2 files changed, 9 insertions, 6 deletions
@@ -8,8 +8,8 @@ SRC = array.c buffer.c libutf.c main.c map.c register.c ring-buffer.c \ # conditionally initialized, this is needed for standalone build # with empty config.mk PREFIX ?= /usr/local -MANPREFIX ?= ${PREFIX}/share/man -SHAREPREFIX ?= ${PREFIX}/share/vis +SHAREPREFIX ?= ${PREFIX}/share +MANPREFIX ?= ${PREFIX}/man VERSION = $(shell git describe 2>/dev/null || echo "0.2") @@ -24,6 +24,7 @@ CFLAGS_VIS = $(CFLAGS_AUTO) $(CFLAGS_TERMKEY) $(CFLAGS_CURSES) $(CFLAGS_ACL) \ $(CFLAGS_SELINUX) $(CFLAGS_LUA) $(CFLAGS_STD) CFLAGS_VIS += -DVERSION=\"${VERSION}\" +CFLAGS_VIS += -DVIS_PATH=\"${SHAREPREFIX}/vis\" CFLAGS_VIS += -DCONFIG_LUA=${CONFIG_LUA} CFLAGS_VIS += -DCONFIG_SELINUX=${CONFIG_SELINUX} CFLAGS_VIS += -DCONFIG_ACL=${CONFIG_ACL} @@ -11,6 +11,10 @@ #include "vis-core.h" #include "text-motions.h" +#ifndef VIS_PATH +#define VIS_PATH "/usr/local/share/vis" +#endif + #if !CONFIG_LUA void vis_lua_init(Vis *vis) { } @@ -985,14 +989,12 @@ void vis_lua_init(Vis *vis) { * - $VIS_PATH/{,lexers} * - {,lexers} relative to the binary location * - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers}) - * - /usr/local/share/vis/{,lexers} - * - /usr/share/vis/{,lexers} + * - /usr/local/share/vis/{,lexers} (or whatever is specified during ./configure) * - package.path (standard lua search path) */ char path[PATH_MAX]; - vis_lua_path_add(vis, "/usr/share/vis"); - vis_lua_path_add(vis, "/usr/local/share/vis"); + vis_lua_path_add(vis, VIS_PATH); /* try to get users home directory */ const char *home = getenv("HOME"); |
