aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua5.3
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-13 09:40:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-13 09:41:16 +0000
commitcb9b37bfb678275fef1caa533d274d3b7833cbc3 (patch)
tree0ff4af76b337beec4a810c1f9192ce8529304896 /main/lua5.3
parent0361e23ce55e70508d52d2678c202829a72d0fad (diff)
downloadaports-cb9b37bfb678275fef1caa533d274d3b7833cbc3.tar.bz2
aports-cb9b37bfb678275fef1caa533d274d3b7833cbc3.tar.xz
main/lua5.3: use linenoise for cli history
Diffstat (limited to 'main/lua5.3')
-rw-r--r--main/lua5.3/APKBUILD16
-rw-r--r--main/lua5.3/linenoise.patch18
2 files changed, 28 insertions, 6 deletions
diff --git a/main/lua5.3/APKBUILD b/main/lua5.3/APKBUILD
index 153aab6e5c..2603507706 100644
--- a/main/lua5.3/APKBUILD
+++ b/main/lua5.3/APKBUILD
@@ -2,7 +2,7 @@
pkgname=lua5.3
pkgver=5.3.0
_luaver=${pkgname#lua}
-pkgrel=1
+pkgrel=2
pkgdesc="Powerful light-weight programming language"
url="http://www.lua.org/"
arch="all"
@@ -14,6 +14,7 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="http://www.lua.org/ftp/lua-$pkgver.tar.gz
lua-5.3-make.patch
lua-5.3-module_paths.patch
+ linenoise.patch
"
_builddir="$srcdir"/lua-$pkgver
@@ -51,10 +52,10 @@ build() {
|| return 1
cd src
make V=${pkgver%.*} \
- CFLAGS=" -DLUA_USE_LINUX -DLUA_COMPAT_ALL" \
+ CFLAGS=" -DLUA_USE_LINUX -DLUA_COMPAT_ALL -DLUA_USE_LINENOISE" \
SYSLDFLAGS="$LDFLAGS" \
RPATH="/usr/lib" \
- LIB_LIBS="-lpthread -lm -ldl" \
+ LIB_LIBS="-lpthread -lm -ldl -llinenoise" \
alpine_all || return 1
}
@@ -135,10 +136,13 @@ libs() {
md5sums="a1b0a7e92d0c85bbff7a8d27bf29f8af lua-5.3.0.tar.gz
67acac7d9e37da67806f6a08c8100599 lua-5.3-make.patch
-eefd0de61b6993c62a880dc218c9abd6 lua-5.3-module_paths.patch"
+eefd0de61b6993c62a880dc218c9abd6 lua-5.3-module_paths.patch
+1447ddfe8a4217b1d23ece0583ab771c linenoise.patch"
sha256sums="ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01 lua-5.3.0.tar.gz
64eafd1d2945623fe807384f9967f94d485b4b9b620ed977b3faca80548444ce lua-5.3-make.patch
-d2e2d96d3b10e72dda2c78cb7f478d655c730195d46ab466c961a7846793c644 lua-5.3-module_paths.patch"
+d2e2d96d3b10e72dda2c78cb7f478d655c730195d46ab466c961a7846793c644 lua-5.3-module_paths.patch
+a1761ba3151e5f0c921debecb39a7ac983a6311f08f7e5691de9f05c4cb02964 linenoise.patch"
sha512sums="2b423e70c4c992a08d28ef12f1d0b078f2ee7043cda302d93e9d59ff6ab79152bb4971455d37666a98cf5cfe3cafd3d16e30b33a11fd585743d5d817424a2d51 lua-5.3.0.tar.gz
1bc6c623024c1738155b30ff9c0edcce0f336edc25aa20c3a1400c859421ea2015d75175cce8d515e055ac3e96028426b74812e04022af18a0ed4c4601556027 lua-5.3-make.patch
-313ff823ed871f380a2cb0ba1f0afbba5cfa9b98da40e6e5e8f3c7a2e5993b13c2577efbe7147b79e3903ff27d5a814fa782c1c925092b08510cb4ce02abf464 lua-5.3-module_paths.patch"
+313ff823ed871f380a2cb0ba1f0afbba5cfa9b98da40e6e5e8f3c7a2e5993b13c2577efbe7147b79e3903ff27d5a814fa782c1c925092b08510cb4ce02abf464 lua-5.3-module_paths.patch
+49880d1131b7bd2a3169a26f401769a91d9a6a62cefe68aa5a89097139289588b7ef753535a2d0ba7f45c0369c760554940fd810716b7b1353deace32432fcfe linenoise.patch"
diff --git a/main/lua5.3/linenoise.patch b/main/lua5.3/linenoise.patch
new file mode 100644
index 0000000000..fdca6205ae
--- /dev/null
+++ b/main/lua5.3/linenoise.patch
@@ -0,0 +1,18 @@
+--- ./src/lua.c.orig
++++ ./src/lua.c
+@@ -85,6 +85,15 @@
+ add_history(lua_tostring(L, idx)); /* add it to history */
+ #define lua_freeline(L,b) ((void)L, free(b))
+
++#elif defined(LUA_USE_LINENOISE)/* }{ */
++
++#include "linenoise.h"
++#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
++#define lua_saveline(L,idx) \
++ if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \
++ linenoiseHistoryAdd(lua_tostring(L, idx)); /* add it to history */
++#define lua_freeline(L,b) ((void)L, free(b))
++
+ #else /* }{ */
+
+ #define lua_readline(L,b,p) \