Page 1 of 2

How to use a LuaRocks project with a LÖVE one?

Posted: Tue Jun 30, 2015 9:30 pm
by adnzzzzZ
I've installed this project using LuaRocks https://github.com/jgm/lunamark and I'd like to know how I can integrate it with my LÖVE project. If I open up the Lua interpreter I can use Lunamark just fine, but trying to require it on the LÖVE project doesn't work. I'm aware that https://github.com/Alloyed/loverocks exists but I'd like to know a normal method that doesn't rely on that library specifically.

Thanks!

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 4:26 am
by ejmr
Can you post some example code that fails? I installed Lunamark through Luarocks and I can require() it in a LÖVE project without error (although Lunamark itself breaks on a bug inside its Markdown reader).

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 5:12 am
by adnzzzzZ
Sure, here: Image

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 5:34 am
by ejmr
Sorry but I'm not familiar with the paths Luarocks uses on Windows. It might help to print(package.path) from within Lua to see all the places it's searching for lunamark and then append that to package.path in LÖVE before you try to require() the package.

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 6:47 am
by adnzzzzZ
Will that help me when I need to distribute the application to other people though?

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 8:01 am
by Muzz
When you distribute, you just grab the .dll manually and put it in the same folder as love.exe

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 1:36 pm
by bartbes
To use luarocks, you typically need to first add its loader:

Code: Select all

require "luarocks.loader"
I would recommend you look into loverocks, it does a lot of the work for you, though I still haven't found a nice "distribute" function yet. (Though it is at most as much work as it would be with luarocks.)

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 2:46 pm
by adnzzzzZ
Muzz wrote:When you distribute, you just grab the .dll manually and put it in the same folder as love.exe
I can't find any lunamark.dll. The only executable lunamark file I can find is a command line script written in Lua:

Image

And a batch script:

Image
bartbes wrote:To use luarocks, you typically need to first add its loader:

Code: Select all

require "luarocks.loader"
Trying to require "luarocks.loader" results in the same error as trying to require lunamark.

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Wed Jul 01, 2015 3:26 pm
by Muzz
Hmm i thought that luarocks would download the dll.

Perhaps you need to build it using the make file though?

Re: How to use a LuaRocks project with a LÖVE one?

Posted: Sat Nov 11, 2023 12:26 am
by ohthepain
I get
➜ test2 git:(main) ✗ luarocks install loverocks
Warning: falling back to wget - install luasec to get native HTTPS support

Error: No results matching query were found for Lua 5.4.
To check if it is available for other Lua versions, use --check-lua-versions.
How do I install lovelocks on macOS, Lua 5.4.6?