Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen - update from 4.9.1 to 5.0.0 #3685

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion build/screen/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion build/screen/patches/Makefile.in.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)
49 changes: 49 additions & 0 deletions build/screen/patches/closefiles.patch
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
#include <string.h>
#include <stdbool.h>
+#ifdef __sun
+#include <stdlib.h> /* 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
*/
63 changes: 12 additions & 51 deletions build/screen/patches/gcc14.patch
Original file line number Diff line number Diff line change
@@ -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 <stdlib.h>
+ #include <sys/loadavg.h>
],[
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 <sys/types.h>
#include <stdint.h>
+#include <strings.h>

#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 <sys/types.h>
Expand Down
22 changes: 22 additions & 0 deletions build/screen/patches/grabconsole.patch
Original file line number Diff line number Diff line change
@@ -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
}

/*
25 changes: 0 additions & 25 deletions build/screen/patches/ncurses.patch

This file was deleted.

62 changes: 62 additions & 0 deletions build/screen/patches/openpty.patch
Original file line number Diff line number Diff line change
@@ -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 <sys/stropts.h>
+
+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)
5 changes: 3 additions & 2 deletions build/screen/patches/series
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Makefile.in.patch
ncurses.patch
unneededlibs.patch
openpty.patch
grabconsole.patch
closefiles.patch
gcc14.patch
21 changes: 0 additions & 21 deletions build/screen/patches/unneededlibs.patch

This file was deleted.

2 changes: 1 addition & 1 deletion doc/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading