aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-jsonschema/APKBUILD
diff options
context:
space:
mode:
authorGuilherme Felipe da Silva <gfsilva.eng@gmail.com>2020-03-05 15:07:16 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-03-09 17:12:43 -0300
commit76590099109da5b04b3e1a977468625cb34d7d6b (patch)
tree0e218d9a1c3ad727b11d867133006ce47df1b25d /testing/lua-jsonschema/APKBUILD
parent42533063099024b003ae2f0caea6fa9813075f83 (diff)
downloadaports-76590099109da5b04b3e1a977468625cb34d7d6b.tar.gz
aports-76590099109da5b04b3e1a977468625cb34d7d6b.tar.bz2
aports-76590099109da5b04b3e1a977468625cb34d7d6b.tar.xz
testing/lua-jsonschema: upgrade to 0.6
Diffstat (limited to 'testing/lua-jsonschema/APKBUILD')
-rw-r--r--testing/lua-jsonschema/APKBUILD63
1 files changed, 27 insertions, 36 deletions
diff --git a/testing/lua-jsonschema/APKBUILD b/testing/lua-jsonschema/APKBUILD
index 3be78515fb..d55d600626 100644
--- a/testing/lua-jsonschema/APKBUILD
+++ b/testing/lua-jsonschema/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
pkgname=lua-jsonschema
_rockname=${pkgname#lua-}
-pkgver=0.4
+pkgver=0.6
pkgrel=0
pkgdesc="Pure Lua JSON schema validator for Lua/LuaJIT"
url="https://github.com/iresty/jsonschema"
@@ -9,53 +9,44 @@ license="MIT"
arch="noarch"
depends="lua-net-url lua-rex-pcre"
makedepends="luarocks"
-subpackages=""
-options="!check" #test dependencies not available
-source="${_rockname}-${pkgver}.tar.gz::https://github.com/iresty/jsonschema/archive/v$pkgver.tar.gz"
-builddir="${srcdir}/${_rockname}-${pkgver}"
-_luaversions="5.2 5.3"
+options="!check" # Test dependencies not available
+source="$_rockname-$pkgver.tar.gz::https://github.com/iresty/jsonschema/archive/v$pkgver.tar.gz"
+builddir="$srcdir/$_rockname-$pkgver"
+_luaversions="5.1 5.2 5.3"
for _luaversion in $_luaversions; do
- makedepends="${makedepends} lua${_luaversion}-dev"
- subpackages="${subpackages} lua${_luaversion}-${_rockname}:_subpackage"
+ makedepends="$makedepends lua$_luaversion-dev"
+ subpackages="$subpackages lua$_luaversion-$_rockname:_subpackage"
done
build() {
- for _luaversion in $_luaversions; do
- msg "Building for Lua $_luaversion"
- "luarocks-${_luaversion}" \
- CC="$CC" \
- CFLAGS="$CFLAGS -fPIC" \
- LUA_INCDIR="$(pkg-config --variable=includedir "lua${_luaversion}")" \
- LUA_LIBDIR="$(pkg-config --variable=libdir "lua${_luaversion}")" \
- LUA_VERSION="$_luaversion" \
- make --tree="./build-${_luaversion}/" \
- "rockspec/${_rockname}-master-"*".rockspec"
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ luarocks-$lver \
+ --deps-mode=none \
+ LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
+ LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
+ make --tree="./build" \
+ "rockspec/$_rockname-master-"*".rockspec"
+
+ rm "./build/lib/luarocks/rocks-$lver/manifest"
done
}
package() {
- mkdir -p "${pkgdir}"
+ mkdir -p "$pkgdir"
}
_subpackage() {
- _luaversion="${subpkgname%-$_rockname}"
- _luaversion="${_luaversion#lua*}"
- pkgdesc="${pkgdesc} - for Lua ${_luaversion}"
- depends="${depends} lua${_luaversion}"
- install_if="lua${_luaversion} ${pkgname}=${pkgver}-r${pkgrel}"
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
- for _luascript in "${builddir}/build-${_luaversion}/share/lua/${_luaversion}/"*.lua; do
- install -D -m 644 \
- -t "${subpkgdir}/usr/share/lua/${_luaversion}" \
- "${_luascript}"
- done
-
- for _luascript in "${builddir}/build-${_luaversion}/share/lua/${_luaversion}/${_rockname}/"*.lua; do
- install -D -m 644 \
- -t "${subpkgdir}/usr/share/lua/${_luaversion}/${_rockname}" \
- "${_luascript}"
+ 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
}
-
-sha512sums="1db0152fd6a437800069689d8cb09e0f86af3cf31929ce942c473bdd980c3af692ed1ca08a64a3c124a0f92f7d86963647f6d446fd70e8dda443241dd70b355e jsonschema-0.4.tar.gz"
+sha512sums="35289849ebb6da7864140a505151b970bcd2bd6c2a3b09a4da340dc8a24c6bde9c922fdd41024c9f9fe7c2651c09c281dd3aff4580b1819edd1f9ac43f4a0ea3 jsonschema-0.6.tar.gz"