# Contributor: Alex Dowad # Maintainer: Alex Dowad pkgname=lua-luautf8 pkgver=0.1.5 pkgrel=0 pkgdesc="A UTF-8 support module for Lua" url="https://github.com/starwing/luautf8" arch="all" license="MIT" source="$pkgname-$pkgver.tar.gz::https://github.com/starwing/luautf8/archive/$pkgver.tar.gz" builddir="$srcdir/${pkgname#lua-}-$pkgver" _luaversions="5.1 5.2 5.3 5.4" for _v in $_luaversions; do makedepends="$makedepends lua$_v-dev" subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage" done prepare() { default_prepare local lver; for lver in $_luaversions; do cp -r "$builddir" "$builddir-$lver" done } build() { local lver; for lver in $_luaversions; do msg "Building for Lua $lver..." cd "$builddir-$lver" ${CC:-gcc} $CFLAGS -fPIC $(pkg-config --cflags lua$lver) lutf8lib.c $LDFLAGS -shared -o lua-utf8.so done } check() { local lver; for lver in $_luaversions; do msg "Testing on Lua $lver" cd "$builddir-$lver" lua$lver test.lua lua$lver test_compat.lua lua$lver test_pm.lua done } package() { mkdir -p "$pkgdir" local lver; for lver in $_luaversions; do install -m 755 -D "$builddir-$lver"/lua-utf8.so \ "$pkgdir"/usr/lib/lua/$lver/lua-utf8.so done } _subpackage() { local lver="${subpkgname:3:3}" pkgdesc="$pkgdesc $lver" depends="lua$lver" install_if="$pkgname=$pkgver-r$pkgrel lua$lver" amove usr/lib/lua/$lver } sha512sums=" 2f7f1e80c27012d2ebcf3da8e9367f00dda9f7b1a7d4adee265ee37ab12a78ef7c94930945e88f060f0ec4186174dd87af80a50917d3b22a71c84f67b0df12d0 lua-luautf8-0.1.5.tar.gz "