On Mon, Sep 12, 2011 at 5:21 PM, Reuben Thomas <r...@sc3d.org> wrote:
> Hi,
>
> I want to update the luarock for luaposix, which now has a GNU
> autotools-based build system. This should be pretty simple, I think,
> but I would like some guidance in case I'm trying to do it the wrong
> way.
>
> It would be nice to add a new build type in the end, but since it
> should be pretty simple to do it with a command build, I thought I'd
> try that first.
>
> The build stanza of my rockspec so far looks like this:
>
> build = {
>  type = "command",
>  build_command = "CPPFLAGS=-I??? ./configure --prefix=???
> --libdir=??? --datadir=??? --with-lua-suffix=???",
>  install_command = "make install"
> }
>
> As far as I can see, all I need to do is fill in some values in the
> spaces marked "???". I should be able to get most of them from
> LuaRocks. I can't however find any description in the LuaRocks docs (I
> like the sound of that, "luaroxdox"!) of how to query LuaRocks for the
> necessary information. GNU autotools build systems need to know where
> the program will be installed, and this is the information that will
> be fed to --prefix, --libdir and --datadir.
>
> Can I just use e.g. luarocks.path.bin_dir() in my rockspec to get this
> information? How? I don't see any examples...

Take a look at this one:

http://luarocks.org/repositories/rocks/lcurses-6-2.rockspec

Note some of the tweaks I had to add to have it install files in the
expected places and avoid making versioned symlinks, which confuse the
LuaRocks file deployer (I suggest adding LDFLAGS=-avoid-version to
upstream's Makefile.am, since the Lua module loader doesn't make use
of the versioned symlinks anyway).

> Finally, the standard autoconf macro for dealing with Lua takes an
> argument --with-lua-suffix that copes with the common situation in
> which the Lua interpreter and libraries have a version suffix, e.g.
> lua5.1 and liblua5.1.so. I am unclear on where this information is
> stored in LuaRocks (I don't seem to see any mention of it in my
> LuaRocks configuration).

For the interpreter name, at least, it is available in rockspecs as
$(LUA), expanding to a string such as "lua" or "lua5.1". Currently,
there is no specific variable for the suffix only. Doesn't the macro
detect this automatically?

> I'd be most grateful for help with this, as I'm sure it's not
> complicated, but could save me a lot of time digging through LuaRocks
> sources.

Sure, let me know if this is sufficient. Let's use this experience to
improve documention and the tool.

-- 
-- Hisham
http://hisham.hm/ - http://colorbleed.com.br/

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to