lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi all,

Luabuild is finally doing what it was intended to do, which is to help
automate the generation of custom static Lua executables, which can
also be used as srlua stubs.

Building the world should be straightforward; just say ./build-all or
build-all, depending on your current religion.  You may have to
install needed dependencies, or just edit the end of default.config to
omit the troublesome modules.  Then ./test-dynamic tests the regular
lua52 executable, and /test-static tests the 'fat' lua52s executable.

It's then a good idea to put LB/bin on your path, to make these
executables and other scripts available (and srlua will usually guess
from its location where luabuild is)

The srlua script will generate a standalone version of Lake

d:>luabuild> srlua -m lfs -o lake lake

For more complicated situations, Jay Carlson's soar serves two
purposes: it analyzes dependencies, and packs all the Lua modules into
one runnable archive.

D:\dev\lua\LDoc> soar52 -o ldoc ldoc.lua .
soar ---------- running ldoc.lua --------------
reading configuration from config.ld
output written to d:\dev\lua\ldoc\out
soar ---------- analysis over -------------
ldoc.prettify   D:\dev\lua\LDoc\ldoc\prettify.lua
 pl.tablex       C:\Program Files\Lua\5.1\lua\pl\tablex.lua
 ...
 ---- binary dependencies ---
 lfs     *BINARY*
 batch file written to: ldoc.bat
 output written to: ldoc-all.lua

And ldoc-all.lua is over 10Kloc of code in one file; you can then use
srlua to pack this as an executable (it will also read 'soar.out' to
find out what binaries are needed for the static build.

On this project I've mostly been a librarian, so thanks to all the
authors of the modules, in particular to lhf for srlua and Jay for
soar. In the process, 'features' were discovered and fixed (like a
patch to luaposix so it works on FreeBSD, a patch to Roberto's struct
test files so that it works fine on amd64 Linux, etc). I will feed
these fixes back over the next week or so.

It's my hope that eventually this kind of static-build functionality
will be supported by LuaDist, which has a much larger infrastructure.
Currently, the answer to the question "Cool! Can I bundle my app using
<my favourite GUI toolkit>?' is 'no, unless you like Tcl/tk'.

I'm now moving onto a related sister project, which is to combine soar
with a Debian package generator.  Then at least you can deploy
lua-gnome applications, since it's in the repos.

A version of Lake packed with luabuild can be found here, for Windows [2]

Tested on Linux (x86,amd64,ARM), Windows (x86 and amd64, MVSC and
mingw), FreeBSD (x86) and OS X (ppc)

steve d.

[1] https://github.com/stevedonovan/luabuild
[2] http://stevedonovan.github.com/files/lake.exe