aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorGuilherme Felipe da Silva <gfsilva.eng@gmail.com>2019-11-21 18:18:49 +0100
committerLeo <thinkabit.ukim@gmail.com>2019-11-29 23:57:07 +0100
commit8dfad93fb7ea21ced654a2224c79bf66daaf2a2c (patch)
treed1f9e9994b661ede561c78cf461d7b1f35387c06 /testing
parentee87878e9e50de04e77ca0b75b1a1a4f70c8096c (diff)
downloadaports-8dfad93fb7ea21ced654a2224c79bf66daaf2a2c.tar.gz
aports-8dfad93fb7ea21ced654a2224c79bf66daaf2a2c.tar.bz2
aports-8dfad93fb7ea21ced654a2224c79bf66daaf2a2c.tar.xz
testing/lua-jsonschema: new aport
Pure Lua JSON schema validator for Lua/LuaJIT Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Diffstat (limited to 'testing')
-rw-r--r--testing/lua-jsonschema/APKBUILD61
1 files changed, 61 insertions, 0 deletions
diff --git a/testing/lua-jsonschema/APKBUILD b/testing/lua-jsonschema/APKBUILD
new file mode 100644
index 0000000000..3be78515fb
--- /dev/null
+++ b/testing/lua-jsonschema/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
+pkgname=lua-jsonschema
+_rockname=${pkgname#lua-}
+pkgver=0.4
+pkgrel=0
+pkgdesc="Pure Lua JSON schema validator for Lua/LuaJIT"
+url="https://github.com/iresty/jsonschema"
+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"
+
+for _luaversion in $_luaversions; do
+ 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"
+ done
+}
+
+package() {
+ 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}"
+
+ 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}"
+ done
+}
+
+sha512sums="1db0152fd6a437800069689d8cb09e0f86af3cf31929ce942c473bdd980c3af692ed1ca08a64a3c124a0f92f7d86963647f6d446fd70e8dda443241dd70b355e jsonschema-0.4.tar.gz"