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 is an older version of Lua needed only for compatibility with other programs such as Wireshark-4.2.0 and VLC-3.0.20.
LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS 開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。
ダウンロード (HTTP): https://www.lua.org/ftp/lua-5.2.4.tar.gz
ダウンロード MD5 sum: 913fdb32207046b273fdb17aad70be13
ダウンロードサイズ: 248 KB
必要ディスク容量: 3.6 MB
概算ビルド時間: 0.1 SBU 以下
Some packages check for the pkg-config file for Lua, which is created with:
cat > lua.pc << "EOF"
V=5.2
R=5.2.4
prefix=/usr
INSTALL_BIN=${prefix}/bin
INSTALL_INC=${prefix}/include/lua5.2
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/lua5.2
Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
Libs: -L${libdir} -llua5.2 -lm -ldl
Cflags: -I${includedir}
EOF
以下のコマンドを実行して Lua をビルドします。
patch -Np1 -i ../lua-5.2.4-shared_library-1.patch && sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h && sed -r -e '/^LUA_(SO|A|T)=/ s/lua/lua5.2/' \ -e '/^LUAC_T=/ s/luac/luac5.2/' \ -i src/Makefile && make MYCFLAGS="-fPIC" linux
The installation of this package is complex, so we will use the DESTDIR method of installation:
make TO_BIN='lua5.2 luac5.2' \ TO_LIB="liblua5.2.so liblua5.2.so.5.2 liblua5.2.so.5.2.4" \ INSTALL_DATA="cp -d" \ INSTALL_TOP=$PWD/install/usr \ INSTALL_INC=$PWD/install/usr/include/lua5.2 \ INSTALL_MAN=$PWD/install/usr/share/man/man1 \ install && install -Dm644 lua.pc install/usr/lib/pkgconfig/lua52.pc && mkdir -pv install/usr/share/doc/lua-5.2.4 && cp -v doc/*.{html,css,gif,png} install/usr/share/doc/lua-5.2.4 && ln -s liblua5.2.so install/usr/lib/liblua.so.5.2 && ln -s liblua5.2.so install/usr/lib/liblua.so.5.2.4 && mv install/usr/share/man/man1/{lua.1,lua5.2.1} && mv install/usr/share/man/man1/{luac.1,luac5.2.1}
root
ユーザーになって以下を実行します。
chown -R root:root install && cp -a install/* /
sed -i ... src/luaconf.h: このコマンドは Lua の検索パスをインストールパスに合致するようにします。
sed -i ... src/Makefile: This command deconflicts this installation with the latest version of lua.