@@ -7,6 +7,7 @@ build_destdir="{{build_destdir}}"
77
88luarocks_exec=" {{@@luarocks//:luarocks_exec}}"
99luajit_path=" {{@@openresty//:luajit}}"
10+ lua_path=" {{@@lua//:lua}}"
1011luarocks_host_path=" {{@@luarocks//:luarocks_host}}"
1112luarocks_wrap_script=" {{@@//build/luarocks:luarocks_wrap_script.lua}}"
1213# template variables ends
@@ -22,7 +23,7 @@ rocks_tree=$(dirname $luarocks_exec)/luarocks_tree
2223host_luajit=$luajit_path /bin/luajit
2324
2425host_luarocks_tree=$luarocks_host_path
25- export LUA_PATH=" $build_destdir /share/lua/5.1/?.lua;$build_destdir /share/lua/5.1/?/init.lua;$host_luarocks_tree /share/lua/5.1 /?.lua;$host_luarocks_tree /share/lua/5.1 /?/init.lua;;"
26+ export LUA_PATH=" $build_destdir /share/lua/5.1/?.lua;$build_destdir /share/lua/5.1/?/init.lua;$host_luarocks_tree /share/lua/5.4 /?.lua;$host_luarocks_tree /share/lua/5.4 /?/init.lua;;"
2627
2728ROCKS_CONFIG=" luarocks_make_config.lua"
2829cat << EOF > $ROCKS_CONFIG
@@ -40,11 +41,12 @@ mkdir -p $rocks_tree/etc/luarocks
4041cat << EOF > $rocks_tree /etc/luarocks/config-5.1.lua
4142-- LuaRocks configuration
4243rocks_trees = {
43- { name = "user", root = home .. "/.luarocks" };
44- { name = "system", root = "$install_destdir " };
45- }
46- lua_interpreter = "luajit";
47- variables = {
44+ { name = "user", root = home .. "/.luarocks" };
45+ { name = "system", root = "$install_destdir " };
46+ }
47+ lua_version = "5.1";
48+ lua_interpreter = "luajit";
49+ variables = {
4850 LUA_DIR = "$install_destdir /openresty/luajit";
4951 LUA_INCDIR = "$install_destdir /openresty/luajit/include/luajit-2.1";
5052 LUA_BINDIR = "$install_destdir /openresty/luajit/bin";
5355
5456sed -i -e " s|$build_destdir |$install_destdir |g" $rocks_tree /bin/luarocks
5557sed -i -e " s|$rocks_tree |$install_destdir |g" $rocks_tree /bin/luarocks
58+ # path shift as the interpreter we use here is having different prefix (lua/bin/lua) while we are installing to KONG_PREFIX/kong/bin/lua
59+ sed -i -e " s|lua/bin/lua|kong/bin/lua|" $rocks_tree /bin/luarocks
5660
5761# only generate the output when the command succeeds
5862mv $@ .tmp $@
0 commit comments