aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-hashids
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2017-09-19 23:31:31 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2017-09-19 23:31:31 +0200
commitb50e531fd03e8e7cc28df0e2ce6108a4b86de104 (patch)
tree086fdd99fdd865e7bb5a93e0c130db479914ead6 /main/lua-hashids
parent7b825717ce845f0944fb007dacd75d2cabfb1203 (diff)
downloadaports-b50e531fd03e8e7cc28df0e2ce6108a4b86de104.tar.bz2
aports-b50e531fd03e8e7cc28df0e2ce6108a4b86de104.tar.xz
main/lua-hashids: upgrade to 1.0.6 and add multi lua support
Diffstat (limited to 'main/lua-hashids')
-rw-r--r--main/lua-hashids/APKBUILD53
1 files changed, 32 insertions, 21 deletions
diff --git a/main/lua-hashids/APKBUILD b/main/lua-hashids/APKBUILD
index 91ca0c74e2..57a946502d 100644
--- a/main/lua-hashids/APKBUILD
+++ b/main/lua-hashids/APKBUILD
@@ -1,44 +1,55 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=lua-hashids
-pkgver=1.0.0
+pkgver=1.0.6
pkgrel=0
pkgdesc="A Lua implementation of hashids"
url="https://github.com/leihog/hashids.lua"
arch="all"
license="MIT"
depends=""
-depends_dev="lua5.1-dev"
-makedepends="$depends_dev"
+depends_dev=""
+makedepends=""
install=""
subpackages=""
+options="!check"
source="hashids.lua-$pkgver.tar.gz::https://github.com/leihog/hashids.lua/archive/v$pkgver.tar.gz"
-_builddir="$srcdir"/hashids.lua-$pkgver
+builddir="$srcdir"/hashids.lua-$pkgver
+
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
prepare() {
- local i
- cd "$_sdir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
+ default_prepare
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver"
+ done
}
build() {
- cd "$_builddir"
- make || return 1
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+ make -C "$builddir-$lver"
+ done
}
package() {
- cd "$_builddir"
- install -Dm644 hashids/init.lua \
- "$pkgdir"/usr/share/lua/5.1/hashids/init.lua || return 1
- install -Dm755 hashids/clib.so \
- "$pkgdir"/usr/lib/lua/5.1/hashids/clib.so || return 1
+ 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"
+
+ cd "$builddir-$lver"
+ make INSTALLDIR="$subpkgdir"/usr/lib/lua/$lver/hashids install
}
-md5sums="ace60336593b06eb7f7e8a9e37b5a0fd hashids.lua-1.0.0.tar.gz"
-sha256sums="2a99927bba9c986be544d6c483b953c8f39b56cd5915a154553154c8aab7e3fc hashids.lua-1.0.0.tar.gz"
-sha512sums="2d9f6928c82f0ce3e70f729f8f366f85bd2482474e841524c894381a125a27d5e209bf2f9a7b9e5d9fd476fd3865aca2be4c9c2118ebe125995fbd3008a1962a hashids.lua-1.0.0.tar.gz"
+sha512sums="33ae6d8e465a35bb04a791da645d6003a25d6917a67aaa4abbb5d80470d6ad6b37ff4ed5b82bc4893be2f0dfb213730c13ae1d14486c5476d0b892b64345f2d7 hashids.lua-1.0.6.tar.gz"