diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-03 08:36:47 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-03 08:53:46 +0000 |
commit | 27575032190ba19e5074f3ad69f58fbe2267d1d8 (patch) | |
tree | 12d0ebeee1450970ee838328be9268c655385e8b /main/lua-stdlib/APKBUILD | |
parent | 8e5c0417ec58a516fe6b391867d463f03917684e (diff) | |
download | aports-27575032190ba19e5074f3ad69f58fbe2267d1d8.tar.bz2 aports-27575032190ba19e5074f3ad69f58fbe2267d1d8.tar.xz |
main/lua-stdlib: upgrade to 41.2.0 and add lua 5.2, 5.3 support
Diffstat (limited to 'main/lua-stdlib/APKBUILD')
-rw-r--r-- | main/lua-stdlib/APKBUILD | 83 |
1 files changed, 63 insertions, 20 deletions
diff --git a/main/lua-stdlib/APKBUILD b/main/lua-stdlib/APKBUILD index 709208852e..3ce1a459a5 100644 --- a/main/lua-stdlib/APKBUILD +++ b/main/lua-stdlib/APKBUILD @@ -1,36 +1,79 @@ -# Maintainer: Natnae +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> + +_luaversions="5.1 5.2 5.3" pkgname=lua-stdlib -pkgver=26 +pkgver=41.2.0 pkgrel=0 pkgdesc="Lua library of modules for common programming tasks" -url="http://luaforge.net/projects/stdlib/" +url="https://github.com/lua-stdlib/lua-stdlib" arch="noarch" license="MIT/X" depends= -makedepends="lua lua-dev" +makedepends="autoconf automake" install= subpackages="$pkgname-doc" -source="https://github.com/downloads/rrthomas/lua-stdlib/stdlib-$pkgver.zip" +for _v in $_luaversions; do + makedepends="$makedepends lua$_v-dev" + subpackages="$subpackages lua$_v-stdlib:split_${_v/./_}" +done +source="$pkgname-$pkgver.tar.gz::https://github.com/lua-stdlib/lua-stdlib/archive/release-v$pkgver.tar.gz" + +_sdir="$srcdir"/lua-stdlib-release-v$pkgver + +prepare() { + cd "$_sdir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done + aclocal && autoconf && automake --add-missing || return 1 + for _i in $_luaversions; do + cp -r "$_sdir" "$srcdir"/build-$_i || return 1 + done +} -_builddir="$srcdir"/stdlib-$pkgver -_luashare=/usr/share/lua/5.1 build() { - cd "$_builddir" - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --datadir="$_luashare" \ - || return 1 - make || return 1 + for _i in $_luaversions; do + msg "build for Lua $_i" + cd "$srcdir"/build-$_i + LUA=lua$_i LUA_INCLUDE=$(pkg-config lua$_i --cflags) \ + ./configure --prefix=/usr \ + --libdir=/usr/lib/lua/$_i \ + --datadir=/usr/share/lua/$_i \ + || return 1 + make || return 1 + done } package() { cd "$_builddir" - make install DESTDIR="$pkgdir" || return 1 - mkdir -p "$pkgdir"/usr/share/doc/$pkgname || return 1 - cd "$_builddir"/src - cp -r files modules index.html "$pkgdir"/usr/share/doc/$pkgname/ + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make DESTDIR="$pkgdir" luadir="/usr/share/lua/$_i" install \ + || return 1 + done } -md5sums="2f916405400dab91274db4ff50798d01 stdlib-26.zip" +_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 +} + + +for _v in $_luaversions; do + eval "split_${_v/./_}() { _split $_v; }" +done + + +md5sums="5d99d87b95ca64f1e079289fe9e486ff lua-stdlib-41.2.0.tar.gz" +sha256sums="c9d9d11dcd2e3e956e697f5455b5f62baadf233d8726d80514d0432273cc27e9 lua-stdlib-41.2.0.tar.gz" +sha512sums="27ee578d845b70d28e6cdeefc2d0f9163724d2ef4b5dff69820564d7ef2a3f06184b537c5796bd730653bd28cae28bffa29a28cb256f93914b9a43c50aceb8fe lua-stdlib-41.2.0.tar.gz" |