Lua is a powerful light-weight programming language designed for extending applications. It is also frequently used as a general-purpose, stand-alone language. Lua is implemented as a small library of C functions, written in ANSI C, and compiles unmodified in all known platforms. The implementation goals are simplicity, efficiency, portability, and low embedding cost. The result is a fast language engine with small footprint, making it ideal in embedded systems too.
This package is known to build and work properly using an LFS-7.9 platform.
Download (HTTP): http://www.lua.org/ftp/lua-5.3.2.tar.gz
Download MD5 sum: 33278c2ab5ee3c1a875be8d55c1ca2a1
Download size: 284 KB
Estimated disk space required: 4 MB (add 440 KB for the Basic tests)
Estimated build time: less than 0.1 SBU (with Basic tests)
Required patch: http://www.linuxfromscratch.org/patches/blfs/7.9/lua-5.3.2-shared_library-1.patch
Optional Test Suite Download (HTTP): http://www.lua.org/tests/lua-5.3.2-tests.tar.gz
Optional Test Suite Download MD5 sum: a2b7ab1b8ff82a0145376e233ef30a4a
Optional Test Suite Download size: 100 KB
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/lua
Some packages check for the pkg-config file for Lua, wich is created with:
cat > lua.pc << "EOF"
V=5.3
R=5.3.2
prefix=/usr
INSTALL_BIN=${prefix}/bin
INSTALL_INC=${prefix}/include
INSTALL_LIB=${prefix}/lib
INSTALL_MAN=${prefix}/share/man/man1
INSTALL_LMOD=${prefix}/share/lua/${V}
INSTALL_CMOD=${prefix}/lib/lua/${V}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
Libs: -L${libdir} -llua -lm
Cflags: -I${includedir}
EOF
Install Lua by running the following commands:
patch -Np1 -i ../lua-5.3.2-shared_library-1.patch && sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h && make MYCFLAGS="-DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" linux
To test the results, issue: make test. “This will run the interpreter and print its version.”. More comprehensive tests can be performed if you downloaded the "Test suite" tarball. Those tests need to be executed after the package is installed, thus we defer to describe then below.
Now, as the root
user:
make INSTALL_TOP=/usr TO_LIB="liblua.so liblua.so.5.3 liblua.so.5.3.2" \ INSTALL_DATA="cp -d" INSTALL_MAN=/usr/share/man/man1 install && mkdir -pv /usr/share/doc/lua-5.3.2 && cp -v doc/*.{html,css,gif,png} /usr/share/doc/lua-5.3.2 && install -v -m644 -D lua.pc /usr/lib/pkgconfig/lua.pc
We are going to describe only the "Basic tests". Untar the tarball
and change to the lua-5.3.2-tests
directory, then issue lua -e"_U=true"
all.lua. If the tests finish without error, you
will see a message containing the string "final OK", at the end.
sed -i ... src/luaconf.h: This command changes Lua search path to match the install paths.
MYCFLAGS="-DLUA_COMPAT_5_2
-DLUA_COMPAT_5_1"
: This environment variable includes
compatibility layers with Lua 5.1 and 5.2 in the build.
Last updated on 2016-02-24 19:22:02 -0800