On 29 July 2013 13:03, steve donovan <steve.j.dono...@gmail.com> wrote:
> Lake is a pure Lua cross-platform build system that only requires
> luafilesystem and directly evaluates build rules. It can be particularly
> useful if LuaRock's builtin mode is not quite powerful enough, since it can
> be provided as a build dependency.
>
> For instance, here's a simple one for lhf's latest version of lcomplex.
>
> -- lcomplex-20120430-1.rockspec
> package = "lcomplex"
> version="20120430-1"
>
> source = {
>   url = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lcomplex.tar.gz";,
>   dir = "complex",
> }
>
> description = {
>   summary = "Support for complex numbers in Lua",
>   detailed = [[
>     This code provides support for complex numbers in Lua using the
> functions
>     available in C99.
>   ]],
>   homepage = "http://penlight.luaforge.net/packages/lcomplex.html";,
>   license = "MIT/X11",
> }
>
> dependencies = {
>     "lake"
> }
>
> build = {
>   type = "command",
>   build_command = 'lake',
>   extra_files = { lakefile = [[
>     c99.shared{'complex',src='lcomplex',needs='lua'}
>   ]]},
>   platforms = {
>   unix = {
>       install = { lib = {
>         complex = "complex.so"
>       }}
>     },
>     windows = {
>       install = { lib = {
>         complex = "complex.dll"
>       }}
>     }
>  }
> }
>
> We sneak in a lakefile in using the useful (but undocumented)
> build.extra_files table; there's no Lake LuaRocks backend, but Lake is
> LuaRocks-aware and asks it for the include directories, etc.

It was probably undocumented by oversight! It has been there for a
long time, isn't it?

> Not really a case that needs the extra power, but if it was a C++ module,
> then 'cpp.shared' would do the right thing for both GCC and CL.EXE.
>
> When designing Lake I was always thinking about how it could complement
> LuaRocks, so I did not worry too much about teaching it to install modules.
> (There's still an issue with build.install.lib where we have to say either
> .dll or .so, requiring slightly awkward per-platform overrides)

See if this works:

complex = "complex.$(LIB_EXTENSION)"

Looks like LuaRocks needs some documentation updates!

-- Hisham
http://hisham.hm/

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to