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

72 lines
2.3 KiB
Text

# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=lua-lapis-annotate
_rockname=lapis-annotate
pkgver=1.2.1
pkgrel=1
pkgdesc="A Lapis extension that lets you annotate your model files with their schema."
url="https://github.com/leafo/lapis-annotate"
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"
options="!check" #There are no checks
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"
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
}
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="
59276d5a95762b414c714cd02f642cffb4eef43e4e575e9c3f5d3c9f9a5304e1afdedebffd8a4ea2f282d94cc3834cb1696b2dc7daf67e0451eab7534564a072 lua-lapis-annotate-1.2.1.tar.gz
45353ee44f363ecba441817658c2f30e053ff28901bb954b97119874f461b2716a19216fc38d168c14072d09a599f5aab4fe60543a0ae6882318f961d56761ae fix_lua_ver.patch
8d23c78a24f99ffc27adbc75402368ea7445034c31124966fed9ccf7e0fbf31358b6ff09719a390452145c33040174b3cf8cb89e3eb54804eb7d6c2c86abff2f LICENSE
"