[TOOL] LÖVERocks - A package manager manager

Showcase your libraries, tools and other projects that help your fellow love users.
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

[TOOL] LÖVERocks - A package manager manager

Post by alloyed »

So LÖVERocks is a command-line wrapper around luarocks that teaches your LÖVE projects how to download and use standard luarocks packages.
Code, documentation, issue tracker, etc. is on github:
https://github.com/Alloyed/loverocks
The release page is on luarocks:
https://luarocks.org/modules/alloyed/loverocks
The most current public release is v0.0.8

The early release is mostly just gentle encouragement for library writers to make and upload rockspecs. Even if you don't plan to use loverocks, the love ecosystem can only benefit from having some form of machine-installable package.

At this point (0.0.8), I've used loverocks on a game or two, and (in my workflow at least), it works just fine, even between love version upgrades. If you haven't tried it out yet, now would be a good time~

Since I couldn't find any love libraries that were already packaged as rocks I quickly packaged a few for my own personal use. You can use them yourself by passing

Code: Select all

--server="https://alloyed.me/shared/rocks"
to your loverocks commands, and you can view their rockspecs as examples of how to package for loverocks.

Feedback, PRs, etc. welcomed.
Last edited by alloyed on Sun Jan 10, 2016 9:31 pm, edited 6 times in total.
User avatar
CrackedP0t
Citizen
Posts: 69
Joined: Wed May 07, 2014 4:01 am
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by CrackedP0t »

Whoa. This looks really useful. I'll definitely remember this for my next project.
(Also: to library makers, you should put your libraries on LuaRocks! It would make them way easier to install and use.)
/人 ◕‿‿◕ 人\
Here, have an umlaut. Ö
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: [TOOL] LÖVERocks - A package manager manager

Post by I~=Spam »

Hmmm this seems very interesting! Does luarocks prevent libraries that are dependant on LOVE from being posted? If not then can't LOVE library creators just post their libs on the luarocks database. That would make this lib pretty pointless wouldn't it? :( (I don't know the rules for libs in the luarocks database so feel free to enlighten me :) )
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by alloyed »

I~=Spam wrote:Hmmm this seems very interesting! Does luarocks prevent libraries that are dependant on LOVE from being posted? If not then can't LOVE library creators just post their libs on the luarocks database. That would make this lib pretty pointless wouldn't it? :( (I don't know the rules for libs in the luarocks database so feel free to enlighten me :) )
You can totally upload your libraries to luarocks.org. The only problem is that luarocks is an OS package manager, meaning by default it looks at your OS to see where it should install packages, run them, etc. All loverocks does is trick luarocks into thinking the entire OS is your game, so it only installs modules into your game, it checks to see if they're compatible with your version of LOVE, etc.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: [TOOL] LÖVERocks - A package manager manager

Post by bobbyjones »

Oh cool
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: [TOOL] LÖVERocks - A package manager manager

Post by I~=Spam »

alloyed wrote:You can totally upload your libraries to luarocks.org. The only problem is that luarocks is an OS package manager, meaning by default it looks at your OS to see where it should install packages, run them, etc. All loverocks does is trick luarocks into thinking the entire OS is your game, so it only installs modules into your game, it checks to see if they're compatible with your version of LOVE, etc.
Ahhh. Very good idea! :)
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by bartbes »

This looks good, I think the love community could really use something like this!

By the way, I noticed you made rockspecs for LUBE and repler, do I have your permission to add them to my own repos?
alloyed
Citizen
Posts: 80
Joined: Thu May 28, 2015 8:45 pm
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by alloyed »

bartbes wrote:This looks good, I think the love community could really use something like this!

By the way, I noticed you made rockspecs for LUBE and repler, do I have your permission to add them to my own repos?
Go ahead, and that applies to anybody else who wants to take the one the example rockspecs for their own code. If you do choose to make them yourself I doubt the result would be much different~
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by bartbes »

Awesome, I just added them to my repo.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: [TOOL] LÖVERocks - A package manager manager

Post by bartbes »

So I figured I'd give this a go.. it didn't work:

Code: Select all

[bartbes@archery async-futures]$ loverocks init
ERROR: NYI. For now, try making an empty project with `loverocks new` and moving your code into the result.

Code: Select all

[bartbes@archery love-misc-libs]$ loverocks new futures
Found LOVE version 0.9.2
Using template "love9"
/usr/bin/lua5.1: ...e/bartbes/.luarocks/share/lua/5.1/loverocks/util.lua:30: bad argument #1 to 'attributes' (string expected, got nil)
stack traceback:
	[C]: in function 'attributes'
	...e/bartbes/.luarocks/share/lua/5.1/loverocks/util.lua:30: in function 'slurp'
	...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:71: in function <...s/.luarocks/share/lua/5.1/loverocks/commands/new.lua:62>
	(tail call): ?
	...b/luarocks/rocks-5.1/loverocks/0.0.3-1/bin/loverocks:3: in main chunk
	[C]: ?

Code: Select all

[bartbes@archery futures]$ loverocks install

Missing dependencies for futures:
love ~> 0.9


Error: Could not satisfy dependency: love ~> 0.9
I'm sure some/all of it is my fault, but it wasn't exactly a nice first experience.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests