This project is a build2 package repository that provides access to Lua, a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
Make sure to add the stable section of the cppget.org
repository to your project's repositories.manifest
to be able to fetch the packages.
:
role: prerequisite
location: https://pkg.cppget.org/1/stable
# trust: ...
If the stable section of cppget.org
is not an option then add this Git repository itself instead as a prerequisite.
:
role: prerequisite
location: https://github.com/build2-packaging/lua.git
Add the respective dependencies in your project's manifest
file to make the required packages available for import.
depends: liblua ^5.4.7 # C Library for Embedding Lua
depends: lua ^5.4.7 # Lua Interpreter and Compiler
Then use the following lines in your buildfile
to import library and executables.
import liblua = liblua%lib{lua} # Library
import luac = lua%exe{luac} # Compiler
import lua = lua%exe{luac} # Interpreter
For backwards compatibility to earlier package versions, use the following line to import lib{lua}
from the lua
package directly.
This is deprecated and should not be used for new projects.
import liblua = lua%lib{lua}
The use of the GNU readline
library for the Lua interpreter is disabled by default to reduce importation issues during CI runs.
If readline
is available on your target platform, it is recommended to enable it to improve editing capabilities on the Lua command line.
config [bool] config.lua.readline ?= false
- Lua's source code for releases is not provided as a git repository and needs to be hard-copied into the
upstream
directory from here. - Lua's test suite for releases is not provided as a git repository and needs to be hard-copied into the
upstream-tests
directory from here. - The
LICENSE
file was hard-copied from Lua's website. - Lua's compiler and interpreter have not been split into separate packages to reduce complexity and importation issues based on backwards compatibility. In most cases, interpreter and compiler will be used together at the same time anyway.
- Lua's documentation files will only be installed with the
lua
package to prevent redundant files in various directories after installation. An explicit installation of Lua will most likely require all components anyway. - There are no sophisticated upstream tests for Lua's C library. As such, we only provide two smoke tests.
- So far, the Lua compiler
luac
is only compiled and not further tested. There are also no real upstream tests for it. - The tests package does not run Lua's complete or internal test suites as these are expected to fail for various reasons as stated here. Instead, only the basic tests based on Lua scripts are executed.
- Lua's basic tests fail for unoptimized builds on Windows with MSVC and Clang. This is most likely caused by an intentional stack overflow in the basics tests scripts that might not be properly caught.
Thank you in advance for your help and contribution to keep this package up-to-date.
Please, file an issue on GitHub for questions, bug reports, or to recommend updating the package version.
If you're making a pull request to fix bugs or update the package version yourself, refer to the build2
Packaging Guidelines.