diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-10 13:59:41 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-10-10 14:39:28 +0000 |
commit | 40e6f34d8e271b5a23294952c4a2695674b7a7e5 (patch) | |
tree | 544fc5f3dcf4e10fdd869e52ab5152f3a8e004d0 /main/lua-socket | |
parent | 0b881a325f137e22f128643a20a13b18b9833a76 (diff) | |
download | aports-40e6f34d8e271b5a23294952c4a2695674b7a7e5.tar.bz2 aports-40e6f34d8e271b5a23294952c4a2695674b7a7e5.tar.xz |
main/lua-socket: upgrade to 3.0_rc3 and build both for lua 5.1 and 5.2
Diffstat (limited to 'main/lua-socket')
-rw-r--r-- | main/lua-socket/APKBUILD | 75 | ||||
-rw-r--r-- | main/lua-socket/include-luasocket.patch | 10 | ||||
-rw-r--r-- | main/lua-socket/lua-cflags.patch | 20 |
3 files changed, 87 insertions, 18 deletions
diff --git a/main/lua-socket/APKBUILD b/main/lua-socket/APKBUILD index 4e5665cfe2..6882347b43 100644 --- a/main/lua-socket/APKBUILD +++ b/main/lua-socket/APKBUILD @@ -1,45 +1,84 @@ # Contributor: Mika Havela <mika.havela@gmail.com> # Maintainer: Mika Havela <mika.havela@gmail.com> +_luaversions="5.1 5.2" pkgname=lua-socket _name=luasocket -pkgver=2.0.2 -pkgrel=4 -pkgdesc="Luasocket is the most comprehensive networking support library for the Lua language." +pkgver=3.0_rc1 +pkgrel=0 +_ver=${pkgver/_/-} +pkgdesc="Networking library for Lua" url="http://luaforge.net/projects/luasocket/" arch="all" license="MIT" -depends="lua" -makedepends="lua-dev" install= -source="http://luaforge.net/frs/download.php/2664/luasocket-$pkgver.tar.gz - unix.patch" -replaces=luasocket +depends="lua5.1-socket" +makedepends="" +subpackages="" +for _i in $_luaversions; do + makedepends="$makedepends lua$_i-dev" + subpackages="$subpackages lua$_i-socket:split_${_i/./_}" +done +source="luasocket-$_ver.tar.gz::https://github.com/diegonehab/luasocket/archive/v$_ver.tar.gz + lua-cflags.patch + include-luasocket.patch" -_builddir="$srcdir/$_name-$pkgver" +_sdir="$srcdir/$_name-$_ver" 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 + + for _i in $_luaversions; do + cp -r "$_sdir" "$srcdir"/build-$_i + # set lua version + sed -i -e "/^LUAV?=/s/=.*/=$_i/" \ + "$srcdir"/build-$_i/src/makefile || return 1 + done } build() { cd "$_builddir" - make || return 1 + for _i in $_luaversions; do + make -C "$srcdir"/build-$_i/src all-unix || return 1 + done } package() { cd "$_builddir" - local cmod=$(pkg-config --variable INSTALL_CMOD lua) - local lmod=$(pkg-config --variable INSTALL_LMOD lua) - make INSTALL_TOP_SHARE="$pkgdir/$lmod" \ - INSTALL_TOP_LIB="$pkgdir/$cmod" \ - install + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make prefix=/usr DESTDIR="$pkgdir" install-unix || return 1 + done } -md5sums="41445b138deb7bcfe97bff957503da8e luasocket-2.0.2.tar.gz -51c600494106ca39f9816f6574868628 unix.patch" +_split() { + local d= _ver=$1 + pkgdesc="Networking library for Lua $_ver" + replaces="$pkgname" + 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 _i in $_luaversions; do + eval "split_${_i/./_}() { _split $_i; }" +done + +md5sums="08bd2f265b244eb4bf5c2c36bf89b759 luasocket-3.0-rc1.tar.gz +f869d0f81e347291405fb53dff9a408a lua-cflags.patch +4bcbbc8d3383db94223155fc7a6d454e include-luasocket.patch" +sha256sums="8b67d9b5b545e1b694753dab7bd6cdbc24c290f2b21ba1e14c77b32817ea1249 luasocket-3.0-rc1.tar.gz +bbcead4850fcdf6711c70b48db4db17e06fedcae45c4c53fd814ff6f0d9fe4ce lua-cflags.patch +42b1a439805efaf33110e01a53798b3e8d044101470808fe9478ca3be0ae5165 include-luasocket.patch" +sha512sums="f6efce259aaacaa11472911471f8a13b118fe009b8953a82c6aa18b9ec829cd1293180904e56935cb130d36d267e3f27c91db2d78e03f7488f3e100571ed0540 luasocket-3.0-rc1.tar.gz +58b5d3c239c8be1561060f75bf849bcfa9022626995a5234ec741dc2ae86755d9fed88c12b5644c914c604ea31b017a6679ac33a9a76392242faf139bfd59de1 lua-cflags.patch +34db925f9e9a1a629d01dc26072f4edec77087f7bf89dda8140326447662efbc53ce5e36087fa9127d708d498c129613f7ed82862dd3176df16796418868548d include-luasocket.patch" diff --git a/main/lua-socket/include-luasocket.patch b/main/lua-socket/include-luasocket.patch new file mode 100644 index 0000000000..e227b0414a --- /dev/null +++ b/main/lua-socket/include-luasocket.patch @@ -0,0 +1,10 @@ +--- ./src/serial.c.orig 2013-07-09 14:16:04.793467198 +0000 ++++ ./src/serial.c 2013-07-09 14:16:20.230304446 +0000 +@@ -11,6 +11,7 @@ + #include "socket.h" + #include "options.h" + #include "unix.h" ++#include "luasocket.h" + #include <sys/un.h> + + /* diff --git a/main/lua-socket/lua-cflags.patch b/main/lua-socket/lua-cflags.patch new file mode 100644 index 0000000000..eace4258aa --- /dev/null +++ b/main/lua-socket/lua-cflags.patch @@ -0,0 +1,20 @@ +--- ./src/makefile.orig 2013-07-09 14:20:08.772827698 +0000 ++++ ./src/makefile 2013-07-09 14:22:46.311231590 +0000 +@@ -142,6 +142,8 @@ + #------ + # Compiler and linker settings + # for Linux ++LUAPC=lua$(LUAV) ++LUA_CFLAGS=$(shell pkg-config --cflags $(LUAPC)) + SO_linux=so + O_linux=o + CC_linux=gcc +@@ -149,7 +151,7 @@ + -DLUASOCKET_API='__attribute__((visibility("default")))' \ + -DUNIX_API='__attribute__((visibility("default")))' \ + -DMIME_API='__attribute__((visibility("default")))' +-CFLAGS_linux= -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra \ ++CFLAGS_linux= $(LUA_CFLAGS) -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra \ + -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden + LDFLAGS_linux=-O -shared -fpic -o + LD_linux=gcc |