summaryrefslogtreecommitdiffstats
path: root/main/lua-stringy/APKBUILD
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-07-11 17:17:22 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-07-11 17:23:02 +0300
commit2f4fe7a3dec8be69a248e4086b4c99f9135541e7 (patch)
tree7510224b4f187bc2d9eb4b2e5ca2d538acc0a9bf /main/lua-stringy/APKBUILD
parent56b3caa54422c3e2a4e924dd51c07b346f62068b (diff)
downloadaports-2f4fe7a3dec8be69a248e4086b4c99f9135541e7.tar.bz2
aports-2f4fe7a3dec8be69a248e4086b4c99f9135541e7.tar.xz
main/lua-stringy: upgrade to 0.4 and support Lua 5.2
Diffstat (limited to 'main/lua-stringy/APKBUILD')
-rw-r--r--main/lua-stringy/APKBUILD63
1 files changed, 48 insertions, 15 deletions
diff --git a/main/lua-stringy/APKBUILD b/main/lua-stringy/APKBUILD
index a38718f8c..68798781f 100644
--- a/main/lua-stringy/APKBUILD
+++ b/main/lua-stringy/APKBUILD
@@ -1,42 +1,75 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+
+_luaversions="5.1 5.2"
pkgname=lua-stringy
-pkgver=0.2
-pkgrel=0
+pkgver=0.4
+pkgrel=2
pkgdesc="Lua string utility library"
-url="http://hackmap.blogspot.com"
+url="https://github.com/brentp/lua-projects/"
arch="all"
license="MIT"
depends=""
-makedepends="lua lua-dev"
+makedepends=""
install=""
subpackages=""
-source="http://bpbio.googlecode.com/files/stringy-$pkgver.tar.gz
- stringy-memcmp.patch"
+source="lua-projects-$pkgver.tar.gz::https://github.com/brentp/lua-projects/archive/$pkgver.tar.gz
+ link-to-correct-lua-version.patch"
+
+for _v in $_luaversions; do
+ depends="$depends lua$_v-stringy"
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-stringy:split_${_v/./_}"
+done
+
-_builddir="$srcdir"/stringy-$pkgver
+_builddir="$srcdir"/lua-projects-$pkgver/stringy
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ *.patch) msg $i; patch -p2 -i "$srcdir"/$i || return 1;;
esac
done
}
build() {
cd "$_builddir"
- ${CC:-gcc} ${CFLAGS} -fPIC -shared ${LDFLAGS} -llua -o stringy.so stringy.c || return 1
- lua stringy_test.lua
+ for _v in $_luaversions; do
+ make CC="${CC:-gcc}" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
+ LUA_PC="lua$_v" LUA="lua$_v" || return 1
+ mv stringy.so stringy.so.$_v
+ make clean
+ done
}
package() {
- local _lualibdir=/usr/lib/lua/5.1
+ local d
cd "$_builddir"
- mkdir -p "$pkgdir"/$_lualibdir
- cp stringy.so "$pkgdir"/$_lualibdir/
+ for _v in $_luaversions; do
+ d=$pkgdir/usr/lib/lua/$_v
+ mkdir -p "$d" || return 1
+ cp stringy.so.$_v "$d/stringy.so"
+ done
}
-md5sums="c53f05a37410a234d4afa0aa3210d800 stringy-0.2.tar.gz
-b3fbeca41227425894d6e0d74a684969 stringy-memcmp.patch"
+_split() {
+ local d=usr/lib/lua
+ replaces="$pkgname"
+ depends=
+ mkdir -p "$subpkgdir/$d" || return 1
+ mv "$pkgdir/$d/$1" "$subpkgdir/$d"
+}
+
+for _v in $_luaversions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
+
+
+md5sums="cac1787756fe42151d7b60df9f19c9e3 lua-projects-0.4.tar.gz
+9c882939f48bf6dd129b93e46d6f4eb3 link-to-correct-lua-version.patch"
+sha256sums="72a800d2e3e1cc13fbf458ad5cbc06b8ea705afedfe72221dbe9e7cec935721e lua-projects-0.4.tar.gz
+5df2a0cc52ccdecd2a6b1a8f07d2c53aba805da5ba5cf1b129c94d68c1331026 link-to-correct-lua-version.patch"
+sha512sums="7bcd5449a99e5e1633e9cd1175208f1cde65a8dddbd9a06726c16518805387a5d3809fc7644fae090c4f3e948ed1364911e12d923fc26dbf5378c8adb1a07b3a lua-projects-0.4.tar.gz
+dd498d9cda5af9f751d3566bfa01ae575eb2513b7fb5d4cd197f95cc1dcd08a17b5a806b06ae1c65545e69ca961cddde73d1e75682269937e1f568b9f4603083 link-to-correct-lua-version.patch"