aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-01-04 02:37:06 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-01-04 02:39:14 +0100
commit4dcc1b1a73569f30ee25e558a5df3839b758d3dc (patch)
tree8a6cf5cfe906ab19c0432adfe0a8fc642271744c
parent6072a809616b91d38ea7402c84f39e413f00daff (diff)
downloadaports-4dcc1b1a73569f30ee25e558a5df3839b758d3dc.tar.gz
aports-4dcc1b1a73569f30ee25e558a5df3839b758d3dc.tar.bz2
aports-4dcc1b1a73569f30ee25e558a5df3839b758d3dc.tar.xz
main/lua-b64: rename from lua5.2-b64 and add lua5.[23]-b64 subpkgs
-rw-r--r--main/lua-b64/0001-b64-fix-segfault-caused-by-signed-char.patch (renamed from main/lua5.2-b64/0001-b64-fix-segfault-caused-by-signed-char.patch)0
-rw-r--r--main/lua-b64/APKBUILD52
-rw-r--r--main/lua5.2-b64/APKBUILD26
3 files changed, 52 insertions, 26 deletions
diff --git a/main/lua5.2-b64/0001-b64-fix-segfault-caused-by-signed-char.patch b/main/lua-b64/0001-b64-fix-segfault-caused-by-signed-char.patch
index 418a8321d1..418a8321d1 100644
--- a/main/lua5.2-b64/0001-b64-fix-segfault-caused-by-signed-char.patch
+++ b/main/lua-b64/0001-b64-fix-segfault-caused-by-signed-char.patch
diff --git a/main/lua-b64/APKBUILD b/main/lua-b64/APKBUILD
new file mode 100644
index 0000000000..7c718ee187
--- /dev/null
+++ b/main/lua-b64/APKBUILD
@@ -0,0 +1,52 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lua-b64
+pkgver=0.1
+pkgrel=2
+pkgdesc="Lua base64 implementation with support for urlsafe"
+url="https://github.com/ncopa/lua-b64"
+arch="all"
+license="MIT"
+depends="lua"
+makedepends=""
+subpackages=""
+source="$pkgname-$pkgver.tar.gz::https://github.com/ncopa/$pkgname/archive/v$pkgver.tar.gz
+ 0001-b64-fix-segfault-caused-by-signed-char.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+_luaversions="5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
+done
+
+prepare() {
+ default_prepare
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver"
+ done
+}
+
+build() {
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+ make -C "$builddir-$lver" LUAPC=lua$lver
+ 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 cmod_dir="$subpkgdir/$(pkg-config --variable=INSTALL_CMOD lua$lver)"
+
+ install -D -m 755 "$builddir-$lver"/b64.so "$cmod_dir"/b64.so
+}
+
+sha512sums="8740d5061db01dca166ce2c959548a3232c85dce156fce3502da35f457db79db2bf23242ee6d26b64f4141c451db733898328b8fc3d1f62b47e8f7ec790577d1 lua-b64-0.1.tar.gz
+6da3b8048b2e6772a4aac954ea2db35f9c21897d720e7ff9dc6c1d63ffc37eeb4fb91be46bc13b32a2c3d1b88997172fe259ea699ac8591f0f3e1fd53cae378b 0001-b64-fix-segfault-caused-by-signed-char.patch"
diff --git a/main/lua5.2-b64/APKBUILD b/main/lua5.2-b64/APKBUILD
deleted file mode 100644
index 9311df32b6..0000000000
--- a/main/lua5.2-b64/APKBUILD
+++ /dev/null
@@ -1,26 +0,0 @@
-# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-pkgname=lua5.2-b64
-_pkgname=lua-b64
-pkgver=0.1
-pkgrel=1
-pkgdesc="Lua 5.2 base64 implementation with support for urlsafe"
-url="https://github.com/ncopa/lua-b64"
-arch="all"
-license="MIT"
-makedepends="lua5.2-dev"
-source="$_pkgname-$pkgver.tar.gz::https://github.com/ncopa/$_pkgname/archive/v$pkgver.tar.gz
- 0001-b64-fix-segfault-caused-by-signed-char.patch"
-builddir="$srcdir/$_pkgname-$pkgver"
-
-build() {
- cd "$builddir"
- make
-}
-
-package() {
- cd "$builddir"
- install -D b64.so "$pkgdir"/usr/lib/lua/5.2/b64.so
-}
-
-sha512sums="8740d5061db01dca166ce2c959548a3232c85dce156fce3502da35f457db79db2bf23242ee6d26b64f4141c451db733898328b8fc3d1f62b47e8f7ec790577d1 lua-b64-0.1.tar.gz
-6da3b8048b2e6772a4aac954ea2db35f9c21897d720e7ff9dc6c1d63ffc37eeb4fb91be46bc13b32a2c3d1b88997172fe259ea699ac8591f0f3e1fd53cae378b 0001-b64-fix-segfault-caused-by-signed-char.patch"