diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-08 08:39:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-08 11:12:01 +0000 |
commit | f357d1469c9d529631650c552382dc741570370f (patch) | |
tree | 6fbd12e67d8f7e4f74c7eac1022b3305185ba3e2 /main/lua-posix | |
parent | 246b199340fb27870c902720a9ecd21d1f5cb290 (diff) | |
download | aports-f357d1469c9d529631650c552382dc741570370f.tar.bz2 aports-f357d1469c9d529631650c552382dc741570370f.tar.xz |
main/lua-posix: upgrade to 5.1.28 and build for both 5.1 and 5.2
Diffstat (limited to 'main/lua-posix')
-rw-r--r-- | main/lua-posix/APKBUILD | 112 |
1 files changed, 70 insertions, 42 deletions
diff --git a/main/lua-posix/APKBUILD b/main/lua-posix/APKBUILD index e8ef999d8..3f0c4269d 100644 --- a/main/lua-posix/APKBUILD +++ b/main/lua-posix/APKBUILD @@ -1,65 +1,93 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> + +_luaversions="5.1 5.2" + pkgname=lua-posix _name=luaposix -pkgver=5.1.26 -pkgrel=1 -pkgdesc="POSIX library for Lua" +pkgver=5.1.28 +pkgrel=0 +pkgdesc="POSIX library for Lua $_luaver" url="https://github.com/luaposix/luaposix" arch="all" license="MIT" -depends="lua lua-bitlib" -makedepends="lua lua-dev perl ncurses-dev autoconf automake" -source="luaposix-$pkgver.tar.gz::https://github.com/luaposix/luaposix/archive/release-v$pkgver.tar.gz - 0001-Removed-Lua-5.2-functions-lua_len-and-lua_tointegerx.patch - lua-version.patch" +depends="lua5.1-posix" +makedepends="perl ncurses-dev" +subpackages="$pkgname-doc" + +for _i in $_luaversions; do + makedepends="$makedepends lua$_i-dev" + subpackages="$subpackages lua$_i-posix:_posix_${_i/./_} + lua$_i-curses:_curses_${_i/./_}" +done +source="luaposix-$pkgver.tar.gz::https://github.com/luaposix/luaposix/archive/release-v$pkgver.tar.gz" + -replaces="luaposix" -subpackages="lua-curses $pkgname-doc" -_builddir="$srcdir"/$_name-release-v$pkgver -_lualib=/usr/lib/lua/5.1 -_luashare=/usr/share/lua/5.1 +_sdir="$srcdir"/$_name-release-v$pkgver prepare() { - cd "$_builddir" + 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 + done } + build() { - cd "$_builddir" - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --libdir=$_lualib \ - --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 DESTDIR="$pkgdir" install || return 1 - rm "$pkgdir"/$_lualib/*.la || return 1 + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make DESTDIR="$pkgdir" install || return 1 + done + rm "$pkgdir"/usr/lib/lua/*/*.la || return 1 } -curses() { - pkgdesc="ncurses binding for Lua" - replaces="curses" - mkdir -p "$subpkgdir"/$_lualib "$subpkgdir"/$_luashare - mv "$pkgdir"/$_lualib/curses* "$subpkgdir"/$_lualib/ || return 1 - mv "$pkgdir"/$_luashare/curses* "$subpkgdir"/$_luashare/ || return 1 +_split() { + depends= + local d= _ver=$1 _f=$2 + 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/$_f* "$subpkgdir"/$d/ || return 1 + rmdir "$pkgdir"/$d/$_ver 2>/dev/null || true + fi + done +} + +_split_curses() { + local _ver=$1 + pkgdesc="ncurses binding for Lua $_ver" + _split $_ver curses } -md5sums="26018f1e581e24d2875e848a77d03139 luaposix-5.1.26.tar.gz -2af13134ae7e936e74f6f1f2f011a3ba 0001-Removed-Lua-5.2-functions-lua_len-and-lua_tointegerx.patch -6e725977a081eee3a7b555028c134372 lua-version.patch" -sha256sums="8de25b0013cc97ccf5ccd8b23012a548fb8ed682d8d95c849c3798bdfbda9866 luaposix-5.1.26.tar.gz -256504f015850b3126a53d40d6210b8d6f473bc3c180b74621c62709d3db594d 0001-Removed-Lua-5.2-functions-lua_len-and-lua_tointegerx.patch -63d1b73a37c99c8aa53c64b2f2ea00e922aadbf465b231aa73d77afceb76bf2b lua-version.patch" -sha512sums="48e8a7ab8752d0a87326226813c1feb4f76596c568eb657777c8861837fd036835107c1ef7125d9512d42326ce560249057a791e99c36e29228fae665443fb59 luaposix-5.1.26.tar.gz -b460d42e39c790ca4dd44b16923a9a44267a2b2088995eed9cdbfc9b852d9beb30f96a30cceddd6bbe32e2ed2cc806515e8d9e9fb7a3d877043a65f1f1f2394e 0001-Removed-Lua-5.2-functions-lua_len-and-lua_tointegerx.patch -bffef1c144a43b59b25e07d7def7a7f65ebd8ec1f48ed3692097470af4e6f01ff1a2385624685da697ebfe6a0082783d080bbfa7156f38e529315d91b6870ac8 lua-version.patch" + +_split_posix() { + local _ver=$1 + pkgdesc="POSIX library for Lua $_ver" + replaces="lua-posix" + _split $_ver posix +} + +for _i in $_luaversions; do + eval "_curses_${_i/./_}() { _split_curses $_i; }" + eval "_posix_${_i/./_}() { _split_posix $_i; }" +done + +md5sums="f543b8cc4fae5379ad8ed9cc1cfc2efc luaposix-5.1.28.tar.gz" +sha256sums="d82a322cb93d25ef16ba2cbab79f6fa1d94806249542d771c2c89a5f9cc4345f luaposix-5.1.28.tar.gz" +sha512sums="1ac95ea831d2eb81aec63f316335cea71c7435d06ad830c95f972ea87893b210dd7c684ca3da42111d02420e474dbfca20d7eb47db16ac096af8fff0f7fbc36f luaposix-5.1.28.tar.gz" |