pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/misc/screen4
Module Name: pkgsrc
Committed By: ryoon
Date: Fri Feb 7 03:15:06 UTC 2025
Added Files:
pkgsrc/misc/screen4: DESCR MESSAGE Makefile PLIST distinfo options.mk
pkgsrc/misc/screen4/patches: patch-aa patch-ab patch-ae patch-ai
patch-aj patch-al patch-am patch-an patch-ao patch-ap
patch-doc_screen.texinfo patch-screen.c patch-socket.c patch-tty.sh
patch-window.h
Log Message:
misc/screen4: import screen-4.9.1
Screen is a full-screen window manager that multiplexes a physical terminal
between several processes (typically interactive shells).
Each virtual terminal provides the functions of a DEC VT100 terminal and, in
addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO
2022 standards (e.g. insert/delete line and support for multiple character
sets). There is a scrollback history buffer for each virtual terminal and a
copy-and-paste mechanism that allows moving text regions between windows.
misc/screen-5.0.0 does not work under xterm. Reversed strings are
not displayed properly at least. Import working GNU screen 4 as
misc/screen4. And screen-5.0.0 does not have codes for older platforms.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/misc/screen4/DESCR pkgsrc/misc/screen4/MESSAGE \
pkgsrc/misc/screen4/Makefile pkgsrc/misc/screen4/PLIST \
pkgsrc/misc/screen4/distinfo pkgsrc/misc/screen4/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/misc/screen4/patches/patch-aa \
pkgsrc/misc/screen4/patches/patch-ab pkgsrc/misc/screen4/patches/patch-ae \
pkgsrc/misc/screen4/patches/patch-ai pkgsrc/misc/screen4/patches/patch-aj \
pkgsrc/misc/screen4/patches/patch-al pkgsrc/misc/screen4/patches/patch-am \
pkgsrc/misc/screen4/patches/patch-an pkgsrc/misc/screen4/patches/patch-ao \
pkgsrc/misc/screen4/patches/patch-ap \
pkgsrc/misc/screen4/patches/patch-doc_screen.texinfo \
pkgsrc/misc/screen4/patches/patch-screen.c \
pkgsrc/misc/screen4/patches/patch-socket.c \
pkgsrc/misc/screen4/patches/patch-tty.sh \
pkgsrc/misc/screen4/patches/patch-window.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/misc/screen4/DESCR
diff -u /dev/null pkgsrc/misc/screen4/DESCR:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/DESCR Fri Feb 7 03:15:05 2025
@@ -0,0 +1,7 @@
+Screen is a full-screen window manager that multiplexes a physical terminal
+between several processes (typically interactive shells).
+Each virtual terminal provides the functions of a DEC VT100 terminal and, in
+addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO
+2022 standards (e.g. insert/delete line and support for multiple character
+sets). There is a scrollback history buffer for each virtual terminal and a
+copy-and-paste mechanism that allows moving text regions between windows.
Index: pkgsrc/misc/screen4/MESSAGE
diff -u /dev/null pkgsrc/misc/screen4/MESSAGE:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/MESSAGE Fri Feb 7 03:15:05 2025
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2025/02/07 03:15:05 ryoon Exp $
+
+You may want to create and edit the file:
+
+ ${PKG_SYSCONFDIR}/screenrc
+
+to customize screen globally. Example configuration files have been
+installed to:
+
+ ${PREFIX}/share/examples/screen/screenrc
+ ${PREFIX}/share/examples/screen/etcscreenrc
+
+===========================================================================
Index: pkgsrc/misc/screen4/Makefile
diff -u /dev/null pkgsrc/misc/screen4/Makefile:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/Makefile Fri Feb 7 03:15:05 2025
@@ -0,0 +1,85 @@
+# $NetBSD: Makefile,v 1.1 2025/02/07 03:15:05 ryoon Exp $
+
+DISTNAME= screen-4.9.1
+CATEGORIES= misc shells
+MASTER_SITES= ${MASTER_SITE_GNU:=screen/}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.gnu.org/software/screen/screen.html
+COMMENT= Multi-screen window manager
+LICENSE= gnu-gpl-v3
+
+EXTRACT_USING= bsdtar
+
+# In file included from list_display.c:36:
+# In file included from ./screen.h:150:
+# ./display.h:154:19: error: use of undeclared identifier 'T_N'
+#MAKE_JOBS_SAFE= no
+
+.include "options.mk"
+
+NOT_FOR_PLATFORM= Interix-*-* # user auth and username size fixes needed
+
+PLIST_SUBST+= DISTNAME=${DISTNAME:Q}
+
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --with-sys-screenrc=${PKG_SYSCONFDIR}/screenrc
+CONFIGURE_ARGS+= --enable-telnet
+CONFIGURE_ARGS+= --enable-colors256
+
+PKG_SHELL= bin/screen
+
+USE_TOOLS+= automake autoconf autoreconf makeinfo
+INFO_FILES= YES
+
+.include "../../mk/bsd.prefs.mk"
+
+SUBST_CLASSES+= paths
+SUBST_FILES.paths= etc/etcscreenrc doc/screen.1
+SUBST_VARS.paths= PKG_SYSCONFDIR
+SUBST_SED.paths+= -e 's,@EXAMPLES@,${PREFIX}/share/examples/screen,g'
+SUBST_STAGE.paths= pre-configure
+
+PLIST_VARS+= terminfo
+
+.include "../../mk/compiler.mk"
+
+.if ${OPSYS} == "SunOS"
+. if !empty(PKGSRC_COMPILER:Mclang) || ${CC_VERSION:Mgcc-[6-9]*} || ${CC_VERSION:Mgcc-1[0-9].*}
+CPPFLAGS+= -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
+. else
+CPPFLAGS+= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
+. endif
+. if ${CURSES_DEFAULT} == "curses"
+INSTALLATION_DIRS+= share/lib/terminfo
+PLIST.terminfo= yes
+post-install: screen-terminfo
+. endif
+.endif
+
+INSTALLATION_DIRS+= share/examples/screen
+
+.if ${UNPRIVILEGED:U:tl} != yes
+SPECIAL_PERMS+= bin/${DISTNAME} ${SETUID_ROOT_PERMS}
+.endif
+
+pre-configure:
+ cd ${WRKSRC} && autoreconf -i
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
+ ${DESTDIR}${PREFIX}/share/examples/screen/etcscreenrc
+ ${INSTALL_DATA} ${WRKSRC}/etc/screenrc \
+ ${DESTDIR}${PREFIX}/share/examples/screen/screenrc
+.if ${UNPRIVILEGED:U:tl} == yes
+ chmod -s ${DESTDIR}${PREFIX}/bin/${DISTNAME}
+.endif
+
+.PHONY: screen-terminfo
+screen-terminfo:
+ cd ${WRKSRC}/terminfo && \
+ ${SETENV} TERMINFO=${DESTDIR}${PREFIX}/share/lib/terminfo \
+ /usr/bin/tic screeninfo.src
+
+.include "../../mk/termcap.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/misc/screen4/PLIST
diff -u /dev/null pkgsrc/misc/screen4/PLIST:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/PLIST Fri Feb 7 03:15:05 2025
@@ -0,0 +1,28 @@
+@comment $NetBSD: PLIST,v 1.1 2025/02/07 03:15:05 ryoon Exp $
+bin/screen
+bin/${DISTNAME}
+info/screen.info
+man/man1/screen.1
+share/examples/screen/etcscreenrc
+share/examples/screen/screenrc
+${PLIST.terminfo}share/lib/terminfo/s/screen
+${PLIST.terminfo}share/lib/terminfo/s/screen-256color
+${PLIST.terminfo}share/lib/terminfo/s/screen-bce
+${PLIST.terminfo}share/lib/terminfo/s/screen-s
+share/screen/utf8encodings/01
+share/screen/utf8encodings/02
+share/screen/utf8encodings/03
+share/screen/utf8encodings/04
+share/screen/utf8encodings/18
+share/screen/utf8encodings/19
+share/screen/utf8encodings/a1
+share/screen/utf8encodings/bf
+share/screen/utf8encodings/c2
+share/screen/utf8encodings/c3
+share/screen/utf8encodings/c4
+share/screen/utf8encodings/c6
+share/screen/utf8encodings/c7
+share/screen/utf8encodings/c8
+share/screen/utf8encodings/cc
+share/screen/utf8encodings/cd
+share/screen/utf8encodings/d6
Index: pkgsrc/misc/screen4/distinfo
diff -u /dev/null pkgsrc/misc/screen4/distinfo:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/distinfo Fri Feb 7 03:15:05 2025
@@ -0,0 +1,20 @@
+$NetBSD: distinfo,v 1.1 2025/02/07 03:15:05 ryoon Exp $
+
+BLAKE2s (screen-4.9.1.tar.gz) = 5632587a76908410b4b1af70c729e01521970c72693fa78ec9b62d907fefbc8c
+SHA512 (screen-4.9.1.tar.gz) = 1f278313528815f4246bb162ced611c5d77321d11055e8d853168dc804c75d5f78568056a23e46db0640e1605e5cad4a5ce05e95e50cf02bb322cb6f57e5a126
+Size (screen-4.9.1.tar.gz) = 1040785 bytes
+SHA1 (patch-aa) = ea0c43e54d8764e4896f45677eb0a6070bd7b54b
+SHA1 (patch-ab) = 36474dfd780c0d0188eda998fb2d936fa4893b9c
+SHA1 (patch-ae) = c952a7e52df0f33c2853c348e89650009c0d8696
+SHA1 (patch-ai) = edefc44e47066dc89bda22a94d417511f46f0190
+SHA1 (patch-aj) = 1260f55afb98536d0da081fbd95fafa9b5b513f7
+SHA1 (patch-al) = ef32a642ddb12f0bf13149c406f4dde7926ae678
+SHA1 (patch-am) = a721e311e7dde7938de0e9546a7892bfd104ebd1
+SHA1 (patch-an) = bda6c65148410a6c9a13afd8ad34f93e33731552
+SHA1 (patch-ao) = a45ae3186cd9bddeb915bad890f1be5abc315dd3
+SHA1 (patch-ap) = 4aab542045a0abe55e82d91851b94c3cb569139f
+SHA1 (patch-doc_screen.texinfo) = 18d959580fd03731c7e7dbc683970f80b4245840
+SHA1 (patch-screen.c) = de5d8468100ab88cbdb842e21b04b00221e798b8
+SHA1 (patch-socket.c) = 290a6a1113a9100bea0748406374ec3d835f5ba7
+SHA1 (patch-tty.sh) = 6a818b7a4d70e55878ee69605e53300eabcb525f
+SHA1 (patch-window.h) = 84dc5a2c24ff77147b416c05f897536c0cfddf31
Index: pkgsrc/misc/screen4/options.mk
diff -u /dev/null pkgsrc/misc/screen4/options.mk:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/options.mk Fri Feb 7 03:15:05 2025
@@ -0,0 +1,29 @@
+# $NetBSD: options.mk,v 1.1 2025/02/07 03:15:05 ryoon Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.screen
+
+PKG_OPTIONS_OPTIONAL_GROUPS= curses
+PKG_OPTIONS_GROUP.curses= curses ncurses pdcurses
+
+PKG_SUPPORTED_OPTIONS= # undef
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Override the default curses implementation
+###
+.if !empty(PKG_OPTIONS:Mcurses)
+CURSES_DEFAULT= curses
+.endif
+
+.if !empty(PKG_OPTIONS:Mncurses)
+CURSES_DEFAULT= ncurses
+CONFIGURE_ARGS+= --enable-colors256
+.endif
+
+.if !empty(PKG_OPTIONS:Mpdcurses)
+CURSES_DEFAULT= pdcurses
+CONFIGURE_ARGS+= --enable-colors256
+.endif
+
+.include "../../mk/curses.buildlink3.mk"
Index: pkgsrc/misc/screen4/patches/patch-aa
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-aa:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-aa Fri Feb 7 03:15:06 2025
@@ -0,0 +1,52 @@
+$NetBSD: patch-aa,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Portability fixes for NetBSD pty(4).
+
+--- pty.c.orig 2014-04-26 10:58:35.000000000 +0000
++++ pty.c
+@@ -318,6 +318,45 @@ char **ttyn;
+
+ /***************************************************************/
+
++#if defined(__NetBSD__) && !defined(PTY_DONE)
++#define PTY_DONE
++
++#include <sys/param.h>
++#include <string.h>
++
++int
++OpenPTY(ttyn)
++char **ttyn;
++{
++ int m, s, f;
++ char *t;
++
++ do
++ {
++ if (openpty(&m, &s, TtyName, NULL, NULL) < 0)
++ return -1;
++ close(m);
++ close(s);
++
++ strcpy(PtyName, TtyName);
++ t = strrchr(PtyName, '/');
++ if ((t == NULL ) || (*++t != 't'))
++ return -1;
++ *t = 'p';
++
++ f = open(PtyName, O_RDWR | O_NOCTTY);
++ }
++ while (f < 0);
++
++ initmaster(f);
++ *ttyn = TtyName;
++
++ return f;
++}
++#endif
++
++/***************************************************************/
++
+ #if defined(HAVE_OPENPTY) && !defined(PTY_DONE)
+ #define PTY_DONE
+ int
Index: pkgsrc/misc/screen4/patches/patch-ab
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-ab:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-ab Fri Feb 7 03:15:06 2025
@@ -0,0 +1,22 @@
+$NetBSD: patch-ab,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Always use varargs on NetBSD
+
+--- acconfig.h.orig 2014-04-26 10:58:46.000000000 +0000
++++ acconfig.h
+@@ -498,6 +498,15 @@
+ */
+ #undef USEVARARGS
+
++#ifdef __NetBSD__
++/*
++ * XXX gcc 3.3 on some NetBSD platforms fails the configure test for this
++ * so force it on anyway.
++ */
++#undef USEVARARGS
++#define USEVARARGS 1
++#endif
++
+ /*
+ * If the select return value doesn't treat a descriptor that is
+ * usable for reading and writing as two hits, define SELECT_BROKEN.
Index: pkgsrc/misc/screen4/patches/patch-ae
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-ae:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-ae Fri Feb 7 03:15:06 2025
@@ -0,0 +1,18 @@
+$NetBSD: patch-ae,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Don't pollute G1 to allow 8-bit encondings.
+
+The original code made the TERMCAP env var longer than 1023 bytes,
+which causes problems. This is a quick hack but works with our termcap.
+
+--- termcap.c.orig 2020-02-05 20:09:38.000000000 +0000
++++ termcap.c
+@@ -78,7 +78,7 @@ char *extra_incap, *extra_outcap;
+ static const char TermcapConst[] = "DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:\
+ UP=\\E[%dA:bs:bt=\\E[Z:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:\
+ ct=\\E[3g:do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\
+-le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:";
++le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E(B:";
+
+ char *
+ gettermcapstring(s)
Index: pkgsrc/misc/screen4/patches/patch-ai
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-ai:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-ai Fri Feb 7 03:15:06 2025
@@ -0,0 +1,43 @@
+$NetBSD: patch-ai,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+This glues in the code from patch-am (see also patch-al and patch-an).
+
+--- os.h.orig 2016-06-19 19:41:03.000000000 +0000
++++ os.h
+@@ -71,9 +71,6 @@
+ # undef exit
+ #endif /* sun */
+
+-#ifndef linux /* all done in <errno.h> */
+-extern int errno;
+-#endif /* linux */
+ #ifndef HAVE_STRERROR
+ /* No macros, please */
+ #undef strerror
+@@ -250,9 +247,15 @@ extern int errno;
+ #endif
+
+ #if defined(UTMPOK) || defined(BUGGYGETLOGIN)
+-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
++# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) \
++ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \
++ || (defined(__DragonFly__) && (__DragonFly_version >= 200902))
+ # include <utmpx.h>
++#if defined(UTMPX_FILE) /* GNU extension */
+ # define UTMPFILE UTMPX_FILE
++#elif defined(_PATH_UTMPX)
++# define UTMPFILE _PATH_UTMPX
++#endif
+ # define utmp utmpx
+ # define getutent getutxent
+ # define getutid getutxid
+@@ -261,6 +264,9 @@ extern int errno;
+ # define setutent setutxent
+ # define endutent endutxent
+ # define ut_time ut_xtime
++# if defined(__NetBSD__)
++# define NetBSD_UTMP
++# endif
+ # else /* SVR4 */
+ # include <utmp.h>
+ # endif /* SVR4 */
Index: pkgsrc/misc/screen4/patches/patch-aj
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-aj:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-aj Fri Feb 7 03:15:06 2025
@@ -0,0 +1,27 @@
+$NetBSD: patch-aj,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Include curses header when testing tgetent in order to prevent
+crash on 64-bit architectures.
+
+Detect getutent correctly on NetBSD with utmpx.
+
+--- configure.ac.orig 2023-08-16 00:29:26.000000000 +0000
++++ configure.ac
+@@ -904,9 +904,16 @@ AC_CHECKING(getutent)
+ AC_TRY_LINK([
+ #include <time.h> /* to get time_t on SCO */
+ #include <sys/types.h>
+-#if defined(SVR4) && !defined(DGUX)
++ #include <sys/param.h>
++#if (defined(SVR4) && !defined(DGUX)) \
++ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \
++ || (defined(__DragonFly__) && (__DragonFly_version >= 200902))
+ #include <utmpx.h>
+ #define utmp utmpx
++# if defined(__NetBSD__) || defined(__DragonFly__)
++# define pututline pututxline
++# define getutent getutxent
++# endif
+ #else
+ #include <utmp.h>
+ #endif
Index: pkgsrc/misc/screen4/patches/patch-al
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-al:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-al Fri Feb 7 03:15:06 2025
@@ -0,0 +1,95 @@
+$NetBSD: patch-al,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Make extra calls to remove utmp entries when utmpx is used.
+For non-login entries we only update utmpx, as it stores
+more information, and utilities are reading both.
+
+Do not truncate hostnames that have two colons (:) as they
+are likely IPv6 addresses. Wrap them in brackets ([])
+unless already wrapped (e.g. from $DISPLAY).
+
+--- utmp.c.orig 2023-08-16 00:29:26.000000000 +0000
++++ utmp.c
+@@ -48,6 +48,12 @@ extern char *LoginName;
+ extern int real_uid, eff_uid;
+
+
++#ifdef NetBSD_UTMP
++extern void utmp_login __P((char *));
++extern void utmp_logout __P((char *));
++#endif
++
++
+ /*
+ * UTNOKEEP: A (ugly) hack for apollo that does two things:
+ * 1) Always close and reopen the utmp file descriptor. (I don't know
+@@ -315,6 +321,9 @@ RemoveLoginSlot()
+
+ ASSERT(display);
+ debug("RemoveLoginSlot: removing your logintty\n");
++#ifdef NetBSD_UTMP
++ utmp_logout(stripdev(D_usertty));
++#endif
+ D_loginslot = TtyNameSlot(D_usertty);
+ if (D_loginslot == (slot_t)0 || D_loginslot == (slot_t)-1)
+ return;
+@@ -379,6 +388,9 @@ RestoreLoginSlot()
+
+ debug("RestoreLoginSlot()\n");
+ ASSERT(display);
++#ifdef NetBSD_UTMP
++ utmp_login(stripdev(D_usertty));
++#endif
+ if (utmpok && D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1)
+ {
+ debug1(" logging you in again (slot %#lx)\n", (long)D_loginslot);
+@@ -410,7 +422,7 @@ struct win *wi;
+ struct utmp u;
+ int saved_ut;
+ #ifdef UTHOST
+- char *p;
++ char *m, *p;
+ char host[sizeof(D_loginhost) + 15];
+ #else
+ char *host = 0;
+@@ -449,12 +461,37 @@ struct win *wi;
+ * "faui45.informati"......:s.0
+ * HPUX uses host:0.0, so chop at "." and ":" (Eric Backus)
+ */
+- for (p = host; *p; p++)
+- if ((*p < '0' || *p > '9') && (*p != '.'))
++ for (m = p = host; *p; p++)
++ if (*p == ':')
+ break;
++ if (*p == ':')
++ for (m = p + 1; *m; m++)
++ if (*m == ':')
++ {
++ if (host[0] != '[')
++ {
++ strncpy(host + 1, D_loginhost, sizeof(host) - 15 - 2);
++ host[0] = '[';
++ p = host + strlen(host);
++ *p++ = ']';
++ }
++ break;
++ }
++ else
++ for (p = host; *p; p++)
++ if ((*p < '0' || *p > '9') && (*p != '.'))
++ break;
+ if (*p)
+ {
+- for (p = host; *p; p++)
++ p = host;
++ if (host[0] == '[')
++ for (; *p; p++)
++ if (*p == ']')
++ {
++ p++;
++ break;
++ }
++ for (; *p; p++)
+ if (*p == '.' || (*p == ':' && p != host))
+ {
+ *p = '\0';
Index: pkgsrc/misc/screen4/patches/patch-am
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-am:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-am Fri Feb 7 03:15:06 2025
@@ -0,0 +1,88 @@
+$NetBSD: patch-am,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Code to handle the login slot in utmp when utmpx is available.
+Daemons shipped with NetBSD tend to write to both, while 3rd
+party software might write to only one.
+
+--- utmp-netbsd.c.orig 2015-02-13 04:30:05.000000000 +0000
++++ utmp-netbsd.c
+@@ -0,0 +1,79 @@
++#include <sys/param.h>
++#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)
++
++#include <sys/types.h>
++#include <sys/time.h>
++#include <sys/wait.h>
++
++#include <errno.h>
++#include <fcntl.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <time.h>
++#include <ttyent.h>
++#include <unistd.h>
++#include <util.h>
++#include <utmp.h>
++
++static struct utmp saved_utmp;
++static int saved_utmp_ok = 0;
++
++int
++lineslot(line)
++char *line;
++{
++ int slot;
++ struct ttyent *ttyp;
++
++ setttyent();
++ for (slot = 1; (ttyp = getttyent()) != NULL; ++slot)
++ if (!strcmp(ttyp->ty_name, line)) {
++ endttyent();
++ return(slot);
++ }
++ endttyent();
++ return(0);
++}
++
++void
++utmp_login(line)
++char *line;
++{
++ int fd;
++ int tty;
++
++ if (!saved_utmp_ok)
++ return;
++
++ tty = lineslot(line);
++ if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) {
++ (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
++ (void)write(fd, &saved_utmp, sizeof(struct utmp));
++ (void)close(fd);
++ }
++}
++
++void
++utmp_logout(const char *line)
++{
++ int fd;
++ struct utmp ut;
++
++ if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0)
++ return;
++ while (read(fd, &ut, sizeof(ut)) == sizeof(ut)) {
++ if (!ut.ut_name[0] || strncmp(ut.ut_line, line, UT_LINESIZE))
++ continue;
++ memcpy(&saved_utmp, &ut, sizeof(ut));
++ saved_utmp_ok = 1;
++ memset(ut.ut_name, 0, UT_NAMESIZE);
++ memset(ut.ut_host, 0, UT_HOSTSIZE);
++ (void)time(&ut.ut_time);
++ (void)lseek(fd, -(off_t)sizeof(ut), SEEK_CUR);
++ (void)write(fd, &ut, sizeof(ut));
++ }
++ (void)close(fd);
++}
++
++#endif
Index: pkgsrc/misc/screen4/patches/patch-an
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-an:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-an Fri Feb 7 03:15:06 2025
@@ -0,0 +1,47 @@
+$NetBSD: patch-an,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Remove GNU Make conditional. @ETCSCREENRC@ appears to get
+replaced always. If it doesn't in some cases, please fix
+configure.ac instead (and regen patch for configure as well).
+
+Add utmp-netbsd.c (created in patch-am) and utmp-netbsd.o.
+Setting the setuid bit is handled by the package Makefile.
+Don't try to leave "screen.old" behind on install.
+
+--- Makefile.in.orig 2014-04-26 10:58:35.000000000 +0000
++++ Makefile.in
+@@ -26,9 +26,6 @@ GIT_REV = "`git describe --always 2>/dev
+ DEFS = @DEFS@ -DGIT_REV=\"$(GIT_REV)\"
+
+ ETCSCREENRC = @ETCSCREENRC@
+-ifeq (${ETCSCREENRC}, )
+-ETCSCREENRC=$(prefix)/etc/screenrc
+-endif
+ SCREENENCODINGS = $(datadir)/screen/utf8encodings
+
+ CC = @CC@
+@@ -65,12 +62,12 @@ CFILES= screen.c ansi.c fileio.c mark.c
+ termcap.c input.c attacher.c pty.c process.c display.c comm.c \
+ kmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \
+ sched.c teln.c nethack.c encoding.c canvas.c layout.c viewport.c \
+- list_display.c list_generic.c list_window.c
++ list_display.c list_generic.c list_window.c utmp-netbsd.c
+ OFILES= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
+ search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
+ termcap.o input.o attacher.o pty.o process.o display.o comm.o \
+ kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
+- list_generic.o list_display.o list_window.o \
++ list_generic.o list_display.o list_window.o utmp-netbsd.o \
+ sched.o teln.o nethack.o encoding.o canvas.o layout.o viewport.o
+
+ all: screen
+@@ -86,9 +83,6 @@ install_bin: .version screen
+ -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
+ then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
+ $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
+- -chown root $(DESTDIR)$(bindir)/$(SCREEN) && chmod 4755 $(DESTDIR)$(bindir)/$(SCREEN)
+-# This doesn't work if $(bindir)/screen is a symlink
+- -if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi
+ rm -f $(DESTDIR)$(bindir)/screen
+ (cd $(DESTDIR)$(bindir) && ln -f -s $(SCREEN) screen)
+ cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)
Index: pkgsrc/misc/screen4/patches/patch-ao
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-ao:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-ao Fri Feb 7 03:15:06 2025
@@ -0,0 +1,14 @@
+$NetBSD: patch-ao,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Replace configurable paths with tags.
+
+--- etc/etcscreenrc.orig 2015-09-05 19:28:22.000000000 +0000
++++ etc/etcscreenrc
+@@ -1,6 +1,6 @@
+ #
+ # This is an example for the global screenrc file.
+-# You may want to install this file as /usr/local/etc/screenrc.
++# You may want to install this file as @PKG_SYSCONFDIR@/screenrc.
+ # Check config.h for the exact location.
+ #
+ # Flaws of termcap and standard settings are done here.
Index: pkgsrc/misc/screen4/patches/patch-ap
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-ap:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-ap Fri Feb 7 03:15:06 2025
@@ -0,0 +1,51 @@
+$NetBSD: patch-ap,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Replace configurable paths with tags.
+
+--- doc/screen.1.orig 2017-07-10 19:26:25.000000000 +0000
++++ doc/screen.1 2017-07-18 22:44:38.000000000 +0000
+@@ -712,7 +712,7 @@
+
+ .SH CUSTOMIZATION
+ The \*Qsocket directory\*U defaults either to $HOME/.screen or simply to
+-/tmp/screens or preferably to /usr/local/screens chosen at compile-time. If
++/tmp/screens. This is chosen at compile-time. If
+ .I screen
+ is installed setuid-root, then the administrator
+ should compile
+@@ -725,7 +725,7 @@
+ When
+ .I screen
+ is invoked, it executes initialization commands from the files
+-\*Q/usr/local/etc/screenrc\*U and
++\*Q@PKG_SYSCONFDIR@/screenrc\*U and
+ \*Q.screenrc\*U in the user's home directory. These are the \*Qprogrammer's
+ defaults\*U that can be overridden in the following ways: for the
+ global screenrc file
+@@ -755,7 +755,7 @@
+ protected from variable substitution.
+ .PP
+ Two configuration files are shipped as examples with your screen distribution:
+-\*Qetc/screenrc\*U and \*Qetc/etcscreenrc\*U. They contain a number of
++\*Q@EXAMPLES@/screenrc\*U and \*Q@EXAMPLES@/etcscreenrc\*U. They contain a number of
+ useful examples for various commands.
+ .PP
+ Customization can also be done 'on-line'. To enter the command mode type
+@@ -5017,14 +5017,14 @@
+ .I screen
+ distribution package for private and global initialization files.
+ .IP $SYSSCREENRC
+-.IP /usr/local/etc/screenrc
++.IP @PKG_SYSCONFDIR@/screenrc
+ .I screen
+ initialization commands
+ .IP $SCREENRC
+ .IP $HOME/.screenrc
+-Read in after /usr/local/etc/screenrc
++Read in after @PKG_SYSCONFDIR@/screenrc
+ .IP $SCREENDIR/S\-<login>
+-.IP /local/screens/S\-<login>
++.IP /tmp/screens/S\-<login>
+ Socket directories (default)
+ .IP /usr/tmp/screens/S\-<login>
+ Alternate socket directories.
Index: pkgsrc/misc/screen4/patches/patch-doc_screen.texinfo
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-doc_screen.texinfo:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-doc_screen.texinfo Fri Feb 7 03:15:06 2025
@@ -0,0 +1,14 @@
+$NetBSD: patch-doc_screen.texinfo,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Fix: Node `Window Settings' lacks menu item for `Mousetrack'
+
+--- doc/screen.texinfo.orig 2023-08-16 00:29:26.000000000 +0000
++++ doc/screen.texinfo
+@@ -2414,6 +2414,7 @@ terminal emulation itself.
+ * Login:: Control @file{/etc/utmp} logging
+ * Mode:: Control the file mode of the pty
+ * Monitor:: Watch for activity or inactivity in a window
++* Mousetrack:: Set whether screen should track mouse events
+ * Windows:: List the active windows
+ * Hardstatus:: Set a window's hardstatus line
+ @end menu
Index: pkgsrc/misc/screen4/patches/patch-screen.c
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-screen.c:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-screen.c Fri Feb 7 03:15:06 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-screen.c,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Use standard headers.
+
+--- screen.c.orig 2017-07-10 19:26:25.000000000 +0000
++++ screen.c 2017-07-18 22:40:56.000000000 +0000
+@@ -95,6 +95,8 @@
+ # include <langinfo.h>
+ #endif
+
++#include <limits.h>
++
+ #include "screen.h"
+ #ifdef HAVE_BRAILLE
+ # include "braille.h"
Index: pkgsrc/misc/screen4/patches/patch-socket.c
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-socket.c:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-socket.c Fri Feb 7 03:15:06 2025
@@ -0,0 +1,17 @@
+$NetBSD: patch-socket.c,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Include <uio.h> for iovec.
+
+--- socket.c.orig 2017-07-10 19:26:25.000000000 +0000
++++ socket.c 2017-07-18 22:35:40.000000000 +0000
+@@ -34,9 +34,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ # include <sys/socket.h>
+-# ifdef _OpenBSD_
+-# include <sys/uio.h>
+-# endif
++# include <sys/uio.h>
+ # include <sys/un.h>
+
+ #ifndef SIGINT
Index: pkgsrc/misc/screen4/patches/patch-tty.sh
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-tty.sh:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-tty.sh Fri Feb 7 03:15:06 2025
@@ -0,0 +1,49 @@
+$NetBSD: patch-tty.sh,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+Change condition for using TIOCSCTTY.
+
+NetBSD on the netbsd-5 branch insists on a non-NULL second argument
+to the realpath() function. Make it so.
+
+On BSD's we don't want to set CLOCAL because it prevents sending SIGHUP
+on master pty close.
+
+--- tty.sh.orig 2020-02-05 15:09:38.000000000 -0500
++++ tty.sh 2022-01-03 16:10:52.529555957 -0500
+@@ -267,7 +267,13 @@
+
+ IF{CS8} m->tio.c_cflag |= CS8;
+ IF{CREAD} m->tio.c_cflag |= CREAD;
++#ifndef BSD
++/*
++ * On BSDs definining CLOCAL disables SIGHUP on master close
++ * and we don't want that.
++ */
+ IF{CLOCAL} m->tio.c_cflag |= CLOCAL;
++#endif
+
+ IF{ECHOCTL} m->tio.c_lflag |= ECHOCTL;
+ IF{ECHOKE} m->tio.c_lflag |= ECHOKE;
+@@ -784,7 +790,9 @@
+ /*
+ * Under BSD we have to set the controlling terminal again explicitly.
+ */
+-# if (defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__GNU__) || defined(__OpenBSD__)) && defined(TIOCSCTTY)
++# if (defined(__FreeBSD_kernel__) || defined(__DragonFly__) \
++ || defined(__GNU__) || (BSD >= 199103) || defined(__OpenBSD__)) \
++ && defined(TIOCSCTTY)
+ ioctl(fd, TIOCSCTTY, (char *)0);
+ # endif
+
+@@ -1485,8 +1493,10 @@
+ char realbuf[PATH_MAX];
+ const char *real;
+ int rc;
++ char *ttynamebuf;
+
+- real = realpath(tty, realbuf);
++ ttynamebuf = malloc(MAXPATHLEN);
++ real = realpath(tty, ttynamebuf);
+ if (!real)
+ return -1;
+ realbuf[sizeof(realbuf)-1]='\0';
Index: pkgsrc/misc/screen4/patches/patch-window.h
diff -u /dev/null pkgsrc/misc/screen4/patches/patch-window.h:1.1
--- /dev/null Fri Feb 7 03:15:06 2025
+++ pkgsrc/misc/screen4/patches/patch-window.h Fri Feb 7 03:15:06 2025
@@ -0,0 +1,17 @@
+$NetBSD: patch-window.h,v 1.1 2025/02/07 03:15:06 ryoon Exp $
+
+OpenBSD grumbles without the socket definitions
+
+--- window.h.orig Wed Feb 5 20:09:38 2020
++++ window.h Thu Feb 11 21:27:43 2021
+@@ -33,6 +33,10 @@
+ #ifndef SCREEN_WINDOW_H
+ #define SCREEN_WINDOW_H
+
++#ifdef __OpenBSD__
++#include <sys/socket.h>
++#endif
++
+ /* keep this in sync with the initialisations in window.c */
+ struct NewWindow
+ {
Home |
Main Index |
Thread Index |
Old Index