1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-16 12:45:18 +03:00
aports/community/lua-lapis-exceptions/APKBUILD
2024-12-14 19:20:24 +00:00

86 lines
2.7 KiB
Text

# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=lua-lapis-exceptions
_rockname=lapis-exceptions
pkgver=2.4.0
pkgrel=1
pkgdesc="This module makes the error handler in Lapis save the errors to database. Optionally you can make it email you the exceptions."
url="https://github.com/leafo/lapis-exceptions"
arch="noarch !ppc64le !riscv64" #blocked by lua-lapis, which requires lua-etlua
license="MIT"
makedepends="luarocks"
source="$pkgname-$pkgver.tar.gz::https://github.com/leafo/$_rockname/archive/v$pkgver.tar.gz
fix_lua_ver.patch
LICENSE"
builddir="$srcdir/$_rockname-$pkgver"
depends="lua-lapis"
checkdepends="lua-tableshape lua-busted"
options="!check" #checks require an active PSQL DB
subpackages="$pkgname-doc"
_luaversions="5.1 5.2 5.3 5.4"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev luarocks$_v"
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
depends="$depends lua$_v lua$_v-lapis"
checkdepends="$checkdepends lua$_v-tableshape lua$_v-busted"
done
prepare() {
default_prepare
}
build() {
local lver; for lver in $_luaversions; do
msg "Building for Lua $lver..."
luarocks-$lver \
LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
make --tree="./build" \
--deps-mode=none \
"$_rockname-dev-1.rockspec"
rm "./build/lib/luarocks/rocks-$lver/manifest"
done
}
check() {
mkdir .bin
local lver; for lver in $_luaversions; do
msg "Testing on lua$lver..."
ln -sf "/usr/bin/lua$lver" ".bin/lua"
LUA_PATH="$builddir/?.lua;;" \
PATH="$builddir/.bin:$PATH" \
lua "/usr/bin/busted"
done
}
package() {
mkdir -p "$pkgdir"
install -Dm644 "$srcdir"/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
_subpackage() {
local lver="${subpkgname:3:3}"
pkgdesc="$pkgdesc (for Lua $lver)"
depends="lua$lver lua$lver-lapis"
install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-1"
local path; for path in "lib/luarocks/rocks-$lver" "share/lua/$lver"; do
mkdir -p "$subpkgdir/usr/${path%/*}"
mv "$builddir/build/$path" "$subpkgdir/usr/$path/"
done
mkdir -p "$rockdir"
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
sha512sums="
6e94a7d2e05bc10208d0cae02cf10d5b84b6d55f542b76ab6b1f70c4ba83e755cb963ea4ca28369e458f22b4fa6e97e8c9ed10a67e507b8dca9cf1600cc57422 lua-lapis-exceptions-2.4.0.tar.gz
9c523064567cc30e4a1496eeba0852af4bbd32e3c9d4e7b8bf944af70ac72094e44c798bd9aa82902b73c76376e8e3f2813e4ad80dc81ce9b15df179266fd7dc fix_lua_ver.patch
8d23c78a24f99ffc27adbc75402368ea7445034c31124966fed9ccf7e0fbf31358b6ff09719a390452145c33040174b3cf8cb89e3eb54804eb7d6c2c86abff2f LICENSE
"