aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
Diffstat (limited to 'community')
-rw-r--r--community/lua-lgi/APKBUILD76
1 files changed, 76 insertions, 0 deletions
diff --git a/community/lua-lgi/APKBUILD b/community/lua-lgi/APKBUILD
new file mode 100644
index 0000000000..d344988df4
--- /dev/null
+++ b/community/lua-lgi/APKBUILD
@@ -0,0 +1,76 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_luaversions="5.1 5.2 5.3"
+pkgname=lua-lgi
+pkgver=0.9.1
+pkgrel=0
+pkgdesc="Dynamic Lua binding to GObject libraries using GObject-Introspection"
+url="http://github.com/pavouk/lgi"
+arch="all"
+license="MIT"
+depends=""
+depends_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"
+
+_sdir="$srcdir"/lgi-$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
+ for _i in $_luaversions; do
+ cp -r "$_sdir" "$srcdir"/build-$_i
+ done
+}
+
+build() {
+ 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() {
+ 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"
+ install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
+ 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="0c85f177e4b8192bd849b4e508c8bdf0 lgi-0.9.1.tar.gz"
+sha256sums="0c70fb2b1ca17d333b7e2c18d5fc943944b5872e063de60df3035ee20b6dafba lgi-0.9.1.tar.gz"
+sha512sums="f8ebb18610262fa0019f5c301beb2388b45ec21756f734627ba1a8db4a923fbbaafee20e70a4d2bb9efb6163656a19511a85304fd9fce8ff982aeb8cc195e78a lgi-0.9.1.tar.gz"