aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-mimetypes
diff options
context:
space:
mode:
authorGuilherme Felipe da Silva <gfsilva.eng@gmail.com>2020-03-02 16:39:35 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-03-03 07:07:18 -0300
commita2d2affa1ee54f0575210abb26383c3888812494 (patch)
tree1d35a5ddbede2598c4bb16e5599574fb66882530 /testing/lua-mimetypes
parent916292c5f32d6ac4ea3e3df8871ed66453e6ba97 (diff)
downloadaports-a2d2affa1ee54f0575210abb26383c3888812494.tar.bz2
aports-a2d2affa1ee54f0575210abb26383c3888812494.tar.xz
testing/lua-mimetypes: new aport
https://bitbucket.org/leafstorm/lua-mimetypes A MIME type database for Lua. You can use this in servers and the like to check the MIME types of files
Diffstat (limited to 'testing/lua-mimetypes')
-rw-r--r--testing/lua-mimetypes/APKBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/testing/lua-mimetypes/APKBUILD b/testing/lua-mimetypes/APKBUILD
new file mode 100644
index 0000000000..978ec953af
--- /dev/null
+++ b/testing/lua-mimetypes/APKBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
+pkgname=lua-mimetypes
+_rockname="${pkgname#lua-}"
+pkgver=1.0.0
+pkgrel=0
+pkgdesc="A MIME type database for Lua. You can use this in servers and the like to check the MIME types of files"
+url="https://bitbucket.org/leafstorm/lua-mimetypes"
+license="MIT"
+arch="noarch"
+makedepends="luarocks"
+checkdepends="luajit"
+_commithash="ef4ee2e81596" # v1.0.0 with updated rockspec
+source="$_rockname-$pkgver.tar.gz::https://bitbucket.org/leafstorm/lua-mimetypes/get/$_commithash.tar.gz"
+builddir="$srcdir/leafstorm-$pkgname-$_commithash"
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev luarocks$_v"
+ checkdepends="$checkdepends lua$_v"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+build() {
+ 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" \
+ "rockspecs/$_rockname-$pkgver-1.rockspec"
+ done
+}
+
+check() {
+ local lver; for lver in $_luaversions jit; do
+ msg "Testing on lua$lver..."
+ lua$lver "test.lua"
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+
+ 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="605618a04d0f8fa13d4077ed0f0a1e7846a8c028a7dc7125c3576fb6214863557cf18e4ee0318fba7de367e90e346313e1a25a03db8049ef7aa4cd2747614811 mimetypes-1.0.0.tar.gz"