diff --git a/build/screen/build.sh b/build/screen/build.sh index 99b0698be5..74950580f7 100755 --- a/build/screen/build.sh +++ b/build/screen/build.sh @@ -18,7 +18,7 @@ . ../../lib/build.sh PROG=screen -VER=4.9.1 +VER=5.0.0 PKG=terminal/screen SUMMARY="GNU Screen terminal multiplexer" DESC="A full-screen window manager that multiplexes a physical " @@ -31,6 +31,13 @@ set_standard XPG6 CONFIGURE_OPTS+=" --with-sys-screenrc=/etc/screenrc --enable-colors256 + --enable-utmp + --with-pty-rofs +" + +CONFIGURE_OPTS[WS]+=" + ac_cv_search_tgetent=-lncurses + ac_cv_search_openpty=\"none required\" " build_init() { diff --git a/build/screen/patches/Makefile.in.patch b/build/screen/patches/Makefile.in.patch index 6cc9035a8f..1889b9c00b 100644 --- a/build/screen/patches/Makefile.in.patch +++ b/build/screen/patches/Makefile.in.patch @@ -8,5 +8,5 @@ diff -wpruN --no-dereference '--exclude=*.orig' a~/Makefile.in a/Makefile.in -bindir = $(exec_prefix)/bin +bindir = @bindir@ - VERSION = @VERSION@ + VERSION = @PACKAGE_VERSION@ SCREEN = screen-$(VERSION) diff --git a/build/screen/patches/closefiles.patch b/build/screen/patches/closefiles.patch new file mode 100644 index 0000000000..7d81cae226 --- /dev/null +++ b/build/screen/patches/closefiles.patch @@ -0,0 +1,49 @@ +diff -wpruN --no-dereference '--exclude=*.orig' a~/misc.c a/misc.c +--- a~/misc.c 1970-01-01 00:00:00 ++++ a/misc.c 1970-01-01 00:00:00 +@@ -37,6 +37,9 @@ + #include + #include + #include ++#ifdef __sun ++#include /* fdwalk() declaration */ ++#endif + + #include "screen.h" + +@@ -150,6 +153,26 @@ void Kill(pid_t pid, int sig) + (void)kill(pid, sig); + } + ++#ifdef __sun ++ ++static int closeallfiles_cb(void *arg, int fd) ++{ ++ const int except = (int)(uintptr_t)arg; ++ ++ if (fd >= 3 && fd != except) ++ return (close(fd)); ++ ++ return (0); ++} ++ ++void closeallfiles(int except) ++{ ++ if (fdwalk(closeallfiles_cb, (void *)(uintptr_t)except) != 0) ++ Panic(errno, "fdwalk"); ++} ++ ++#else ++ + void closeallfiles(int except) + { + struct pollfd pfd[1024]; +@@ -178,6 +201,8 @@ void closeallfiles(int except) + } + } + ++#endif /* __sun */ ++ + /* + * Security - switch to real uid + */ diff --git a/build/screen/patches/gcc14.patch b/build/screen/patches/gcc14.patch index 81177338ae..d48faf32bd 100644 --- a/build/screen/patches/gcc14.patch +++ b/build/screen/patches/gcc14.patch @@ -1,58 +1,19 @@ -diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac ---- a~/configure.ac 1970-01-01 00:00:00 -+++ a/configure.ac 1970-01-01 00:00:00 -@@ -493,7 +493,7 @@ main() - } - l = sizeof(a); - close(0); -- if (accept(s1, &a, &l)) -+ if (accept(s1, (struct sockaddr *)&a, &l)) - return 1; - FD_SET(0, &f); - if (select(1, &f, 0, 0, 0) == -1) -@@ -914,7 +914,7 @@ AC_TRY_LINK([ - #define pututline _pututline - #endif - ], --[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), -+[int x = DEAD_PROCESS; pututline(NULL); getutent();], AC_DEFINE(GETUTENT), - olibs="$LIBS" - LIBS="$LIBS -lgen" - AC_CHECKING(getutent with -lgen) -@@ -931,7 +931,7 @@ AC_TRY_LINK([ - #define pututline _pututline - #endif - ], --[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs") -+[int x = DEAD_PROCESS; pututline(NULL); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs") - ) - AC_CHECKING(ut_host) - AC_TRY_COMPILE([ -@@ -962,6 +962,7 @@ fi - AC_CHECKING(getloadavg) - AC_TRY_LINK([ - #include -+ #include - ],[ - getloadavg((double *)0, 0);], - AC_DEFINE(LOADAV_GETLOADAVG) load=1, -diff -wpruN --no-dereference '--exclude=*.orig' a~/os.h a/os.h ---- a~/os.h 1970-01-01 00:00:00 -+++ a/os.h 1970-01-01 00:00:00 -@@ -131,7 +131,7 @@ extern int errno; - # define rindex strrchr - # define bzero(poi,len) memset(poi,0,len) - # define bcmp memcmp --# define killpg(pgrp,sig) kill( -(pgrp), sig) -+//# define killpg(pgrp,sig) kill( -(pgrp), sig) - #endif +diff -wpruN --no-dereference '--exclude=*.orig' a~/termcap.c a/termcap.c +--- a~/termcap.c 1970-01-01 00:00:00 ++++ a/termcap.c 1970-01-01 00:00:00 +@@ -32,6 +32,7 @@ + + #include + #include ++#include + + #include "screen.h" - #ifndef HAVE_GETCWD diff -wpruN --no-dereference '--exclude=*.orig' a~/utmp.c a/utmp.c --- a~/utmp.c 1970-01-01 00:00:00 +++ a/utmp.c 1970-01-01 00:00:00 -@@ -35,6 +35,8 @@ - #include "extern.h" +@@ -39,6 +39,8 @@ + #include "screen.h" #ifdef HAVE_UTEMPTER +#include diff --git a/build/screen/patches/grabconsole.patch b/build/screen/patches/grabconsole.patch new file mode 100644 index 0000000000..04b05260d8 --- /dev/null +++ b/build/screen/patches/grabconsole.patch @@ -0,0 +1,22 @@ +diff -wpruN --no-dereference '--exclude=*.orig' a~/tty.c a/tty.c +--- a~/tty.c 1970-01-01 00:00:00 ++++ a/tty.c 1970-01-01 00:00:00 +@@ -802,6 +802,7 @@ static void consredir_readev_fn(Event * + + int TtyGrabConsole(int fd, bool on, char *rc_name) + { ++#if defined(SRIOCSREDIR) || defined(TIOCCONS) + Display *d; + #ifdef SRIOCSREDIR + int cfd; +@@ -881,6 +882,10 @@ int TtyGrabConsole(int fd, bool on, char + consredir_ev.handler = consredir_readev_fn; + evenq(&consredir_ev); + return 0; ++#else ++ Msg(0, "Grabbing console not supported"); ++ return -1; ++#endif + } + + /* diff --git a/build/screen/patches/ncurses.patch b/build/screen/patches/ncurses.patch deleted file mode 100644 index 1e8dbea279..0000000000 --- a/build/screen/patches/ncurses.patch +++ /dev/null @@ -1,25 +0,0 @@ -This patch makes configure check for ncurses before curses so that screen -can take advantage of the latest terminal type information from our -ncurses package. - -diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac ---- a~/configure.ac 1970-01-01 00:00:00 -+++ a/configure.ac 1970-01-01 00:00:00 -@@ -669,7 +669,7 @@ AC_TRY_LINK([ - tgetent((char *)0, (char *)0); - ],, - olibs="$LIBS" --LIBS="-lcurses $olibs" -+LIBS="-lncurses $olibs" - AC_CHECKING(libcurses) - AC_TRY_LINK([ - #include -@@ -713,7 +713,7 @@ AC_TRY_LINK([ - ],[ - tgetent((char *)0, (char *)0); - ],, --LIBS="-lncurses $olibs" -+LIBS="-lcurses $olibs" - AC_CHECKING(libncurses) - AC_TRY_LINK([ - #include diff --git a/build/screen/patches/openpty.patch b/build/screen/patches/openpty.patch new file mode 100644 index 0000000000..33a589d84f --- /dev/null +++ b/build/screen/patches/openpty.patch @@ -0,0 +1,62 @@ +Pending https://www.illumos.org/issues/5386 + +diff -wpruN --no-dereference '--exclude=*.orig' a~/pty.c a/pty.c +--- a~/pty.c 1970-01-01 00:00:00 ++++ a/pty.c 1970-01-01 00:00:00 +@@ -46,6 +46,56 @@ + + int pty_preopen = 0; + ++#ifdef __illumos__ ++#include ++ ++static int ++openpty_failure(int c, int s, int e) ++{ ++ if (s >= 0) ++ (void) close(s); ++ if (c >= 0) ++ (void) close(c); ++ errno = e; ++ return (-1); ++} ++ ++static int ++openpty(int *controlp, int *subordp, char *name, const struct termios *termp, ++ const struct winsize *winp) ++{ ++ int c = -1; ++ int s = -1; ++ char *sname; ++ ++ if ((c = posix_openpt(O_RDWR | O_NOCTTY)) < 0) ++ return (-1); ++ if (grantpt(c) < 0 || unlockpt(c) < 0) ++ return (openpty_failure(c, s, errno)); ++ if ((sname = ptsname(c)) == NULL || ++ (s = open(sname, O_RDWR | O_NOCTTY)) < 0) { ++ return (openpty_failure(c, s, errno)); ++ } ++ ++ if (ioctl(s, __I_PUSH_NOCTTY, "ptem") < 0 || ++ ioctl(s, __I_PUSH_NOCTTY, "ldterm") < 0) { ++ return (openpty_failure(c, s, errno)); ++ } ++ ++ if (termp != NULL && tcsetattr(s, TCSAFLUSH, termp) != 0) ++ return (openpty_failure(c, s, errno)); ++ if (winp != NULL && ioctl(s, TIOCSWINSZ, winp) != 0) ++ return (openpty_failure(c, s, errno)); ++ ++ if (name != NULL) ++ strcpy(name, sname); ++ ++ *controlp = c; ++ *subordp = s; ++ return (0); ++} ++#endif ++ + /***************************************************************/ + + int OpenPTY(char **ttyn) diff --git a/build/screen/patches/series b/build/screen/patches/series index ca6f1d8ac2..d1ccf6e219 100644 --- a/build/screen/patches/series +++ b/build/screen/patches/series @@ -1,4 +1,5 @@ Makefile.in.patch -ncurses.patch -unneededlibs.patch +openpty.patch +grabconsole.patch +closefiles.patch gcc14.patch diff --git a/build/screen/patches/unneededlibs.patch b/build/screen/patches/unneededlibs.patch deleted file mode 100644 index e5dff40138..0000000000 --- a/build/screen/patches/unneededlibs.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -wpruN --no-dereference '--exclude=*.orig' a~/configure.ac a/configure.ac ---- a~/configure.ac 1970-01-01 00:00:00 -+++ a/configure.ac 1970-01-01 00:00:00 -@@ -189,7 +189,7 @@ AC_EGREP_CPP(yes, - ], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1) - if test -n "$svr4" ; then - oldlibs="$LIBS" --LIBS="$LIBS -lelf" -+LIBS="$LIBS" - AC_CHECKING(SVR4) - AC_TRY_LINK([ - #include -@@ -206,7 +206,7 @@ AC_EGREP_CPP(YES_IS_DEFINED, - [#if defined(SVR4) && defined(sun) - YES_IS_DEFINED; - #endif --], LIBS="$LIBS -lsocket -lnsl -lkstat") -+], LIBS="$LIBS -lsocket") - - dnl - dnl **** typedefs **** diff --git a/doc/packages.md b/doc/packages.md index 4efec1abb2..8e36e04f58 100644 --- a/doc/packages.md +++ b/doc/packages.md @@ -107,7 +107,7 @@ | system/test/epolltest | 20240808 | https://github.com/omniosorg/epoll-test-suite | system/test/fio | 3.37 | https://github.com/axboe/fio/tags | system/watch | 3.3.16 | https://gitlab.com/api/v4/projects/procps-ng%2Fprocps/releases https://gitlab.com/procps-ng/procps/-/releases -| terminal/screen | 4.9.1 | https://ftp.gnu.org/gnu/screen/ +| terminal/screen | 5.0.0 | https://ftp.gnu.org/gnu/screen/ | terminal/tmux | 3.4 | https://github.com/tmux/tmux/releases http://tmux.github.io/ | text/gawk | 5.3.0 | https://ftp.gnu.org/gnu/gawk/ | text/gnu-diffutils | 3.10 | http://git.savannah.gnu.org/cgit/diffutils.git/refs/tags