aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-13 10:56:41 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-13 11:23:45 +0000
commitddca8a87eaea9bbb7f699862fea9d21a9a319217 (patch)
treef58b4f970f6615b5875ac671c34ede14bc6609aa
parent3627ff4db6c5b8ea43a1e7638abddb52568f5ce2 (diff)
downloadaports-ddca8a87eaea9bbb7f699862fea9d21a9a319217.tar.bz2
aports-ddca8a87eaea9bbb7f699862fea9d21a9a319217.tar.xz
main/lua-lgi: add lua 5.2 support
-rw-r--r--main/lua-lgi/APKBUILD52
1 files changed, 43 insertions, 9 deletions
diff --git a/main/lua-lgi/APKBUILD b/main/lua-lgi/APKBUILD
index ba48e882bd..9fef5b8208 100644
--- a/main/lua-lgi/APKBUILD
+++ b/main/lua-lgi/APKBUILD
@@ -1,20 +1,26 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2"
pkgname=lua-lgi
pkgver=0.7.2
-pkgrel=0
-pkgdesc="Lua binding using gobject-introspection"
+pkgrel=1
+pkgdesc="Dynamic Lua binding to GObject libraries using GObject-Introspection"
url="http://github.com/pavouk/lgi"
arch="all"
license="MIT"
-depends=""
+depends="lua5.1-lgi"
depends_dev=""
-makedepends="lua-dev gtk+-dev gobject-introspection-dev libffi-dev"
+makedepends="glib-dev gobject-introspection-dev libffi-dev"
install=""
subpackages="$pkgname-doc"
+for _i in $_luaversions; do
+ makedepends="$makedepends lua$_i-dev"
+ subpackages="$subpackages lua$_i-lgi:split_${_i/./_}"
+done
+
source="lgi-$pkgver.tar.gz::https://github.com/pavouk/lgi/archive/$pkgver.tar.gz"
-_builddir="$srcdir"/lgi-$pkgver
+_sdir="$srcdir"/lgi-$pkgver
prepare() {
local i
cd "$_builddir"
@@ -23,20 +29,48 @@ prepare() {
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
+ for _i in $_luaversions; do
+ cp -r "$_sdir" "$srcdir"/build-$_i
+ done
}
build() {
- cd "$_builddir"
- make PREFIX=/usr
+ for _i in $_luaversions; do
+ msg "build for $_i"
+ make -C "$srcdir"/build-$_i PREFIX=/usr LUA_VERSION=$_i \
+ LUA_CFLAGS="$(pkg-config --cflags lua$_i)" \
+ || return 1
+ done
}
package() {
- cd "$_builddir"
- make install PREFIX=/usr DESTDIR="$pkgdir"
+ for _i in $_luaversions; do
+ cd "$srcdir"/build-$_i
+ make install PREFIX=/usr DESTDIR="$pkgdir" LUA_VERSION=$_i \
+ || return 1
+ done
+ cd "$_sdir"
mkdir -p "$pkgdir"/usr/share/doc/lua-lgi
cp -r docs/* samples "$pkgdir"/usr/share/doc/lua-lgi/
}
+_split() {
+ local d= _ver=$1
+ pkgdesc="Lua $_ver binding to GObject libraries using introspection"
+ replaces="$pkgname"
+ depends=
+ for d in usr/lib/lua usr/share/lua; do
+ if [ -d "$pkgdir"/$d/$_ver ]; then
+ mkdir -p "$subpkgdir"/$d
+ mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
+ fi
+ done
+}
+
+for _i in $_luaversions; do
+ eval "split_${_i/./_}() { _split $_i; }"
+done
+
md5sums="f41902695c3d8ef40312d7c654885bf3 lgi-0.7.2.tar.gz"
sha256sums="76a590f36fe1389d69d116e15ceb6983eab346a16702e8f41604ac73de3b1446 lgi-0.7.2.tar.gz"
sha512sums="e661e13d6f539c2c434a6b0db9e622ee4af3c039a6488617954643f0b46a908068a14e6d37ff44437fbe5b4cb62863699107ab533aca121d4b8d584ca83c35fc lgi-0.7.2.tar.gz"