diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-04 20:52:57 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-04 20:54:42 +0200 |
commit | 6a672cdda3dc2c560540ccf164b1d18ea8105906 (patch) | |
tree | 4abcf2b96a369643627a62e689c4d73d6f056413 /main/lua-xml/APKBUILD | |
parent | 6a1e7a93bbc27a044874af176b4cd32f42c69e08 (diff) | |
download | aports-6a672cdda3dc2c560540ccf164b1d18ea8105906.tar.bz2 aports-6a672cdda3dc2c560540ccf164b1d18ea8105906.tar.xz |
main/lua-xml: improve abuild, add check func
Diffstat (limited to 'main/lua-xml/APKBUILD')
-rw-r--r-- | main/lua-xml/APKBUILD | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/main/lua-xml/APKBUILD b/main/lua-xml/APKBUILD index 2341a2c7ff..6ab35abcb2 100644 --- a/main/lua-xml/APKBUILD +++ b/main/lua-xml/APKBUILD @@ -1,76 +1,76 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> -_luaversions="5.2 5.3" pkgname=lua-xml -_name=luaxml +_pkgname=luaxml pkgver=130610 +_pkgver=$pkgver-1 pkgrel=4 -pkgdesc="a minimal set of functions for the processing of XML data in Lua" +pkgdesc="A minimal set of functions for the processing of XML data in Lua" url="https://github.com/LuaDist2/luaxml" arch="all" license="MIT" -depends= makedepends="" -install= -subpackages= +subpackages="" +source="$pkgname-$pkgver.tar.gz::https://github.com/LuaDist2/$_pkgname/archive/$_pkgver.tar.gz + 0001-Fix-error-where-TAG-should-be-xml.TAG.patch" +builddir="$srcdir/$_pkgname-$_pkgver" + +_luaversions="5.2 5.3" for _v in $_luaversions; do makedepends="$makedepends lua$_v-dev" - subpackages="$subpackages lua$_v-xml:split_${_v/./_}" + subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage" done -# Original upstream http://viremo.eludi.net/LuaXML/ is not available anymore. -source="$pkgname-$pkgver.tar.gz::https://github.com/LuaDist2/$_name/archive/$pkgver-1.tar.gz -0001-Fix-error-where-TAG-should-be-xml.TAG.patch" - -_builddir="$srcdir/$_name-$pkgver-1" prepare() { - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done + default_prepare || return 1 + cd "$builddir" + + # Remove garbage. + rm -f *.dll *.so *.zip - for i in $_luaversions; do - mkdir $i - cp *.c Makefile *.lua $i/ || return 1 + local lver; for lver in $_luaversions; do + cp -r "$builddir" "$builddir-$lver" || return 1 done } build() { - for i in $_luaversions; do - cd "$_builddir"/$i - make INCDIR="$CFLAGS $(pkg-config --cflags lua$i)" \ - LIBS= \ + local lver; for lver in $_luaversions; do + msg "Building for Lua $lver..." + + make -C "$builddir-$lver" \ + CFLAGS="$CFLAGS -fPIC" \ + LFLAGS="$LDFLAGS -fPIC -shared" \ + INCDIR=$(pkg-config --cflags lua$lver) \ + LIBS=$(pkg-config --libs lua$lver) \ || return 1 done } -package() { - for i in $_luaversions; do - cd "$_builddir"/$i - install -m755 -D LuaXML_lib.so \ - "$pkgdir"/usr/lib/lua/$i/LuaXML_lib.so || return 1 - install -m755 -D LuaXml.lua \ - "$pkgdir"/usr/share/lua/$i/LuaXml.lua || return 1 +check() { + local lver; for lver in $_luaversions; do + msg "Testing on Lua $lver" + + cd "$builddir-$lver" + lua$lver test.lua || return 1 done } -_split() { - local d= _ver=$1 - pkgdesc="$pkgdesc for Lua $_ver" - 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 +package() { + mkdir -p "$pkgdir" } -for _v in $_luaversions; do - eval "split_${_v/./_}() { _split $_v; }" -done +_subpackage() { + local lver="${subpkgname:3:3}" + pkgdesc="$pkgdesc $lver" + depends="lua$lver" + install_if="$pkgname=$pkgver-r$pkgrel lua$lver" + + cd "$builddir-$lver" + + install -m 755 -D LuaXML_lib.so \ + "$subpkgdir"/usr/lib/lua/$lver/LuaXML_lib.so || return 1 + install -m 755 -D LuaXml.lua \ + "$subpkgdir"/usr/share/lua/$lver/LuaXml.lua +} sha512sums="aabac62b5e748c04cd3591e5c2e6b417909c7a9efa1ff6c3dd1f546a2387220eb7fa1ffa56d3be0718a84a6fed51f287b68c7d334661c66787f7024d76142dfc lua-xml-130610.tar.gz 60ba65a0d47065e2609ca4d5c8d994fc29b9d4c6b5b0a060fa7f83612c71937999648e48dd26063f6528811eb053fe912ee5b6c4465576912c9dacb9bb406cae 0001-Fix-error-where-TAG-should-be-xml.TAG.patch" |