From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1438389-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id F1663158094
	for <garchives@archives.gentoo.org>; Thu, 22 Sep 2022 03:04:56 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9C758E0BB5;
	Thu, 22 Sep 2022 03:04:54 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 81572E0BB5
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Sep 2022 03:04:54 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 5B75C340DF8
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Sep 2022 03:04:53 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id AE33F5DB
	for <gentoo-commits@lists.gentoo.org>; Thu, 22 Sep 2022 03:04:51 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1663815436.29df23ad4410881b5233a0c2ce31f2bd75238ef6.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/tmux/, app-misc/tmux/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-misc/tmux/files/tmux-3.3a-clang.patch app-misc/tmux/tmux-3.3a-r1.ebuild
X-VCS-Directories: app-misc/tmux/ app-misc/tmux/files/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 29df23ad4410881b5233a0c2ce31f2bd75238ef6
X-VCS-Branch: master
Date: Thu, 22 Sep 2022 03:04:51 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: f98f43e4-2190-4420-a602-e955a876ca5b
X-Archives-Hash: 0520e2dd25f79d3fc8e24d8c2b35c213

commit:     29df23ad4410881b5233a0c2ce31f2bd75238ef6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 02:57:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 02:57:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29df23ad

app-misc/tmux: backport Clang fixes

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/tmux/files/tmux-3.3a-clang.patch | 59 ++++++++++++++++++++++
 app-misc/tmux/tmux-3.3a-r1.ebuild         | 84 +++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+)

diff --git a/app-misc/tmux/files/tmux-3.3a-clang.patch b/app-misc/tmux/files/tmux-3.3a-clang.patch
new file mode 100644
index 000000000000..e292e698f310
--- /dev/null
+++ b/app-misc/tmux/files/tmux-3.3a-clang.patch
@@ -0,0 +1,59 @@
+https://github.com/tmux/tmux/pull/3332
+
+From 1b4c87de0249242309f10684761698aa880b80a5 Mon Sep 17 00:00:00 2001
+From: Marvin Schmidt <marv@exherbo.org>
+Date: Tue, 13 Sep 2022 03:25:00 +0200
+Subject: [PATCH 1/2] compat/systemd: Include <string.h> for strerror
+
+Recent compilers are getting stricter about function declarations being
+known during compilation and e.g. clang-15 now errors out if a function
+signature is not found:
+
+> compat/systemd.c:56:49: error: call to undeclared library function 'strerror' with type 'char *(int)'; ISO C99 and
+>       later do not support implicit function declarations [-Wimplicit-function-declaration]
+>                 xasprintf(cause, "systemd socket error (%s)", strerror(errno));
+>                                                               ^
+> compat/systemd.c:56:49: note: include the header <string.h> or explicitly provide a declaration for 'strerror'
+> 1 warning and 1 error generated.
+
+Provide the declaration of `strerror` by including `<string.h>` to fix
+this
+--- a/compat/systemd.c
++++ b/compat/systemd.c
+@@ -16,6 +16,7 @@
+  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include <string.h>
+ #include <sys/types.h>
+ #include <sys/un.h>
+ 
+
+From 1e7ef02c52f2f8a67ab05d8a1c3fec9f4ccb7ea0 Mon Sep 17 00:00:00 2001
+From: Marvin Schmidt <marv@exherbo.org>
+Date: Tue, 13 Sep 2022 03:34:01 +0200
+Subject: [PATCH 2/2] compat/systemd: Use socklen_t instead of int to fix
+ warning
+
+clang-15 warns about the pointer passed to `getsockname()` being of
+different signedness then the parameter declaration:
+
+> compat/systemd.c:46:47: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *')
+>       converts between pointers to integer types with different sign [-Wpointer-sign]
+>                 if (getsockname(fd, (struct sockaddr *)&sa, &addrlen) == -1)
+>                                                             ^~~~~~~~
+> /usr/x86_64-pc-linux-musl/include/sys/socket.h:391:73: note: passing argument to parameter here
+> int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
+>                                                                         ^
+--- a/compat/systemd.c
++++ b/compat/systemd.c
+@@ -30,7 +30,7 @@ systemd_create_socket(int flags, char **cause)
+ 	int			fds;
+ 	int			fd;
+ 	struct sockaddr_un	sa;
+-	int			addrlen = sizeof sa;
++	socklen_t		addrlen = sizeof sa;
+ 
+ 	fds = sd_listen_fds(0);
+ 	if (fds > 1) { /* too many file descriptors */
+

diff --git a/app-misc/tmux/tmux-3.3a-r1.ebuild b/app-misc/tmux/tmux-3.3a-r1.ebuild
new file mode 100644
index 000000000000..551fa7c7e57d
--- /dev/null
+++ b/app-misc/tmux/tmux-3.3a-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Terminal multiplexer"
+HOMEPAGE="https://tmux.github.io/"
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	SRC_URI="https://raw.githubusercontent.com/przepompownia/tmux-bash-completion/678a27616b70c649c6701cae9cd8c92b58cc051b/completions/tmux -> tmux-bash-completion-678a27616b70c649c6701cae9cd8c92b58cc051b"
+	EGIT_REPO_URI="https://github.com/tmux/tmux.git"
+else
+	SRC_URI="https://github.com/tmux/tmux/releases/download/${PV}/${P/_/-}.tar.gz"
+	if [[ ${PV} != *_rc* ]] ; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+	fi
+	S="${WORKDIR}/${P/_/-}"
+fi
+
+LICENSE="ISC"
+SLOT="0"
+IUSE="debug selinux systemd utempter vim-syntax"
+
+DEPEND="
+	dev-libs/libevent:=
+	sys-libs/ncurses:=
+	systemd? ( sys-apps/systemd:= )
+	utempter? ( sys-libs/libutempter )
+	kernel_Darwin? ( dev-libs/libutf8proc:= )
+"
+
+BDEPEND="
+	virtual/pkgconfig
+	virtual/yacc
+"
+
+RDEPEND="
+	${DEPEND}
+	selinux? ( sec-policy/selinux-screen )
+	vim-syntax? ( app-vim/vim-tmux )
+"
+
+DOCS=( CHANGES README )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4-flags.patch
+	"${FILESDIR}"/${P}-clang.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	# bug 438558
+	# 1.7 segfaults when entering copy mode if compiled with -Os
+	replace-flags -Os -O2
+
+	local myeconfargs=(
+		--sysconfdir="${EPREFIX}"/etc
+		$(use_enable debug)
+		$(use_enable systemd)
+		$(use_enable utempter)
+
+		# For now, we only expose this for macOS, because
+		# upstream strongly encourage it. I'm not sure it's
+		# needed on Linux right now.
+		$(use_enable kernel_Darwin utf8proc)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+
+	einstalldocs
+
+	dodoc example_tmux.conf
+	docompress -x /usr/share/doc/${PF}/example_tmux.conf
+}