Index: head/sysutils/screen/Makefile =================================================================== --- head/sysutils/screen/Makefile (revision 515952) +++ head/sysutils/screen/Makefile (revision 515953) @@ -1,109 +1,109 @@ # Created by: Andrey Chernov # $FreeBSD$ PORTNAME= screen PORTVERSION= 4.7.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= sysutils MASTER_SITES= GNU \ ftp://ftp.gnu.org/gnu/screen/ \ ftp://gnu.mirror.iweb.com/screen/ \ http://gnu.mirror.iweb.com/screen/ \ http://mirror.sdunix.com/gnu/ \ ftp://mirrors.kernel.org/gnu/screen/ \ http://cschubert.com/distfiles/ \ LOCAL/cy MAINTAINER= cy@FreeBSD.org COMMENT= Multi-screen window manager LICENSE= GPLv3 OPTIONS_DEFINE= INFO NETHACK XTERM_256 SHOWENC SYSTEM_SCREENRC OPTIONS_DEFAULT= INFO NETHACK XTERM_256 SOCKETS SYSTEM_SCREENRC \ NCURSES_DEFAULT OPTIONS_SINGLE= IPC NCURSES OPTIONS_SINGLE_IPC= SOCKETS NAMED_PIPES OPTIONS_SINGLE_NCURSES= NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT INFO_DESC= Build and install info documentation NETHACK_DESC= Enable nethack-style messages XTERM_256_DESC= Enable support for 256 colour xterm SHOWENC_DESC= Show encoding on the status line SOCKETS_DESC= Use new (4.2.1+) sockets for IPC (default) NAMED_PIPES_DESC= Use legacy (4.0.3) named pipes for IPC (override) SYSTEM_SCREENRC_DESC= Install system screenrc with helpful status line NCURSES_DEFAULT_DESC= Depend on ncurses (ports if installed, otherwise base) NCURSES_BASE_DESC= Depend on ncurses in base NCURSES_PORT_DESC= Depend on devel/ncurses in ports NCURSES_DEFAULT_USES= ncurses NCURSES_BASE_USES= ncurses:base NCURSES_PORT_USES= ncurses:port OPTIONS_SUB= USES= gmake cpe MAKE_ARGS+= WITH_MAN=1 CPE_VENDOR= gnu .include GNU_CONFIGURE= yes CFLAGS+= -I${NCURSESINC} LDFLAGS+= -L${NCURSESLIB} .if ${PORT_OPTIONS:MINFO} INFO= screen MAKE_ARGS+= WITH_INFO=1 USES+= makeinfo .endif # Enables support for 256 colour xterm. Note that you may need to # set up a custom termcap entry or .screenrc which modifies termcap # to contain the following: Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm # .if ${PORT_OPTIONS:MXTERM_256} CFLAGS+= -DCOLORS256 .endif .if ! ${PORT_OPTIONS:MNETHACK} CFLAGS+= -DNONETHACK .endif # show encoding on the status line via option "showenc" .if ${PORT_OPTIONS:MSHOWENC} EXTRA_PATCHES+= ${FILESDIR}/opt-showencoding .endif post-patch: @${RM} ${WRKSRC}/doc/screen.info* @${REINPLACE_CMD} -e 's|/dev/ptmx|/nonexistent|' ${WRKSRC}/configure # Bug 191029: Users can choose whether to use sockets or named pipes. # Choose sockets if you don't know what the difference is. # Choose named pipes if your environment is heterogeneous, # using both screen 4.0.3 and 4.2.1. # Bug 191017 post-configure-NAMED_PIPES-on: @${ECHO_CMD} '#define NAMEDPIPE 1' >> ${WRKSRC}/config.h @${ECHO_CMD} User selected named pipes override set. ETCDIR?= ${PREFIX}/etc post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \ ${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-1 ${INSTALL_DATA} ${FILESDIR}/screenrc.sample \ ${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-2 @${MKDIR} ${STAGEDIR}${ETCDIR} .if ${PORT_OPTIONS:MSYSTEM_SCREENRC} ${INSTALL_DATA} ${FILESDIR}/screenrc.sample \ ${STAGEDIR}${ETCDIR}/screenrc.sample .else ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \ ${STAGEDIR}${ETCDIR}/screenrc.sample .endif .include Index: head/sysutils/screen/files/patch-configure =================================================================== --- head/sysutils/screen/files/patch-configure (revision 515952) +++ head/sysutils/screen/files/patch-configure (revision 515953) @@ -1,145 +1,162 @@ --- configure.orig 2019-10-01 15:27:14.000000000 -0700 -+++ configure 2019-10-08 04:39:00.284009000 -0700 ++++ configure 2019-10-27 23:29:24.744163000 -0700 @@ -4756,63 +4756,6 @@ else olibs="$LIBS" -LIBS="-lcurses $olibs" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libcurses..." >&5 -$as_echo "$as_me: checking libcurses..." >&6;} -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -#ifdef __hpux -__sorry_hpux_libcurses_is_totally_broken_in_10_10(); -#else -tgetent((char *)0, (char *)0); -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - LIBS="-ltermcap $olibs" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libtermcap..." >&5 -$as_echo "$as_me: checking libtermcap..." >&6;} -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -tgetent((char *)0, (char *)0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - LIBS="-ltermlib $olibs" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libtermlib..." >&5 -$as_echo "$as_me: checking libtermlib..." >&6;} -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -tgetent((char *)0, (char *)0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else LIBS="-lncursesw $olibs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking libncursesw..." >&5 $as_echo "$as_me: checking libncursesw..." >&6;} @@ -4897,15 +4840,6 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext if test "$cross_compiling" = yes; then : echo "- skipping check because we are cross compiling; assuming terminfo database is used" 1>&6 @@ -4917,7 +4851,8 @@ main() { - exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); + char *tgoto(const char *, int, int); + exit(strcmp(tgoto("%d%d", 0, 1), "1") ? 0 : 1); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -4967,7 +4902,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SVR4 ptys..." >&5 $as_echo "$as_me: checking for SVR4 ptys..." >&6;} sysvr4ptys= -if test -c /dev/ptmx ; then +if test -c /nonexistent ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5080,19 +5015,17 @@ fi rm -f conftest* -if test "$ptys" != "$pdir/pty??" ; then -p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` -p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` +# XXX: hardcoded, since port must be devfs and various setups independent + cat >>confdefs.h <<_ACEOF -#define PTYRANGE0 "$p0" +#define PTYRANGE0 "pqrsPQRSlmnoLMNO" _ACEOF cat >>confdefs.h <<_ACEOF -#define PTYRANGE1 "$p1" +#define PTYRANGE1 "0123456789abcdefghijklmnopqrstuv" _ACEOF fi -fi # Check whether --with-pty-mode was given. -@@ -5318,6 +5251,8 @@ - #if defined(SVR4) && !defined(DGUX) +@@ -5315,9 +5248,11 @@ + + #include /* to get time_t on SCO */ + #include +-#if defined(SVR4) && !defined(DGUX) ++#if (defined(SVR4) && !defined(DGUX)) || defined(__FreeBSD_cc_version) #include #define utmp utmpx +#define pututline pututxline +#define getutent getutxent #else #include #endif -@@ -5386,6 +5321,10 @@ - #if defined(SVR4) && !defined(DGUX) +@@ -5346,7 +5281,7 @@ + + #include + #include +-#if defined(SVR4) && !defined(DGUX) ++#if (defined(SVR4) && !defined(DGUX)) || defined(__FreeBSD_cc_version) + #include + #define utmp utmpx + #else +@@ -5383,9 +5318,13 @@ + + #include + #include +-#if defined(SVR4) && !defined(DGUX) ++#if (defined(SVR4) && !defined(DGUX)) || defined(__FreeBSD_cc_version) #include #define utmp utmpx +#define pututline pututxline +#define getutent getutxent +#define pututline pututxline +#define getutent getutxent #else #include #endif Index: head/sysutils/screen/files/patch-utmp.c =================================================================== --- head/sysutils/screen/files/patch-utmp.c (revision 515952) +++ head/sysutils/screen/files/patch-utmp.c (revision 515953) @@ -1,128 +1,113 @@ ---- utmp.c.orig 2019-10-01 15:08:00.000000000 -0700 -+++ utmp.c 2019-10-08 17:56:32.853627000 -0700 -@@ -26,9 +26,13 @@ +--- utmp.c.orig 2017-01-17 11:28:29.397404660 -0800 ++++ utmp.c 2017-02-10 16:48:34.902236000 -0800 +@@ -26,6 +26,7 @@ **************************************************************** */ +#include #include #include #include -+#ifdef __FreeBSD_version -+#define GETUTENT -+#endif - - #include "config.h" - #include "screen.h" -@@ -102,7 +106,7 @@ - - static int utmpok; - static char UtmpName[] = UTMPFILE; --#ifndef UTMP_HELPER -+#if !defined(UTMP_HELPER) || defined(__FreeBSD__) - static int utmpfd = -1; - #endif - -@@ -409,12 +413,6 @@ +@@ -409,12 +410,6 @@ register slot_t slot; struct utmp u; int saved_ut; -#ifdef UTHOST - char *p; - char host[sizeof(D_loginhost) + 15]; -#else - char *host = 0; -#endif /* UTHOST */ wi->w_slot = (slot_t)0; if (!utmpok || wi->w_type != W_TYPE_PTY) -@@ -435,51 +433,13 @@ +@@ -435,51 +430,13 @@ makeuser(&u, stripdev(wi->w_tty), LoginName, wi->w_pid); #ifdef UTHOST - host[sizeof(host) - 15] = '\0'; - if (display) - { - strncpy(host, D_loginhost, sizeof(host) - 15); - if (D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1 && host[0] != '\0') - { - /* - * we want to set our ut_host field to something like - * ":ttyhf:s.0" or - * "faui45:s.0" or - * "132.199.81.4:s.0" (even this may hurt..), but not - * "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 != '.')) - break; - if (*p) - { - for (p = host; *p; p++) - if (*p == '.' || (*p == ':' && p != host)) - { - *p = '\0'; - break; - } - } - } - else - { - strncpy(host + 1, stripdev(D_usertty), sizeof(host) - 15 - 1); - host[0] = ':'; - } - } - else - strncpy(host, "local", sizeof(host) - 15); - - sprintf(host + strlen(host), ":S.%d", wi->w_number); - debug1("rlogin hostname: '%s'\n", host); - # if !defined(_SEQUENT_) && !defined(sequent) - strncpy(u.ut_host, host, sizeof(u.ut_host)); + if (display) + strncpy(u.ut_host, D_loginhost, sizeof(u.ut_host)); # endif #endif /* UTHOST */ - if (pututslot(slot, &u, host, wi) == 0) + if (pututslot(slot, &u, D_loginhost, wi) == 0) { Msg(errno,"Could not write %s", UtmpName); UT_CLOSE; -@@ -598,7 +558,7 @@ +@@ -598,7 +555,7 @@ struct utmp *u; { u->ut_type = DEAD_PROCESS; -#if (!defined(linux) || defined(EMPTY)) && !defined(__CYGWIN__) +#if (!defined(linux) || defined(EMPTY)) && !defined(__CYGWIN__) && !defined(__FreeBSD__) u->ut_exit.e_termination = 0; u->ut_exit.e_exit = 0; #endif -@@ -631,7 +591,11 @@ +@@ -631,7 +588,11 @@ /* must use temp variable because of NetBSD/sparc64, where * ut_xtime is long(64) but time_t is int(32) */ (void)time(&now); - u->ut_time = now; +#if defined(__FreeBSD_version) && __FreeBSD_version < 900000 + u->ut_time = now; +#else + u->ut_tv.tv_sec = now; +#endif } static slot_t -@@ -743,7 +707,11 @@ +@@ -743,7 +704,11 @@ strncpy(u->ut_line, line, sizeof(u->ut_line)); strncpy(u->ut_name, user, sizeof(u->ut_name)); (void)time(&now); - u->ut_time = now; +#if defined(__FreeBSD_version) && __FreeBSD_version < 900000 + u->ut_time = now; +#else + u->ut_tv.tv_sec = now; +#endif } static slot_t