libedit: Add package

This commit is contained in:
Fredrik Fornwall 2017-04-07 02:26:43 +02:00
parent 625ea13e84
commit 5ed1251f92
2 changed files with 31 additions and 0 deletions

10
packages/libedit/build.sh Normal file
View File

@ -0,0 +1,10 @@
TERMUX_PKG_HOMEPAGE=http://thrysoee.dk/editline/
TERMUX_PKG_DESCRIPTION="Library providing line editing, history, and tokenization functions"
TERMUX_PKG_VERSION=20170329-3.1
TERMUX_PKG_SRCURL=http://thrysoee.dk/editline/libedit-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=91f2d90fbd2a048ff6dad7131d9a39e690fd8a8fd982a353f1333dd4017dd4be
TERMUX_PKG_DEPENDS="libandroid-support, ncurses"
termux_step_pre_configure() {
CFLAGS+=" -D__STDC_ISO_10646__=201103L -DNBBY=CHAR_BIT"
}

View File

@ -0,0 +1,21 @@
diff -u -r ../libedit-20170329-3.1/src/readline.c ./src/readline.c
--- ../libedit-20170329-3.1/src/readline.c 2017-03-29 20:15:04.000000000 +0200
+++ ./src/readline.c 2017-04-07 02:16:41.501547191 +0200
@@ -1772,6 +1772,9 @@
char *
username_completion_function(const char *text, int state)
{
+#ifdef __ANDROID__
+ return NULL;
+#else
struct passwd *pass = NULL;
if (text[0] == '\0')
@@ -1794,6 +1797,7 @@
return NULL;
}
return strdup(pass->pw_name);
+#endif
}