Created
June 18, 2024 18:03
-
-
Save davidlj95/ddb8ba050b3d60f42582f525db5e7245 to your computer and use it in GitHub Desktop.
LuaJIT + luarocks in macOS with brew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luarocks install --tree=$(brew --prefix)/lib/lua/5.1 luasocket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LuaJIT + luarocks in macOS with
brew
Was trying to adapt a plugin for
mpv
. Which useslua
vialuajit
under the hood (as can be seen withbrew deps mpv --tree
). The plugin neededlibposix
&libsocket
lua deps to work.Installed
luarocks
withbrew
, as seems it's the pkg manager for lua. However,luarocks
installslua
at version 5.4 . Whilstmpv
usesluajit
. Which turns out to read packages fromlua
5.1 paths.After trying and trying,
luarocks --lua-version 5.1
was installing packages in my home directory, and not in/opt/homebrew/(lib|share)/lua/5.1
whereluajit
expected them to be.If installing regularly with
luarocks install luaposix
, they are installed to/opt/homebrew/(lib|share)/lua/5.4
.So the command you have there is a quirky workaround you can do to install dependencies for a
brew
installedluajit
/[email protected]
when usingluarocks
frombrew
.Weird, but works