diff --git a/sysutils/screen/Portfile b/sysutils/screen/Portfile index dbe0f9acbcf5f..1e38d45ea3b2c 100644 --- a/sysutils/screen/Portfile +++ b/sysutils/screen/Portfile @@ -3,7 +3,7 @@ PortSystem 1.0 name screen -version 4.9.1 +version 5.0.0 revision 0 homepage https://www.gnu.org/software/screen/ description Screen manager with VT100/ANSI terminal emulation @@ -29,9 +29,9 @@ master_sites gnu:${name} \ distfiles-append 18:encoding checksums ${distname}${extract.suffix} \ - rmd160 dd3f460992e823783b55d7fc7fd949a349fc4611 \ - sha256 26cef3e3c42571c0d484ad6faf110c5c15091fbf872b06fa7aa4766c7405ac69 \ - size 1040785 \ + rmd160 d945137f67f56ff97e7fb7e46c29c25661df05cc \ + sha256 f04a39d00a0e5c7c86a55338808903082ad5df4d73df1a2fd3425976aed94971 \ + size 895882 \ 18 \ rmd160 bd143058417e1d4c040a2589fdfbf8f9203f0b4c \ sha256 4d4b674a61dab6bac9b4207307c5f020fa670fc3948c39e7ea93c7fb9dfb5174 \ @@ -43,8 +43,7 @@ checksums ${distname}${extract.suffix} \ patchfiles patch-apple-screen.diff \ patch-apple-window.diff \ - patch-acconfig.h.diff \ - patch-xcode-12-implicit-function-fixes.diff + patch-tic.diff depends_lib port:ncurses extract.only ${distname}${extract.suffix} @@ -52,21 +51,16 @@ post-extract { file copy ${distpath}/18 ${workpath} } -use_autoreconf yes -autoreconf.args -i - configure.args --mandir=${prefix}/share/man \ --infodir=${prefix}/share/info \ - --enable-telnet \ - --enable-colors256 \ - --enable-rxvt_osc + --disable-utmp \ + --enable-telnet configure.cflags-append -DRUN_LOGIN post-destroot { xinstall -m 644 ${workpath}/18 ${destroot}${prefix}/share/${name}/utf8encodings xinstall -m 644 ${worksrcpath}/etc/etcscreenrc ${destroot}${prefix}/etc/screenrc xinstall -m 644 ${worksrcpath}/terminfo/screencap ${destroot}${prefix}/etc/termcap - system "tic ${worksrcpath}/terminfo/screeninfo.src" } platform darwin { diff --git a/sysutils/screen/files/patch-acconfig.h.diff b/sysutils/screen/files/patch-acconfig.h.diff deleted file mode 100644 index 653b0261f0e9e..0000000000000 --- a/sysutils/screen/files/patch-acconfig.h.diff +++ /dev/null @@ -1,35 +0,0 @@ -MacOS X uses utmpx. Apple's patchset (patch-apple.diff) adds code -that calls /usr/bin/login to handle utmpx editing. Thus, we have no -need to use screen's utmp editing code. This patch disables -screen's utmp editing. - -This also fixes the "/var/run/utmp: No such file or directory" -errors as a consequence of the above. ---- acconfig.h 2021-05-08 19:39:20.099088823 -0400 -+++ acconfig.h 2021-05-08 20:11:16.299603971 -0400 -@@ -191,14 +191,14 @@ - * If screen is installed with permissions to update /etc/utmp (such - * as if it is installed set-uid root), define UTMPOK. - */ --#define UTMPOK -+#undef UTMPOK - - /* Set LOGINDEFAULT to one (1) - * if you want entries added to /etc/utmp by default, else set it to - * zero (0). - * LOGINDEFAULT will be one (1) whenever LOGOUTOK is undefined! - */ --#define LOGINDEFAULT 1 -+#undef LOGINDEFAULT - - /* Set LOGOUTOK to one (1) - * if you want the user to be able to log her/his windows out. -@@ -214,7 +214,7 @@ - * Set CAREFULUTMP to one (1) if you want that users have at least one - * window per screen session logged in. - */ --#define LOGOUTOK 1 -+#undef LOGOUTOK - #undef CAREFULUTMP - - diff --git a/sysutils/screen/files/patch-apple-screen.diff b/sysutils/screen/files/patch-apple-screen.diff index 4bf1366fd7afb..95e3075e3c4f7 100644 --- a/sysutils/screen/files/patch-apple-screen.diff +++ b/sysutils/screen/files/patch-apple-screen.diff @@ -15,50 +15,62 @@ for MacPorts. This patch is maintained separately from the window.c changes since vproc.h and _CS_DARWIN_USER_TEMP_DIR require macOS 10.5 or later. ---- screen.c 2021-05-08 19:39:20.092413588 -0400 -+++ screen.c 2021-05-08 19:48:03.152597182 -0400 -@@ -118,6 +118,15 @@ - - #include "logfile.h" /* islogfile, logfflush, logfopen/logfclose */ - +--- screen.c 2024-08-28 15:55:03.000000000 -0400 ++++ screen.c 2024-08-31 09:03:10.596073100 -0400 +@@ -57,10 +57,19 @@ + #include "list_generic.h" + #include "mark.h" + #include "utmp.h" + #include "winmsg.h" + +#ifdef __APPLE__ ++#include +#include +#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) +#include -+#include -+#include ++#include "vproc_priv.h" +#endif +#endif + - #ifdef DEBUG - FILE *dfp; - #endif -@@ -1206,6 +1215,16 @@ - Attacher(); - /* NOTREACHED */ - } + extern char **environ; + + int force_vt = 1; + int VBellWait; + int MsgWait; +@@ -906,11 +915,20 @@ + exit(0); + } else if (rflag || xflag) { + if (Attach(MSG_ATTACH)) { + Attacher(); + /* NOTREACHED */ +#ifdef __APPLE__ -+ else if (!multi && real_uid == eff_uid) { -+ static char DarwinSockDir[PATH_MAX]; -+ if (confstr(_CS_DARWIN_USER_TEMP_DIR, DarwinSockDir, sizeof(DarwinSockDir))) { -+ strlcat(DarwinSockDir, ".screen", sizeof(DarwinSockDir)); -+ SockDir = DarwinSockDir; -+ } -+ } -+#endif /* __APPLE__ */ ++ } else if (!multi && real_uid == eff_uid) { ++ static char DarwinSockDir[PATH_MAX]; ++ if (confstr(_CS_DARWIN_USER_TEMP_DIR, DarwinSockDir, sizeof(DarwinSockDir))) { ++ strlcat(DarwinSockDir, ".screen", sizeof(DarwinSockDir)); ++ SocketDir = DarwinSockDir; ++ } + } ++#endif /* __APPLE__ */ + - #ifdef MULTIUSER - if (multiattach) - Panic(0, "Can't create sessions of other users."); -@@ -1314,6 +1333,11 @@ - freopen("/dev/null", "w", stderr); - debug("-- screen.back debug started\n"); - + if (multiattach) + Panic(0, "Can't create sessions of other users."); + } else if (dflag && !mflag) { + SetTtyname(false, &st); + Attach(MSG_DETACH); +@@ -984,10 +1002,15 @@ + } else + n = dup(attach_fd); + } else + n = -1; + +#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR) + if (_vprocmgr_detach_from_console(0) != NULL) + errx(1, "can't detach from console"); +#endif + - /* This guarantees that the session owner is listed, even when we - * start detached. From now on we should not refer to 'LoginName' - * any more, use users->u_name instead. + /* + * This guarantees that the session owner is listed, even when we + * start detached. From now on we should not refer to 'LoginName' + * any more, use users->u_name instead. + */ diff --git a/sysutils/screen/files/patch-apple-window.diff b/sysutils/screen/files/patch-apple-window.diff index 3d9d9fb0bbb80..3b68e13a0a20c 100644 --- a/sysutils/screen/files/patch-apple-window.diff +++ b/sysutils/screen/files/patch-apple-window.diff @@ -11,22 +11,28 @@ This patch was then rebased against the latest upstream GNU Screen, which was version 4.6.2 and no longer required many of Apple's changes. This was done by David Gilman for MacPorts. ---- window.c 2021-05-08 19:39:20.102441294 -0400 -+++ window.c 2021-05-08 19:40:40.447225064 -0400 -@@ -33,6 +33,9 @@ +--- window.c 2024-08-28 15:55:03.000000000 -0400 ++++ window.c 2024-08-31 09:20:45.386555415 -0400 +@@ -37,10 +37,13 @@ #include #include + #include + #include #include +#ifdef __APPLE__ +#include -+#endif __APPLE__ - #ifndef sun - # include - #endif -@@ -1682,6 +1685,40 @@ - return r; ++#endif /* __APPLE__ */ + #include + #include + + #include "fileio.h" + #include "help.h" +@@ -1182,10 +1185,44 @@ + if (slave != -1) + close(slave); + return pid; } - + +#ifdef __APPLE__ +#ifdef RUN_LOGIN +/* @@ -38,21 +44,21 @@ for MacPorts. +static int +run_login(const char *path, char *const argv[], char *const envp[]) +{ -+ const char *shargs[MAXARGS + 1 + 3]; -+ const char **fp, **tp; ++ const char *shargs[MAXARGS + 1 + 3]; ++ const char **fp, **tp; + -+ if (access(path, X_OK) < 0) -+ return -1; -+ shargs[0] = "login"; -+ shargs[1] = (*argv[0] == '-') ? "-pfq" : "-pflq"; -+ shargs[2] = LoginName; -+ shargs[3] = path; -+ fp = (const char **)argv + 1; -+ tp = shargs + 4; -+ /* argv has already been check for length */ -+ while ((*tp++ = *fp++) != NULL) {} -+ /* shouldn't return unless there was an error */ -+ return (execve("/usr/bin/login", (char *const*)shargs, envp)); ++ if (access(path, X_OK) < 0) ++ return -1; ++ shargs[0] = "login"; ++ shargs[1] = (*argv[0] == '-') ? "-pfq" : "-pflq"; ++ shargs[2] = LoginName; ++ shargs[3] = path; ++ fp = (const char **)argv + 1; ++ tp = shargs + 4; ++ /* argv has already been check for length */ ++ while ((*tp++ = *fp++) != NULL) {} ++ /* shouldn't return unless there was an error */ ++ return (execve("/usr/bin/login", (char *const*)shargs, envp)); +} + +/* replace the following occurrences of execve() with run_login() */ @@ -61,6 +67,8 @@ for MacPorts. +#endif /* RUN_LOGIN */ +#endif /* __APPLE__ */ + - void - FreePseudowin(w) - struct win *w; + #ifndef HAVE_EXECVPE + void execvpe(char *prog, char **args, char **env) + { + char *path = NULL; + char buf[1024]; diff --git a/sysutils/screen/files/patch-tic.diff b/sysutils/screen/files/patch-tic.diff new file mode 100644 index 0000000000000..475c1e6f3b374 --- /dev/null +++ b/sysutils/screen/files/patch-tic.diff @@ -0,0 +1,30 @@ +Historically, MacPorts has (probably by mistake, or coincidence) shipped +all of screen's compiled termcaps in the ncurses package. This doesn't seem +to have broken anything because this is all obscure, obsolete crap anyway +and screen also defines TERM/TERMCAP environment variables in its screens. + +Unless this needs to change, remove the call to tic in the Makefile install +target. If you need the files from screen, you need to call it as + +tic -o${destroot}${prefix}/share/terminfo ${worksrcpath}/terminfo/screeninfo.src + +as tic will otherwise write to /opt/local on the machine that *builds* screen and +none of the files will make it into the MacPorts package! + +--- Makefile.in 2024-08-28 15:55:03.000000000 -0400 ++++ Makefile.in 2024-08-31 14:01:14.106657320 -0400 +@@ -88,14 +88,10 @@ + cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS) + + ############################################################################### + install: installdirs install_bin + cd doc ; $(MAKE) install +- -if [ -d $(DESTDIR)/usr/lib/terminfo ]; then \ +- PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \ +- chmod 644 $(DESTDIR)/usr/lib/terminfo/s/screen*; \ +- fi + # Better do this by hand. E.g. under RCS... + # cat ${srcdir}/terminfo/screencap >> /etc/termcap + @echo "termcap entry (${srcdir}/terminfo/screencap) should be installed manually." + @echo "You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC) + diff --git a/sysutils/screen/files/patch-xcode-12-implicit-function-fixes.diff b/sysutils/screen/files/patch-xcode-12-implicit-function-fixes.diff deleted file mode 100644 index 3208162c01fdc..0000000000000 --- a/sysutils/screen/files/patch-xcode-12-implicit-function-fixes.diff +++ /dev/null @@ -1,36 +0,0 @@ ---- pty.c.orig -+++ pty.c -@@ -30,6 +30,9 @@ - #include - #include - #include -+#ifdef __APPLE__ -+#include -+#endif - - #include "config.h" - #include "screen.h" ---- screen.c.orig -+++ screen.c -@@ -47,6 +47,9 @@ - #include - #include - #include -+#ifdef __APPLE__ -+#include -+#endif - - #if defined(__sun) - # include ---- socket.c.orig -+++ socket.c -@@ -1419,7 +1419,9 @@ - char *p; - int pid; - int noshowwin; -+#ifdef UTMPOK - struct win *wi; -+#endif - - ASSERT(display); - pid = D_userpid;