Skip to content

Commit

Permalink
screen: update to 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilman committed Sep 2, 2024
1 parent 0bf6cff commit 21a7544
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 144 deletions.
20 changes: 7 additions & 13 deletions sysutils/screen/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -43,30 +43,24 @@ 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}
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 {
Expand Down
35 changes: 0 additions & 35 deletions sysutils/screen/files/patch-acconfig.h.diff

This file was deleted.

78 changes: 45 additions & 33 deletions sysutils/screen/files/patch-apple-screen.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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 <err.h>
+#include <TargetConditionals.h>
+#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
+#include <vproc.h>
+#include <vproc_priv.h>
+#include <err.h>
+#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.
*/
62 changes: 35 additions & 27 deletions sysutils/screen/files/patch-apple-window.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/stat.h>
#include <signal.h>
#include <stdint.h>
#include <stdbool.h>
#include <fcntl.h>
+#ifdef __APPLE__
+#include <unistd.h>
+#endif __APPLE__
#ifndef sun
# include <sys/ioctl.h>
#endif
@@ -1682,6 +1685,40 @@
return r;
+#endif /* __APPLE__ */
#include <sys/ioctl.h>
#include <sys/wait.h>

#include "fileio.h"
#include "help.h"
@@ -1182,10 +1185,44 @@
if (slave != -1)
close(slave);
return pid;
}

+#ifdef __APPLE__
+#ifdef RUN_LOGIN
+/*
Expand All @@ -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() */
Expand All @@ -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];
30 changes: 30 additions & 0 deletions sysutils/screen/files/patch-tic.diff
Original file line number Diff line number Diff line change
@@ -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)

36 changes: 0 additions & 36 deletions sysutils/screen/files/patch-xcode-12-implicit-function-fixes.diff

This file was deleted.

0 comments on commit 21a7544

Please sign in to comment.