void-packages/srcpkgs/lua54/template

78 lines
2.3 KiB
Bash
Raw Normal View History

2020-06-30 20:02:47 +00:00
# Template file for 'lua54'
pkgname=lua54
version=5.4.0
revision=1
wrksrc=lua-${version}
makedepends="ncurses-devel readline-devel"
short_desc="Powerful, fast, lightweight, embeddable scripting language (5.4.x)"
maintainer="q66 <daniel@octaforge.org>"
license="MIT"
homepage="https://www.lua.org"
distfiles="https://www.lua.org/ftp/lua-${version}.tar.gz"
checksum=eac0836eb7219e421a96b7ee3692b93f0629e4cdb0c788432e3d10ce9ed47e28
alternatives="
lua:lua:/usr/bin/lua5.4
lua:luac:/usr/bin/luac5.4
lua:lua.1:/usr/share/man/man1/lua5.4.1
lua:luac.1:/usr/share/man/man1/luac5.4.1
lua:lua:/usr/share/doc/lua5.4
"
do_build() {
sed -i src/Makefile -r \
-e '/^LUA_(SO|A|T)=/ s;lua;lua5.4;' \
-e '/^LUAC_T=/ s;luac;luac5.4;'
make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" \
CC="$CC" RANLIB="$RANLIB" \
INSTALL_DATA="cp -d" LUA_SO=liblua5.4.so ${makejobs} linux-readline
}
do_install() {
make INSTALL_DATA="cp -d" INSTALL_TOP="${DESTDIR}/usr" \
TO_BIN="lua5.4 luac5.4" \
TO_LIB="liblua5.4.a liblua5.4.so liblua5.4.so.${version%.*} liblua5.4.so.${version}" \
INSTALL_INC="${DESTDIR}/usr/include/lua5.4" \
INSTALL_MAN="${DESTDIR}/usr/share/man/man1" install
sed ${FILESDIR}/lua.pc \
-e "s;%VER%;${version%.*};g;s;%REL%;${version};g" \
> lua5.4.pc
vinstall lua5.4.pc 644 usr/lib/pkgconfig
# Install the documentation
rm -f doc/*.1
vmkdir usr/share/doc/lua5.4
cp -R doc/* ${DESTDIR}/usr/share/doc/lua5.4
vlicense doc/readme.html
# Rename man pages
mv ${DESTDIR}/usr/share/man/man1/lua{,5.4}.1
mv ${DESTDIR}/usr/share/man/man1/luac{,5.4}.1
}
lua54-devel_package() {
depends="${makedepends} lua54>=${version}_${revision}"
short_desc+=" - development files"
alternatives="
lua-devel:lua:/usr/include/lua5.4
lua-devel:/usr/include/lua.h:/usr/include/lua5.4/lua.h
lua-devel:/usr/include/luaconf.h:/usr/include/lua5.4/luaconf.h
lua-devel:/usr/include/lua.hpp:/usr/include/lua5.4/lua.hpp
lua-devel:/usr/include/lualib.h:/usr/include/lua5.4/lualib.h
lua-devel:/usr/include/lauxlib.h:/usr/include/lua5.4/lauxlib.h
lua-devel:lua.pc:/usr/lib/pkgconfig/lua5.4.pc
lua-devel:liblua.a:/usr/lib/liblua5.4.a
lua-devel:liblua.so:/usr/lib/liblua5.4.so
"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig
vmove usr/share/doc
}
}