Kong / homebrew-kong

:monkey: Homebrew tap for Kong
https://getkong.org
69 stars 30 forks source link

fix(m1) add /opt/homebrew prefix to path and cpath #185

Closed gszr closed 2 years ago

gszr commented 2 years ago

Summary

Homebrew on Apple M1 uses the prefix /opt/homebrew. This PR ensures LUA_PATH and LUA_CPATH are set appropriately in such case. (On Intel, homebrew uses /usr/local as its default prefix; as LuaJIT includes /usr/local/share/lua/5.1/ in its default list of Lua paths, the formula worked without the need for a patch.)

Additionally, the default Kong prefix is set to HOMEBREW_PREFIX rather than being hardcoded to /usr/local/opt/kong/ (which isn't writeable by Brew on M1).

Fixes Kong/kong#7705.

gszr commented 2 years ago

I will run this once again in an m1 environment then we can merge it. Thanks for reviewing, @fffonion!