@@ -6,7 +6,7 @@ install_destdir="{{install_destdir}}"
66build_destdir=" {{build_destdir}}"
77
88luarocks_exec=" {{@@luarocks//:luarocks_exec}}"
9- luajit_path =" {{@@openresty //:luajit }}"
9+ lua_path =" {{@@lua //:lua }}"
1010luarocks_host_path=" {{@@luarocks//:luarocks_host}}"
1111luarocks_wrap_script=" {{@@//build/luarocks:luarocks_wrap_script.lua}}"
1212# template variables ends
@@ -19,7 +19,7 @@ $luarocks_exec install "luarocks $luarocks_version"
1919
2020# use host configuration to invoke luarocks API to wrap a correct bin/luarocks script
2121rocks_tree=$( dirname $luarocks_exec ) /luarocks_tree
22- host_luajit= $luajit_path /bin/luajit
22+ host_lua= $lua_path /bin/lua
2323
2424host_luarocks_tree=$luarocks_host_path
2525export 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;;"
@@ -32,7 +32,7 @@ rocks_trees = {
3232EOF
3333export LUAROCKS_CONFIG=$ROCKS_CONFIG
3434
35- $host_luajit $luarocks_wrap_script \
35+ $host_lua $luarocks_wrap_script \
3636 luarocks $rocks_tree $install_destdir > $@ .tmp 2>&1
3737
3838# write the luarocks config with host configuration
@@ -42,13 +42,14 @@ cat << EOF > $rocks_tree/etc/luarocks/config-5.1.lua
4242rocks_trees = {
4343 { name = "user", root = home .. "/.luarocks" };
4444 { name = "system", root = "$install_destdir " };
45- }
46- lua_interpreter = "luajit";
47- variables = {
45+ };
46+ lua_version = "5.1";
47+ lua_interpreter = "luajit";
48+ variables = {
4849 LUA_DIR = "$install_destdir /openresty/luajit";
4950 LUA_INCDIR = "$install_destdir /openresty/luajit/include/luajit-2.1";
5051 LUA_BINDIR = "$install_destdir /openresty/luajit/bin";
51- }
52+ };
5253EOF
5354
5455sed -i -e " s|$build_destdir |$install_destdir |g" $rocks_tree /bin/luarocks
0 commit comments