Page 1 of 4

[TOOL] LÖVERocks - A package manager manager

Posted: Sat May 30, 2015 9:13 pm
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.

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

Posted: Sun May 31, 2015 12:48 am
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.)

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

Posted: Sun May 31, 2015 3:33 pm
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 :) )

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

Posted: Sun May 31, 2015 5:50 pm
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.

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

Posted: Sun May 31, 2015 5:53 pm
by bobbyjones
Oh cool

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

Posted: Sun May 31, 2015 9:07 pm
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! :)

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

Posted: Sun May 31, 2015 9:19 pm
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?

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

Posted: Wed Jun 03, 2015 4:37 am
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~

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

Posted: Wed Jun 03, 2015 12:02 pm
by bartbes
Awesome, I just added them to my repo.

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

Posted: Mon Jun 08, 2015 2:15 pm
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.