@@ -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.4 /?/init.lua;$host_luarocks_tree /share/lua/5.4 /?.lua;$host_luarocks_tree /share/lua/5.1/?/init.lua;;"
2627
2728ROCKS_CONFIG=" luarocks_make_config.lua"
2829cat << EOF > $ROCKS_CONFIG
@@ -40,19 +41,23 @@ 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";
5153}
5254EOF
55+ # make the config also available for interpreter lua too
56+ cp $rocks_tree /etc/luarocks/config-5.1.lua $rocks_tree /etc/luarocks/config-5.4.lua
5357
5458sed -i -e " s|$build_destdir |$install_destdir |g" $rocks_tree /bin/luarocks
5559sed -i -e " s|$rocks_tree |$install_destdir |g" $rocks_tree /bin/luarocks
60+ sed -i -e " s|openresty/luajit/bin/luajit|kong/bin/lua|" $rocks_tree /bin/luarocks
5661
5762# only generate the output when the command succeeds
5863mv $@ .tmp $@
0 commit comments