Files
ports/core/lua/spkgbuild
2021-01-12 23:53:38 +08:00

32 lines
827 B
Plaintext

# description : Light-weight programming language designed for extending applications
name=lua
version=5.4.2
_majorver=${version%.*}
release=1
source="https://www.lua.org/ftp/$name-$version.tar.gz
liblua.so.patch
lua.pc"
build() {
cd $name-$version
patch -Np1 -i ../liblua.so.patch
sed "s/%VER%/$_majorver/g;s/%REL%/$version/g" ../lua.pc > lua.pc
# Lua 5.3.4 has wrong release version in its Makefile. Fix it.
sed "s/^R= \$V.4/R= \$V.5/" -i Makefile
sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h
make MYCFLAGS="-DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -fPIC" linux
make INSTALL_TOP=$PKG/usr \
TO_LIB="liblua.so liblua.so.$_majorver liblua.so.$version" \
INSTALL_DATA="cp -d" \
INSTALL_MAN=$PKG/usr/share/man/man1 install
install -v -m644 -D lua.pc $PKG/usr/lib/pkgconfig/lua.pc
}