git: fa4b531894f8 - main - net-im/gomuks: Fix runtime within a tmux session

From: Emanuel Haupt <ehaupt_at_FreeBSD.org>
Date: Tue, 12 Apr 2022 13:01:57 UTC
The branch main has been updated by ehaupt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fa4b531894f88d21307b3e8640b197fbe99038ec

commit fa4b531894f88d21307b3e8640b197fbe99038ec
Author:     Emanuel Haupt <ehaupt@FreeBSD.org>
AuthorDate: 2022-04-12 13:01:37 +0000
Commit:     Emanuel Haupt <ehaupt@FreeBSD.org>
CommitDate: 2022-04-12 13:01:54 +0000

    net-im/gomuks: Fix runtime within a tmux session
    
    An upstream change [1] made it a requirement to have `infocmp` installed
    for parsing terminal capabilities within a tmux session.
    
    While ncurses from base works perfectly fine with gomuks, base does not
    ship with `infocmp` thus creating a hard dependency to devel/ncurses.
    
    Patch port to revert upstream change.
    
    [1] https://github.com/tulir/tcell/commit/aef08b141333dfbaad8a7f0c187d7ab7d2b203c9
        https://github.com/tulir/tcell/blob/bb9a2b9b1937b1ede6a00450b2650b7b0befe2fc/terminfo/dynamic/dynamic.go#L121
    
    PR:             263213
    Upstream issue: https://github.com/tulir/gomuks/issues/363
    Reported by:    parakleta@darkreality.org
---
 net-im/gomuks/Makefile                                 |  2 +-
 .../files/patch-vendor_maunium.net_go_tcell_tscreen.go | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/net-im/gomuks/Makefile b/net-im/gomuks/Makefile
index 126fa4b15e67..c78dcbc0e549 100644
--- a/net-im/gomuks/Makefile
+++ b/net-im/gomuks/Makefile
@@ -3,7 +3,7 @@
 PORTNAME=	gomuks
 PORTVERSION=	0.2.4
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net-im
 
 MAINTAINER=	ehaupt@FreeBSD.org
diff --git a/net-im/gomuks/files/patch-vendor_maunium.net_go_tcell_tscreen.go b/net-im/gomuks/files/patch-vendor_maunium.net_go_tcell_tscreen.go
new file mode 100644
index 000000000000..a556e946df72
--- /dev/null
+++ b/net-im/gomuks/files/patch-vendor_maunium.net_go_tcell_tscreen.go
@@ -0,0 +1,18 @@
+--- vendor/maunium.net/go/tcell/tscreen.go.orig	2022-04-12 11:45:41 UTC
++++ vendor/maunium.net/go/tcell/tscreen.go
+@@ -50,13 +50,9 @@ const (
+ // $COLUMNS environment variables can be set to the actual window size,
+ // otherwise defaults taken from the terminal database are used.
+ func NewTerminfoScreen() (Screen, error) {
+-	term := os.Getenv("TERM")
+-	if len(term) >= 6 && term[:6] == "screen" && len(os.Getenv("TMUX")) > 0 {
+-		term = "tmux"
+-	}
+-	ti, e := terminfo.LookupTerminfo(term)
++	ti, e := terminfo.LookupTerminfo(os.Getenv("TERM"))
+ 	if e != nil {
+-		ti, e = loadDynamicTerminfo(term)
++		ti, e = loadDynamicTerminfo(os.Getenv("TERM"))
+ 		if e != nil {
+ 			return nil, e
+ 		}