From 75dee2285b1309f42d7490673d94a682fe30b1fa Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Sun, 29 Mar 2020 14:19:34 +0200 Subject: [PATCH] net-analyzer/sngrep: Fix building against sys-libs/musl See also: https://github.com/irontec/sngrep/commit/604f6d0ce2ec42ac494d76c95e68850ea6e7da8f Package-Manager: Portage-2.3.96, Repoman-2.3.22 Closes: https://bugs.gentoo.org/715256 Signed-off-by: Jeroen Roovers --- .../sngrep/files/sngrep-1.4.6-stdin.patch | 11 +++++ net-analyzer/sngrep/sngrep-1.4.6-r2.ebuild | 44 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 net-analyzer/sngrep/files/sngrep-1.4.6-stdin.patch create mode 100644 net-analyzer/sngrep/sngrep-1.4.6-r2.ebuild diff --git a/net-analyzer/sngrep/files/sngrep-1.4.6-stdin.patch b/net-analyzer/sngrep/files/sngrep-1.4.6-stdin.patch new file mode 100644 index 000000000000..b61025d25b6e --- /dev/null +++ b/net-analyzer/sngrep/files/sngrep-1.4.6-stdin.patch @@ -0,0 +1,11 @@ +--- a/src/capture.c ++++ b/src/capture.c +@@ -191,7 +191,7 @@ + + // Reopen tty for ncurses after pcap have used stdin + if (!strncmp(infile, "/dev/stdin", 10)) { +- if (!(stdin = freopen("/dev/tty", "r", stdin))) { ++ if (!(fstdin = freopen("/dev/tty", "r", stdin))) { + fprintf(stderr, "Failed to reopen tty while using stdin for capture."); + return 1; + } diff --git a/net-analyzer/sngrep/sngrep-1.4.6-r2.ebuild b/net-analyzer/sngrep/sngrep-1.4.6-r2.ebuild new file mode 100644 index 000000000000..011fb09336bd --- /dev/null +++ b/net-analyzer/sngrep/sngrep-1.4.6-r2.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools + +DESCRIPTION="Ncurses SIP Messages flow viewer" +HOMEPAGE="https://github.com/irontec/sngrep" +SRC_URI="https://github.com/irontec/sngrep/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="eep gnutls ipv6 openssl pcre unicode" +REQUIRED_USE=" + gnutls? ( !openssl ) +" + +DEPEND=" + net-libs/libpcap + sys-libs/ncurses:0=[unicode?] + openssl? ( dev-libs/openssl:0= ) + gnutls? ( net-libs/gnutls ) +" +RDEPEND="${DEPEND}" +PATCHES=( + "${FILESDIR}"/${PN}-1.4.5-tinfo.patch + "${FILESDIR}"/${PN}-1.4.6-stdin.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf \ + $(use_enable eep) \ + $(use_enable ipv6) \ + $(use_enable unicode) \ + $(use_with gnutls) \ + $(use_with openssl) \ + $(use_with pcre) +} -- 2.26.2