gen.lua (1801B)
1 set('version', 'v0.9') 2 cflags({ 3 '-std=c99', 4 '-D CONFIG_HELP=1', 5 '-D CONFIG_CURSES=0', 6 '-D CONFIG_LUA=1', 7 '-D CONFIG_LPEG=1', 8 '-D CONFIG_TRE=0', 9 '-D CONFIG_SELINUX=0', 10 '-D CONFIG_ACL=0', 11 '-D HAVE_MEMRCHR=1', 12 '-D _XOPEN_SOURCE=700', 13 [[-D 'VERSION="$version"']], 14 string.format([[-D 'VIS_PATH="%s/share/vis"']], config.prefix), 15 '-D NDEBUG', 16 '-I $outdir', 17 '-isystem $builddir/pkg/lang/lua/include', 18 '-isystem $builddir/pkg/libs/libtermkey/include', 19 }) 20 21 build('copy', '$outdir/config.h', '$srcdir/config.def.h') 22 23 pkg.deps = { 24 '$outdir/config.h', 25 'pkg/lang/lua/headers', 26 'pkg/libs/libtermkey/headers', 27 } 28 29 exe('vis', [[ 30 array.c 31 buffer.c 32 libutf.c 33 main.c 34 map.c 35 sam.c 36 text.c 37 text-common.c 38 text-io.c 39 text-iterator.c 40 text-motions.c 41 text-objects.c 42 text-util.c 43 ui-terminal.c 44 view.c 45 vis.c 46 vis-lua.c 47 vis-marks.c 48 vis-modes.c 49 vis-motions.c 50 vis-operators.c 51 vis-prompt.c 52 vis-registers.c 53 vis-subprocess.c 54 vis-text-objects.c 55 text-regex.c 56 $builddir/pkg/lang/lua/liblua.a 57 $builddir/pkg/libs/libtermkey/libtermkey.a.d 58 $builddir/pkg/libs/lpeg/liblpeg.a 59 ]]) 60 61 exe('vis-digraph', {'vis-digraph.c'}) 62 exe('vis-menu', {'vis-menu.c'}) 63 64 for _, b in ipairs({'vis', 'vis-digraph', 'vis-menu'}) do 65 file('bin/'..b, '755', '$outdir/'..b) 66 build('sed', '$outdir/'..b..'.1', '$srcdir/man/'..b..'.1', {expr='s,VERSION,$version,'}) 67 man({'$outdir/'..b.. '.1'}) 68 end 69 70 for _, s in ipairs({'vis-complete', 'vis-clipboard', 'vis-open'}) do 71 file('bin/'..s, '755', '$srcdir/'..s) 72 build('sed', '$outdir/'..s..'.1', '$srcdir/man/'..s..'.1', {expr='s,VERSION,$version,'}) 73 man({'$outdir/'..s.. '.1'}) 74 end 75 76 for f in iterlines('lua.txt') do 77 file('share/vis/'..f, '644', '$srcdir/lua/'..f) 78 end 79 sym('share/vis/lexer.lua', 'lexers/lexer.lua') 80 sym('share/vis/themes/default.lua', 'base-16.lua') 81 82 fetch('git')