prg-lr4win
LuaRocks installer for Windows bundling Lua 5.1, Lua 5.2, Lua 5.3, and the MinGW compiler.
Build Instructions
Prerequisites:
- a Windows OS
- Inno Setup (tested with 5.5.4 (u))
- git (e.g. git for Windows) (optional, see below)
- the rest will be downloaded during the build
How to build:
- Clone this repository using the
--recursiveflag (to include the LuaRocks submodule). As an alternative you could download the zip files for both Github projects and extract them to the correct locations (in this case you don't need git). Make sure that the path of the cloned/downloaded repository doesn't contain spaces (MinGW doesn't like spaces in the executable paths). - Execute
build.bat(either via a DosBox from within the cloned repository directory, or by double-clicking in Windows Explorer). This will download and extract the source code for Lua (5.1, 5.2, and 5.3), download a minimal binary MinGW installation from Sourceforge, and compile the Lua source code using the downloaded C compiler. As long as you keep the downloaded files you don't need to runbuild.batagain. - If downloading and compilation were successful, you can create the
installer executable by compiling
lr4win.issusing Inno Setup. The resulting file will beLR4WinSetup.exein the top level repository directory.
Use Instructions
After installation you should have a link to a "LuaRocks DosBox" in your start menu and/or on your desktop. This link starts a command prompt and sets the necessary environment variables for LuaRocks, Lua, and MinGW to run properly.
From within the "LuaRocks DosBox" the following should work:
- Running
lua51andluac51. - Running
lua52andluac52. - Running
lua53andluac53. - Running
luarocks-5.1andluarocks-admin-5.1. - Running
luarocks-5.2andluarocks-admin-5.2. - Running
luarocks-5.3andluarocks-admin-5.3. - Running the MinGW compiler tools.
- Include files in
...\3rdparty\includeshould be picked up by LuaRocks automatically when you build a C module (in addition to the appropriate Lua include files, obviously). - Libraries in
...\3rdparty\libshould be picked up by LuaRocks automatically when you build a C module (in addition to the appropriate Lua libraries; loading dynamic libraries from that directory should work as well). - Scripts installed via LuaRocks should be in PATH automatically.
lua51should also find Lua modules in...\3rdparty\lua\5.1and C modules in...\3rdparty\lib\5.1.lua52should also find Lua modules in...\3rdparty\lua\5.2and C modules in...\3rdparty\lib\5.2.lua53should also find Lua modules in...\3rdparty\lua\5.3and C modules in...\3rdparty\lib\5.3.- This package includes the yypkg package manager from the
Win-Builds project to allow you to install extra libraries.
You may either run
yypkg-1.5.0.exefrom the command line or start the package manager from the start menu link. LuaRocks should pick up installed header files and libraries automatically. - If you have enabled the experimental NuGet support during
installation, the
nugetcommand should install and postprocess packages from the NuGet gallery, so that LuaRocks can find include files and DLLs (using...\nu\includeand...\nu\lib).
If you don't want to use the "LuaRocks DosBox", you can have a look at
...\LuaRocksEnv.bat for the necessary environment changes and apply
them yourself.