From b4619e863a93c2f87686c19136e263233e406bfd Mon Sep 17 00:00:00 2001 From: Will Sinatra Date: Sun, 12 Nov 2023 14:06:47 -0500 Subject: [PATCH] testing/lua-lapis-annotate: new aport --- testing/lua-lapis-annotate/APKBUILD | 67 ++++++++++++++++++++ testing/lua-lapis-annotate/fix_lua_ver.patch | 11 ++++ 2 files changed, 78 insertions(+) create mode 100644 testing/lua-lapis-annotate/APKBUILD create mode 100644 testing/lua-lapis-annotate/fix_lua_ver.patch diff --git a/testing/lua-lapis-annotate/APKBUILD b/testing/lua-lapis-annotate/APKBUILD new file mode 100644 index 00000000000..c05fd6fb13a --- /dev/null +++ b/testing/lua-lapis-annotate/APKBUILD @@ -0,0 +1,67 @@ +# Contributor: Will Sinatra +# Maintainer: Will Sinatra +pkgname=lua-lapis-annotate +_rockname=lapis-annotate +pkgver=1.2.1 +pkgrel=0 +pkgdesc="A Lapis extension that lets you annotate your model files with their schema." +url="https://github.com/leafo/lapis-annotate" +arch="noarch !ppc64le" #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" +builddir="$srcdir/$_rockname-$pkgver" +depends="lua-lapis" +options="!check" #There are no checks + +_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" +} + +_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 +" diff --git a/testing/lua-lapis-annotate/fix_lua_ver.patch b/testing/lua-lapis-annotate/fix_lua_ver.patch new file mode 100644 index 00000000000..ec5638b616e --- /dev/null +++ b/testing/lua-lapis-annotate/fix_lua_ver.patch @@ -0,0 +1,11 @@ +--- a/lapis-annotate-dev-1.rockspec 2018-04-03 20:38:40.000000000 -0400 ++++ b/lapis-annotate-dev-1.rockspec 2023-11-02 10:40:14.089599609 -0400 +@@ -12,7 +12,7 @@ + } + + dependencies = { +- "lua == 5.1", ++ "lua >= 5.1", + "lapis", + } +