Lua Dist |
|
Dist provides automated CMake building and Lua-based deployment of software.
LuaDist [1] is sort-of like LuaRocks, BSD ports, and RPM:
Dist can build/deploy many types of things, including applications (e.g. Lua), system libraries (e.g. zlib), Lua modules (e.g. luazlib), and (soon) entire distributions (e.g. Lua for Windows).
Dist is self-contained and builds it own dependencies from source.
Dist packages to LuaRocks packages since LuaRocks supports CMake builds. The "luarocks" package in LuaDist will also be usable to deploy LuaRocks if desired.
To build Lua 5.1 and some module of your choice from source, do this:
svn co https://luadist.svn.sourceforge.net/svnroot/luadist/trunk luadist cd luadist ./build cd _install/* ./bin/luadist install md5 ./bin/lua -lmd5 -e "print(md5.sumhexa 'test')" # For Windows builds, see below instead. # For a Debian-based Linux, you may need to first install dependent packages: # sudo apt-get install subversion gcc make cmake
The above first checks out the latest LuaDist source (svn version since LuaDist is still much under development). Then we build it. You'll need to have cmake installed. The build process builds a simple Lua executable for bootstrapping LuaDist (which itself is written in Lua), then it builds full luafilesystem and luasocket modules (required by LuaDist), and finally it installs this in a subdirectory of "_install". We then use LuaDist to download, build, and install some module (e.g. md5). Lastly, we test the module in Lua.
For Windows users, MinGW or Cygwin builds are similar, but for Visual C++, do this:
set PATH=%PATH%;c:\cmake-2.6\bin svn co https://luadist.svn.sourceforge.net/svnroot/luadist/trunk luadist cd luadist build_msvc.bat cd _install\msvc bin\luadist install md5 bin\lua -lmd5 -e "print(md5.sumhexa 'test')"
If you're more adventurous, try "luadist install iup". We can even build regular C libraries ("luadist install libexpat")--it's not just for Lua! To your surprise, this stuff even builds on Windows, or at least is close to building, thanks to CMake.
For MinGW, set "PATH=%PATH%;c:\MinGW\bin" prior to running build.bat. Temporarily remove sh.exe from "c:\MinGW\bin" to avoid conflict.
To install LuaJIT 2 beta, just run "luadist install luajit2" following the above instructions. To build a release version with full optimizations be sure to instead do "luadist install luajit2 -DCMAKE_BUILD_TYPE=Release". This replaces your standard Lua with LuaJIT. Note that the LuaJIT binary is called "lua" not "luajit".
Under Windows you may get a obscure error about "is not recognized as an internal or external command" at the very end of this due to the .bat file being replaced while running. This is harmless.
2.0.0-beta1 debug version build under MSVC crashes. Use a release version build.
To reinstall standard Lua do "luadist remove lua" followed by "luadist install lua". Don't first do "luadist remove luajit2" since luadist will then no longer run.
If you break your LuaDist installation, you can reinstall standard Lua from the boostrapping version of LuaDist:
_bootstrap\*\luadist-bootstrap remove lua _bootstrap\*\luadist-bootstrap install lua (note: prefix the above by "sh " on Unix-like systems)
Dist software are still being worked out. We're working toward a 1.0 release.
---