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.
LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS 開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。
ダウンロード (HTTP): https://www.lua.org/ftp/lua-5.4.6.tar.gz
ダウンロード MD5 sum: 25a429319dff20dfbfb9956c2b5be911
ダウンロードサイズ: 356 KB
必要ディスク容量: 3.8 MB(基本テスト込み)
概算ビルド時間: 0.1 SBU 以下(基本テスト込み)
必須のパッチ: https://www.linuxfromscratch.org/patches/blfs/svn/lua-5.4.6-shared_library-1.patch
Optional Test Suite Download (HTTP): https://www.lua.org/tests/lua-5.4.6-tests.tar.gz
Optional Test Suite Download MD5 sum: e10a3da28b05d0e8d25ad08b7820c213
Optional Test Suite Download size: 134 KB
Some packages check for the pkg-config file for Lua, which is created with:
cat > lua.pc << "EOF"
V=5.4
R=5.4.6
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 -ldl
Cflags: -I${includedir}
EOF
以下のコマンドを実行して Lua をビルドします。
patch -Np1 -i ../lua-5.4.6-shared_library-1.patch && make 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 the description below.
root
ユーザーになって以下を実行します。
make INSTALL_TOP=/usr \ INSTALL_DATA="cp -d" \ INSTALL_MAN=/usr/share/man/man1 \ TO_LIB="liblua.so liblua.so.5.4 liblua.so.5.4.6" \ install && mkdir -pv /usr/share/doc/lua-5.4.6 && cp -v doc/*.{html,css,gif,png} /usr/share/doc/lua-5.4.6 && install -v -m644 -D lua.pc /usr/lib/pkgconfig/lua.pc
Here we describe only the "Basic tests". Untar the tarball and
change to the lua-5.4.6-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".