Skip to content

Commit

Permalink
change: don't hack the prefix of LuaRocks (apache#3508)
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored Feb 3, 2021
1 parent a6358ea commit c8139fc
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions .travis/linux_apisix_master_luarocks_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ script() {

# install APISIX by luarocks
sudo luarocks install $APISIX_MAIN > build.log 2>&1 || (cat build.log && exit 1)
cp ../bin/apisix /usr/local/bin/apisix

# show install files
luarocks show apisix
Expand Down
3 changes: 0 additions & 3 deletions apisix/cli/apisix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ local pkg_path_org = package.path
local apisix_home = "/usr/local/apisix"
local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
.. apisix_home .. "/deps/lib/lua/5.1/?.so;"
.. "/usr/lib64/lua/5.1/?.so;"
.. "/usr/lib/lua/5.1/?.so;;"
local pkg_path = apisix_home .. "/deps/share/lua/5.1/?.lua;"
.. "/usr/share/lua/5.1/?.lua;;"

-- modify the load path to load our dependencies
package.cpath = pkg_cpath .. pkg_cpath_org
Expand Down
6 changes: 0 additions & 6 deletions apisix/cli/ngx_tpl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ env {*name*};
{% if stream_proxy then %}
stream {
lua_package_path "{*extra_lua_path*}$prefix/deps/share/lua/5.1/?.lua;$prefix/deps/share/lua/5.1/?/init.lua;]=]
.. [=[/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;]=]
.. [=[{*apisix_lua_home*}/?.lua;{*apisix_lua_home*}/?/init.lua;;{*lua_path*};";
lua_package_cpath "{*extra_lua_cpath*}$prefix/deps/lib64/lua/5.1/?.so;]=]
.. [=[$prefix/deps/lib/lua/5.1/?.so;;]=]
.. [=[/usr/lib64/lua/5.1/?.so;]=]
.. [=[/usr/lib/lua/5.1/?.so;]=]
.. [=[{*lua_cpath*};";
lua_socket_log_errors off;
Expand Down Expand Up @@ -123,12 +120,9 @@ http {
# put extra_lua_path in front of the builtin path
# so user can override the source code
lua_package_path "{*extra_lua_path*}$prefix/deps/share/lua/5.1/?.lua;$prefix/deps/share/lua/5.1/?/init.lua;]=]
.. [=[/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;]=]
.. [=[{*apisix_lua_home*}/?.lua;{*apisix_lua_home*}/?/init.lua;;{*lua_path*};";
lua_package_cpath "{*extra_lua_cpath*}$prefix/deps/lib64/lua/5.1/?.so;]=]
.. [=[$prefix/deps/lib/lua/5.1/?.so;;]=]
.. [=[/usr/lib64/lua/5.1/?.so;]=]
.. [=[/usr/lib/lua/5.1/?.so;]=]
.. [=[{*lua_cpath*};";
lua_shared_dict internal_status 10m;
Expand Down
4 changes: 2 additions & 2 deletions bin/apisix
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
if [ -s './apisix/cli/apisix.lua' ]; then
# install via source
APISIX_LUA=./apisix/cli/apisix.lua
elif [ -s '/usr/share/lua/5.1/apisix/cli/apisix.lua' ]; then
elif [ -s '/usr/local/share/lua/5.1/apisix/cli/apisix.lua' ]; then
# install via luarock
APISIX_LUA=/usr/share/lua/5.1/apisix/cli/apisix.lua
APISIX_LUA=/usr/local/share/lua/5.1/apisix/cli/apisix.lua
elif [ -s '/usr/local/apisix/deps/share/lua/5.1/apisix/cli/apisix.lua' ]; then
# install via shell
APISIX_LUA=/usr/local/apisix/deps/share/lua/5.1/apisix/cli/apisix.lua
Expand Down
2 changes: 1 addition & 1 deletion utils/linux-install-luarocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else
WITH_LUA_OPT=
fi

./configure --prefix=/usr $WITH_LUA_OPT \
./configure $WITH_LUA_OPT \
> build.log 2>&1 || (cat build.log && exit 1)

make build > build.log 2>&1 || (cat build.log && exit 1)
Expand Down

0 comments on commit c8139fc

Please sign in to comment.