aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-lpeg
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-07-23 13:05:23 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2015-07-23 13:05:23 +0200
commitae3ec2641752f116afdd85c50d41eb9a435f428c (patch)
tree29d5e840e19dbd1b4b289ab0e849326ec30c072e /testing/lua-lpeg
parent5bf3a4262eabe78953cd73be2ec30ed84336b022 (diff)
downloadaports-ae3ec2641752f116afdd85c50d41eb9a435f428c.tar.bz2
aports-ae3ec2641752f116afdd85c50d41eb9a435f428c.tar.xz
testing/lua-lpeg: new aport
Diffstat (limited to 'testing/lua-lpeg')
-rw-r--r--testing/lua-lpeg/APKBUILD70
1 files changed, 70 insertions, 0 deletions
diff --git a/testing/lua-lpeg/APKBUILD b/testing/lua-lpeg/APKBUILD
new file mode 100644
index 0000000000..1f603b0ae3
--- /dev/null
+++ b/testing/lua-lpeg/APKBUILD
@@ -0,0 +1,70 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=lua-lpeg
+pkgver=0.12.2
+_lua_versions="5.1 5.2 5.3"
+pkgrel=0
+pkgdesc="Pattern-matching library for Lua"
+url="http://www.inf.puc-rio.br/~roberto/lpeg"
+arch="all"
+license="MIT"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages=""
+source="http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$pkgver.tar.gz"
+for _v in $_lua_versions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-lpeg:split_${_v/./_}"
+done
+
+_builddir="$srcdir"/lpeg-$pkgver
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+
+ sed 's/^CFLAGS =/CFLAGS +=/' -i makefile || return 1
+ sed 's/^COPT =/# COPT =/' -i makefile || return 1
+
+ for _ver in $_lua_versions; do
+ cp -r "$_builddir" "$srcdir"/$pkgname-$_ver || return 1
+ done
+}
+
+build() {
+ for _ver in $_lua_versions; do
+ cd "$srcdir"/$pkgname-$_ver
+ make LUADIR=/usr/include/lua$_ver || return 1
+ done
+}
+
+package() {
+ arch="noarch"
+ mkdir -p "$pkgdir"
+}
+
+_split() {
+ local _ver="$1"
+ pkgdesc="Pattern-matching library for Lua $_ver"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ cd "$srcdir"/$pkgname-$_ver || return 1
+ install -Dm755 lpeg.so \
+ "$subpkgdir"/usr/lib/lua/$_ver/lpeg.so || return 1
+ install -Dm644 re.lua \
+ "$subpkgdir"/usr/share/lua/$_ver/re.lua || return 1
+}
+
+for _v in $_lua_versions; do
+ eval "split_${_v/./_}() { _split $_v; }"
+done
+
+md5sums="fabb614eb46e370d4f6b8fd82d17ca7e lpeg-0.12.2.tar.gz"
+sha256sums="6aad270b91d1b1c6fd75f68e162329a04a644e50e917d55f46cc8384b7120004 lpeg-0.12.2.tar.gz"
+sha512sums="81505674473d83e2c777d470cd6ba4eead48ecc32e58e52bc192ca7a167f882e722c5a0cae62937fb3f5f71d6216de1ba4ea3d932e72265028f293d778df5e9e lpeg-0.12.2.tar.gz"