OpenWrt Forum Archive

Topic: New OpenWRT package: luarocks

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to package LuaRocks, a deployment and management system for Lua modules, for OpenWRT, hoping to use it to enable porting some interesting projects from the Kepler project like the Sputnik wiki/CMS.

Thanks to the OpenWRT's incredibly versatile build system (thanks guys!) this doesn't seem to be very difficult at all. However, I do have a few questions about packaging in general and about packaging LuaRocks in particular.

First, when and when not to declare conffiles? LuaRocks uses /etc/luarocks/config.lua to store settings like where Lua rocks should be installed. This should be able to be changed by the user, so I've declared it as a conffile. But what happens when the packaged file contents change in newer versions? Debian apt has tools to assist in merging newer content, how about OpenWRT? Or should the user be prepared to simply force reinstall the package to pick up the changes?

Second, although there are some platform-independent, pure Lua rocks in the repository, many of them actually need to be 'made' (i.e. their non-Lua sources cross-compiled on the host) into binary or mixed rocks, in order to be installable on a target like OpenWRT.
How do I define this in my package Makefile? I think that I will need to use the STAGING_DIR and templates like Host/Build, but I've no experience yet with using them.

I will post my initial attempt at a package patch in a new ticket. Any help and suggestions will be much appreciated.

THX for your effort. If you really want people to use your tool, you should put something in the wiki.

Now the easiest way to find packages, is ''opkg info xxx''. But then? There are already 2000 packages in the repos, we cannot (and need not) explain them all in the wiki. However, some could use some explanation, some HowTo and at the same time some advertising.

If you want people to bother themselves with OpenWrt and Lua on OpenWrt, you will have to lay some breadcrumbs out there. Doesn't need to much effort.

Thanks for the suggestion :-) I'll definitely try to add some interesting info to the Wiki.
Since OpenWRT so openly embraces Lua (with LuCI and the web interface), it's definitely worth trying to interest more people in working with Lua. Packaging LuaRocks builds a nice bridge to this well known Lua repository and its projects.

Some very common Lua support packages are already in OpenWRT, enabling these OpenWRT packages to register themselves as Lua rocks (only when requested, and only if LuaRocks itself is already installed) during their normal opkg install process will make it much easier to port things such as Sputnik, Xavante etc. without having to mess with their dependency checking and installation procedures.

(Last edited by ack on 23 Feb 2011, 23:37)

Could anyone compile/build lprng package for OpenWRT backfire?
I can't manage this. Please help. Thanks!

dumghen wrote:

Could anyone compile/build lprng package for OpenWRT backfire?
I can't manage this. Please help. Thanks!

Please don't do this! Write him a "HowTo" instead.

Because, ye know, if you give a man a decent meal, then he gets fat'n'lazy, but if you teach him how to cook, he will go hunt animals and cook'em.

Ok, then write a howto (recent and up to date) how to build a package (lprng in my case).
I've spent 1 week and no success. There are many "howtos" outdated.
I'm using Bakcfire 10.03.1-rc4.
Do you know when 10.03.1 will be released (final)?

Though this post was old. I just wonder know if anyone did make the luarocks builtin and run it successfully.

Luarocks requires gcc to compile certain modules. gcc is not available for the target.

The discussion might have continued from here.