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 hidden or 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LuaJIT + luarocks in macOS with
brewWas trying to adapt a plugin for
mpv. Which usesluavialuajitunder the hood (as can be seen withbrew deps mpv --tree). The plugin neededlibposix&libsocketlua deps to work.Installed
luarockswithbrew, as seems it's the pkg manager for lua. However,luarocksinstallsluaat version 5.4 . Whilstmpvusesluajit. Which turns out to read packages fromlua5.1 paths.After trying and trying,
luarocks --lua-version 5.1was installing packages in my home directory, and not in/opt/homebrew/(lib|share)/lua/5.1whereluajitexpected 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
brewinstalledluajit/[email protected]when usingluarocksfrombrew.Weird, but works