Debian Codegraph @

texk/web2c/luatexdir/luaffi/.travis/install_lua.sh

raw symbols SCIP
1 #!/bin/bash
2
3 set -e
4
5 if [ -z "$PREFIX" ]; then
6 echo "Missing PREFIX"
7 exit 1
8 fi
9
10 if [ -z "$TMPSRC" ]; then
11 echo "Missing TMPSRC"
12 exit 1
13 fi
14
15 export PATH="$PREFIX/bin:$PATH"
16
17 mkdir -p "$PREFIX"
18 mkdir -p "$TMPSRC"
19
20 if [ "$LUA_VERSION" == "LUA51" ]; then
21 URL="http://www.lua.org/ftp/lua-5.1.5.tar.gz"
22 elif [ "$LUA_VERSION" == "LUA52" ]; then
23 URL="http://www.lua.org/ftp/lua-5.2.4.tar.gz"
24 elif [ "$LUA_VERSION" == "LUA53" ]; then
25 URL="http://www.lua.org/ftp/lua-5.3.1.tar.gz"
26 else
27 echo "Invalid Lua version: LUA_VERSION=$LUA_VERSION"
28 exit 1
29 fi
30
31 # Install lua to $PREFIX
32 mkdir -p "$TMPSRC/lua-src" && pushd "$TMPSRC/lua-src"
33 curl "$URL" | tar xz --strip-components 1
34 sed -i -e 's~#define LUA_ROOT.*$~#define LUA_ROOT "'"$PREFIX/"'"~g' src/luaconf.h
35 make PLAT=$PLAT
36 make PLAT=$PLAT INSTALL_TOP="$PREFIX" install
37 popd
38
39 lua -v
40
41 # Install luarocks to $PREFIX
42 mkdir -p "$TMPSRC/luarocks-src" && pushd "$TMPSRC/luarocks-src"
43 curl --location "http://luarocks.org/releases/luarocks-2.2.2.tar.gz" | tar xz --strip-components 1
44 ./configure --prefix="$PREFIX"
45 make install
46 popd
47
48 luarocks --version
49