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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

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

Post 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!
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

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

Post 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).
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

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

Post by adnzzzzZ »

Sure, here: Image
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

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

Post 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.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

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

Post by adnzzzzZ »

Will that help me when I need to distribute the application to other people though?
Muzz
Citizen
Posts: 54
Joined: Sun Jun 28, 2015 1:24 pm

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

Post by Muzz »

When you distribute, you just grab the .dll manually and put it in the same folder as love.exe
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.)
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

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

Post 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.
Muzz
Citizen
Posts: 54
Joined: Sun Jun 28, 2015 1:24 pm

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

Post by Muzz »

Hmm i thought that luarocks would download the dll.

Perhaps you need to build it using the make file though?
ohthepain
Prole
Posts: 2
Joined: Sat Nov 11, 2023 12:21 am

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

Post 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?
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], eaaakb, Google [Bot] and 3 guests