# Maintainer: Natanael Copa _luaversions="5.1 5.2 5.3" _name=lyaml pkgname=lua-$_name pkgver=5.1.4 pkgrel=0 pkgdesc="LibYAML binding for Lua" url="https://github.com/gvvaughan/lyaml" arch="all" license="MIT" depends="" depends_dev="" makedepends="$depends_dev yaml-dev" subpackages="" for _i in $_luaversions; do makedepends="$makedepends 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" _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 } build() { cd "$_builddir" for _i in $_luaversions; do cd build-$_i && \ LUA=lua$_i \ LUA_INCLUDE="$(pkg-config --cflags lua$_i)" \ ../configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --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 } _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 } for _i in $_luaversions; do eval "_${_i/./}() { _split $_i lyaml; }" done md5sums="52e44331e2af7797b340920c8fd3b942 lyaml-5.1.4.tar.gz" sha256sums="7893744d32facf8c98a8b570f5b783ee7a213c09a9f049b9f6254c767c471837 lyaml-5.1.4.tar.gz" sha512sums="2fafe985f3a23f88d2a1e2bd4d5ff080a99266ac795bc0cae3ea50d545624d4c7f9b9041912a250876898be2800a4a308425442ad7c60172c4d28a036a859d4e lyaml-5.1.4.tar.gz"