screen compiling and working mostly (#608)

This commit is contained in:
its-pointless 2016-12-21 12:58:47 +11:00 committed by Fredrik Fornwall
parent 14a192d04d
commit 50f6d03229
8 changed files with 175 additions and 1 deletions

View File

@ -0,0 +1,30 @@
--- ../cache/screen-4.4.0/attacher.c 2016-06-19 19:41:03.000000000 +0000
+++ ./attacher.c 2016-12-20 06:59:46.351839178 +0000
@@ -71,7 +71,19 @@
static int multipipe[2];
# endif
#endif
+#ifdef __ANDROID__
+#define PWDLEN 128 /* used by Linux */
+char *getpass (const char *prompt)
+{
+ char *s;
+ static char pwd[PWDLEN];
+ fputs (prompt,stdout);
+ fgets (pwd,PWDLEN-1,stdin);
+ if (s = strchr (pwd,'\n')) *s = '\0';
+ return pwd;
+}
+#endif
static int ContinuePlease;
@@ -921,7 +933,6 @@
#endif
debug("screen_builtin_lck looking in gcos field\n");
- strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);
fullname[sizeof(fullname) - 9] = 0;
if ((cp1 = index(fullname, ',')) != NULL)

View File

@ -3,10 +3,12 @@ TERMUX_PKG_DESCRIPTION="Terminal multiplexer with VT100/ANSI terminal emulation"
TERMUX_PKG_VERSION=4.4.0
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/screen/screen-${TERMUX_PKG_VERSION}.tar.gz
# TERMUX_PKG_DEPENDS="pcre, openssl, libuuid"
# TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ssl=openssl"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-colors256 --with-ssl=openssl --disable-socket-dir"
termux_step_pre_configure () {
# Run autoreconf since we have patched configure.ac
cd $TERMUX_PKG_SRCDIR
autoconf
CFLAGS+=" -DGETUTENT"
LDFLAGS+=" -llog"
}

View File

@ -0,0 +1,19 @@
--- ../cache/screen-4.4.0/misc.c 2016-06-19 19:41:03.000000000 +0000
+++ ./misc.c 2016-12-20 03:13:04.387236649 +0000
@@ -37,7 +37,6 @@
#ifdef SVR4
# include <sys/resource.h>
#endif
-
extern struct layer *flayer;
extern int eff_uid, real_uid;
@@ -379,6 +378,8 @@
#endif /* SVR4 */
#if defined(SYSV) && defined(NOFILE) && !defined(ISC)
f = NOFILE;
+#elif defined(__ANDROID__)
+ f = sysconf(_SC_OPEN_MAX);
#else /* SYSV && !ISC */
f = getdtablesize();
#endif /* SYSV && !ISC */

View File

@ -0,0 +1,30 @@
--- ../cache/screen-4.4.0/os.h 2016-06-19 19:41:03.000000000 +0000
+++ ./os.h 2016-12-20 02:03:49.513365234 +0000
@@ -129,15 +129,17 @@
#ifdef SYSV
# define index strchr
# define rindex strrchr
+#ifndef __ANDROID__
# define bzero(poi,len) memset(poi,0,len)
+#endif
# define bcmp memcmp
# define killpg(pgrp,sig) kill( -(pgrp), sig)
#endif
-
#ifndef HAVE_GETCWD
# define getcwd(b,l) getwd(b)
#endif
+#ifndef __ANDROID__
#ifndef USEBCOPY
# ifdef USEMEMMOVE
# define bcopy(s,d,len) memmove(d,s,len)
@@ -150,6 +152,8 @@
# endif
# endif
#endif
+#endif
+
#if defined(HAVE_SETRESUID) && !defined(HAVE_SETREUID)
# define setreuid(ruid, euid) setresuid(ruid, euid, -1)

View File

@ -0,0 +1,13 @@
--- ../cache/screen-4.4.0/osdef.h.in 2016-06-19 19:41:03.000000000 +0000
+++ ./osdef.h.in 2016-12-20 06:56:21.153724184 +0000
@@ -133,8 +133,9 @@
extern char *getwd __P((char *));
extern char *getenv __P((char *));
extern time_t time __P((time_t *));
-
+#ifndef __ANDROID__
extern char *getpass __P((char *));
+#endif
extern char *getlogin __P((void));
extern char *ttyname __P((int));

View File

@ -0,0 +1,14 @@
--- ../cache/screen-4.4.0/screen.h 2016-06-19 19:41:03.000000000 +0000
+++ ./screen.h 2016-12-20 04:29:51.331170619 +0000
@@ -104,9 +104,9 @@
#define MAXHISTHEIGHT 3000
#define DEFAULTHISTHEIGHT 100
#if defined(NAME_MAX) && NAME_MAX < 16
-# define DEFAULT_BUFFERFILE "/tmp/screen-xchg"
+# define DEFAULT_BUFFERFILE "/data/data/com.termux/files/usr/tmp/screen-xchg"
#else
-# define DEFAULT_BUFFERFILE "/tmp/screen-exchange"
+# define DEFAULT_BUFFERFILE "/data/data/com.termux/files/usr/tmp/screen-exchange"
#endif

View File

@ -0,0 +1,55 @@
--- ../cache/screen-4.4.0/utmp.c 2016-06-19 19:41:03.000000000 +0000
+++ ./utmp.c 2016-12-20 04:10:53.775426042 +0000
@@ -33,11 +33,13 @@
#include "config.h"
#include "screen.h"
#include "extern.h"
-
+#include "os.h"
#ifdef HAVE_UTEMPTER
#include <utempter.h>
#endif
-
+#ifdef __ANDROID__
+#define DEAD_PROCESS 8
+#endif
extern struct display *display;
#ifdef CAREFULUTMP
@@ -94,11 +96,12 @@
static int initutmp __P((void));
static void setutent __P((void));
#endif
+#ifndef __ANDROID__
#if defined(linux) && defined(GETUTENT)
static struct utmp *xpututline __P((struct utmp *utmp));
# define pututline xpututline
#endif
-
+#endif
static int utmpok;
static char UtmpName[] = UTMPFILE;
@@ -558,7 +561,6 @@
bzero((char *)&u, sizeof(u));
strncpy(u.ut_line, slot, sizeof(u.ut_line));
setutent();
- return getutline(&u);
}
static int
@@ -872,7 +874,7 @@
return *retbuf ? retbuf : NULL;
}
# endif /* BUGGYGETLOGIN */
-
+#ifndef __ANDROID__
#if defined(linux) && defined(GETUTENT)
# undef pututline
@@ -890,4 +892,5 @@
return u->ut_type == u2->ut_type ? u : 0;
}
#endif
+#endif

View File

@ -0,0 +1,11 @@
--- ../cache/screen-4.4.0/window.c 2016-06-19 19:41:03.000000000 +0000
+++ ./window.c 2016-12-20 04:50:22.247981493 +0000
@@ -112,7 +112,7 @@
int VerboseCreate = 0; /* XXX move this to user.h */
-char DefaultShell[] = "/bin/sh";
+char DefaultShell[] = "/data/data/com.termux/files/home/.termux/shell";
#ifndef HAVE_EXECVPE
static char DefaultPath[] = ":/usr/ucb:/bin:/usr/bin";
#endif