lua-lualdap: add 5.4 support, properly version

This commit is contained in:
q66 2020-07-01 04:21:31 +02:00
parent cdc82f0d0f
commit d3dddc6b68
6 changed files with 49 additions and 14 deletions

1
srcpkgs/lua-lualdap Symbolic link
View file

@ -0,0 +1 @@
lua54-lualdap

View file

@ -1 +1 @@
lua-lualdap
lua54-lualdap

View file

@ -1 +1 @@
lua-lualdap
lua54-lualdap

1
srcpkgs/lua53-lualdap Symbolic link
View file

@ -0,0 +1 @@
lua54-lualdap

View file

@ -0,0 +1,17 @@
--- src/compat-5.3.h
+++ src/compat-5.3.h
@@ -399,11 +399,11 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,
/* other Lua versions */
-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503
+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504
-# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)"
+# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3 or 5.4)"
-#endif /* other Lua versions except 5.1, 5.2, and 5.3 */
+#endif /* other Lua versions except 5.1, 5.2, 5.3 and 5.4 */

View file

@ -1,28 +1,30 @@
# Template file for 'lua-lualdap'
pkgname=lua-lualdap
# Template file for 'lua54-lualdap'
pkgname=lua54-lualdap
version=1.2.5
revision=1
revision=2
wrksrc="lualdap-${version}"
build_style=gnu-makefile
hostmakedepends="pkg-config"
makedepends="lua51-devel lua52-devel lua-devel libldap-devel"
short_desc="LDAP bindings for Lua"
makedepends="lua51-devel lua52-devel lua53-devel lua54-devel libldap-devel"
_desc="LDAP bindings for Lua"
short_desc="${_desc} (5.4.x)"
maintainer="John Regan <john@jrjrtech.com>"
license="MIT"
homepage="https://github.com/lualdap/lualdap"
distfiles="https://github.com/lualdap/lualdap/archive/v${version}.tar.gz"
checksum=3e028faa6a5798cf2f3d50b9853b9b3fb6eb562b62010747bd5b6f50b57bb1cc
post_extract() {
post_patch() {
cd ${wrksrc}
mkdir -p lua51
mv * lua51 || :
mv * lua51 || true
cp -a lua51 lua52
cp -a lua51 lua53
cp -a lua51 lua54
}
do_build() {
for luaver in 5.1 5.2 5.3; do
for luaver in 5.1 5.2 5.3 5.4; do
cd ${wrksrc}/lua${luaver//.}
vsed -i "s|^LUA_VERSION.*|LUA_VERSION = ${luaver}|g" config
make \
@ -36,7 +38,7 @@ do_build() {
}
do_install() {
for luaver in 5.1 5.2 5.3; do
for luaver in 5.1 5.2 5.3 5.4; do
vmkdir usr/lib/lua/$luaver
cd ${wrksrc}/lua${luaver//.}
make \
@ -48,11 +50,11 @@ do_install() {
DESTDIR="${DESTDIR}" \
install
done
vlicense ${wrksrc}/lua53/LICENSE.md
vlicense ${wrksrc}/lua54/LICENSE.md
}
lua51-lualdap_package() {
short_desc+=" - Lua 5.1"
short_desc="${_desc} (5.1.x)"
pkg_install() {
vmove usr/lib/lua/5.1
vlicense lua51/LICENSE.md
@ -60,9 +62,23 @@ lua51-lualdap_package() {
}
lua52-lualdap_package() {
short_desc+=" - Lua 5.2"
short_desc="${_desc} (5.2.x)"
pkg_install() {
vmove usr/lib/lua/5.2
vlicense lua52/LICENSE.md
}
}
lua53-lualdap_package() {
short_desc="${_desc} (5.3.x)"
pkg_install() {
vmove usr/lib/lua/5.3
vlicense lua53/LICENSE.md
}
}
lua-lualdap_package() {
depends="lua53-lualdap>=${version}_${revision}"
short_desc+="${_desc} (5.3.x) (transitional dummy package)"
build_style=meta
}