aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lyaml
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-11-22 03:27:08 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-22 03:27:31 +0100
commit845f456eca477f8a1d23784a413c9a79a6849512 (patch)
tree7de3c39caea13290aaa69737edbc3debf2cc003a /main/lua-lyaml
parentc67dddcf6c63950a35a81f2e26333b5c69ffbacf (diff)
downloadaports-845f456eca477f8a1d23784a413c9a79a6849512.tar.bz2
aports-845f456eca477f8a1d23784a413c9a79a6849512.tar.xz
main/lua-lyaml: fix and improve abuild
Diffstat (limited to 'main/lua-lyaml')
-rw-r--r--main/lua-lyaml/APKBUILD88
1 files changed, 32 insertions, 56 deletions
diff --git a/main/lua-lyaml/APKBUILD b/main/lua-lyaml/APKBUILD
index b9ab78ad9d..f0b1671c56 100644
--- a/main/lua-lyaml/APKBUILD
+++ b/main/lua-lyaml/APKBUILD
@@ -1,47 +1,34 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
-
-_luaversions="5.1 5.2 5.3"
-_name=lyaml
-pkgname=lua-$_name
+_pkgname=lyaml
+pkgname=lua-$_pkgname
pkgver=6.1
-pkgrel=0
+pkgrel=1
pkgdesc="LibYAML binding for Lua"
url="https://github.com/gvvaughan/lyaml"
arch="all"
license="MIT"
depends=""
-depends_dev=""
-makedepends="$depends_dev yaml-dev"
+makedepends="yaml-dev"
subpackages=""
-for _i in $_luaversions; do
- makedepends="$makedepends lua$_i lua$_i-dev"
- subpackages="$subpackages lua$_i-$_name:_${_i/./}"
-done
-
-install=""
replaces="lua-yaml"
-source="lyaml-$pkgver.tar.gz::https://github.com/gvvaughan/lyaml/archive/release-v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/gvvaughan/$_pkgname/archive/release-v$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-release-v$pkgver"
-_builddir="$srcdir"/lyaml-release-v$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
- mkdir build-$_i
- done
-}
+_luaversions="5.1 5.2 5.3"
+for _v in $_luaversions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages lua$_v-$_pkgname:_subpackage"
+done
build() {
- cd "$_builddir"
- for _i in $_luaversions; do
- cd build-$_i && \
- LUA=lua$_i \
- LUA_INCLUDE="$(pkg-config --cflags lua$_i)" \
+ local lver; for lver in $_luaversions; do
+ msg "Building for Lua $lver..."
+
+ mkdir "$builddir"/build-$lver
+ cd "$builddir"/build-$lver
+
+ LUA="lua$lver" \
+ LUA_INCLUDE="$(pkg-config --cflags lua$lver)" \
../configure \
--build=$CBUILD \
--host=$CHOST \
@@ -52,36 +39,25 @@ build() {
--localstatedir=/var \
|| return 1
make || return 1
- cd ..
done
}
package() {
- for _i in $_luaversions; do
- cd "$_builddir"/build-$_i
- make DESTDIR="$pkgdir" install || return 1
- done
+ mkdir -p "$pkgdir"
}
-_split() {
- local d= _ver=$1
- depends=
- install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
- for d in usr/lib/lua usr/share/lua; do
- if [ -d "$pkgdir"/$d/$_ver ]; then
- mkdir -p "$subpkgdir"/$d/$_ver
- mv "$pkgdir"/$d/$_ver/* "$subpkgdir"/$d/$_ver/ \
- || return 1
- rmdir "$pkgdir"/$d/$_ver 2>/dev/null || true
- fi
- done
-}
+_subpackage() {
+ local lver="${subpkgname:3:3}"
+ pkgdesc="$pkgdesc $lver"
+ depends="lua$lver"
+ install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
-for _i in $_luaversions; do
- eval "_${_i/./}() { _split $_i lyaml; }"
-done
+ cd "$builddir"/build-$lver
+ make DESTDIR="$subpkgdir" install || return 1
+ rm -Rf "$subpkgdir"/usr/share/doc
+}
-md5sums="e11c2bf29b539674dfc5b4a094550dc5 lyaml-6.1.tar.gz"
-sha256sums="7063e50dfcee25f87f1a29fc2d75d12e5d8fd83522a99936d51841c3f374851a lyaml-6.1.tar.gz"
-sha512sums="0730001fcd171f88a8fe8917f9fb8c403d5d7461dda8dfee73a555ac7899dc6c6042fda1ce0e69bb335ba0930ff650763a3e15b363ce61832bb3bb838de22bd6 lyaml-6.1.tar.gz"
+md5sums="e11c2bf29b539674dfc5b4a094550dc5 lua-lyaml-6.1.tar.gz"
+sha256sums="7063e50dfcee25f87f1a29fc2d75d12e5d8fd83522a99936d51841c3f374851a lua-lyaml-6.1.tar.gz"
+sha512sums="0730001fcd171f88a8fe8917f9fb8c403d5d7461dda8dfee73a555ac7899dc6c6042fda1ce0e69bb335ba0930ff650763a3e15b363ce61832bb3bb838de22bd6 lua-lyaml-6.1.tar.gz"