aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-pty
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-05 23:46:58 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-05 23:47:31 +0200
commitd19e261e8692ae8c0ac5189b6830c76add9d5370 (patch)
tree7133141ca3a33d90df7ce0317212188f33bbae66 /main/lua-pty
parentbc97487e3ebfa5bdf0496b844c1dfd1d3aa0d71b (diff)
downloadaports-d19e261e8692ae8c0ac5189b6830c76add9d5370.tar.bz2
aports-d19e261e8692ae8c0ac5189b6830c76add9d5370.tar.xz
main/lua-pty: add subpackages for lua 5.1, 5.2, and 5.3
Diffstat (limited to 'main/lua-pty')
-rw-r--r--main/lua-pty/APKBUILD45
1 files changed, 38 insertions, 7 deletions
diff --git a/main/lua-pty/APKBUILD b/main/lua-pty/APKBUILD
index 22e87558c..12134b218 100644
--- a/main/lua-pty/APKBUILD
+++ b/main/lua-pty/APKBUILD
@@ -6,22 +6,53 @@ _rockver=1
pkgrel=0
pkgdesc="Lua module to control other programs via PTYs."
url="http://www.tset.de/lpty/"
-arch="all"
+arch="noarch"
license="MIT/X11"
depends=""
-makedepends="lua5.1-dev"
+makedepends=""
source="http://www.tset.de/downloads/$_pkgname-$pkgver-$_rockver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver-$_rockver"
+_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() {
+ default_prepare || return 1
+
+ local lver; for lver in $_luaversions; do
+ cp -r "$builddir" "$builddir-$lver" || return 1
+ done
+}
+
build() {
- cd "$builddir"
- make CFLAGS="-fPIC $CFLAGS" \
- LUAROOT=/usr LUA=lua5.1 LUAVERSION=5.1
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ cd "$builddir-$lver"
+ make CFLAGS="$CFLAGS -fPIC" \
+ LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
+ LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
+ LUA=lua$lver || return 1
+ done
}
package() {
- cd "$builddir"
- make INST_DIR="$pkgdir/usr" LUAVERSION=5.1 install
+ mkdir -p "$pkgdir"
+}
+
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc (for Lua $lver)"
+ arch="all"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
+ [ "$lver" = 5.1 ] && replaces="$pkgname"
+
+ cd "$builddir-$lver"
+ make INST_DIR="$subpkgdir/usr" LUAVERSION=$lver install
}
md5sums="6eadcd08580d8eb5e60abe7273b74d61 lpty-1.2.1-1.tar.gz"