diff options
author | 2025-01-14 17:40:25 +0400 | |
---|---|---|
committer | 2025-02-10 09:07:00 +0000 | |
commit | 35a01318e88aca4c8bdd80e3d791e04840f277b3 (patch) | |
tree | 94a2875c880cab91359b03ec02ac7583b528a535 /net-analyzer | |
parent | media-gfx/xloadimage: fix incompatible function pointer types on musl (diff) | |
download | gentoo-35a01318e88aca4c8bdd80e3d791e04840f277b3.tar.gz gentoo-35a01318e88aca4c8bdd80e3d791e04840f277b3.tar.bz2 gentoo-35a01318e88aca4c8bdd80e3d791e04840f277b3.zip |
net-analyzer/iplog: fix implicit declarations in configure, bool
Port to modern compilers and C23, and also fix for MUSL compile problem
Bug: https://bugs.gentoo.org/712644
Bug: https://bugs.gentoo.org/875155
Bug: https://bugs.gentoo.org/899936
Bug: https://bugs.gentoo.org/945194
Signed-off-by: NHOrus <jy6x2b32pie9@yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40131
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/iplog/files/iplog-2.2.3-C23.patch | 36 | ||||
-rw-r--r-- | net-analyzer/iplog/iplog-2.2.3-r4.ebuild | 41 |
2 files changed, 77 insertions, 0 deletions
diff --git a/net-analyzer/iplog/files/iplog-2.2.3-C23.patch b/net-analyzer/iplog/files/iplog-2.2.3-C23.patch new file mode 100644 index 000000000000..b905f0be4d9a --- /dev/null +++ b/net-analyzer/iplog/files/iplog-2.2.3-C23.patch @@ -0,0 +1,36 @@ +https://bugs.gentoo.org/945194 - guard bool for modern compilers +https://bugs.gentoo.org/712644 - type aliaces for musl +--- a/src/iplog.h ++++ b/src/iplog.h +@@ -21,6 +21,9 @@ + #ifndef __IPLOG_H + #define __IPLOG_H + ++#define _GNU_SOURCE 1 ++#include <sys/types.h> /* for u_* types */ ++ + #ifndef HAVE_IPADDR_T + typedef u_int32_t ipaddr_t; + #endif +@@ -82,7 +82,9 @@ + # define min(x,y) ((x) < (y) ? (x) : (y)) + #endif + ++#if __STDC_VERSION__ <= 201710L + typedef enum { false, true } bool; ++#endif + + #ifdef HAVE_PATHS_H + # include <paths.h> +C23 and GNU-15 compatibility, explicitly cast sockaddr +--- a/src/iplog_tcp.c ++++ b/src/iplog_tcp.c +@@ -144,7 +144,7 @@ + + ret = sendto(raw_sock, (char *) xip, + sizeof(struct ip) + sizeof(struct tcphdr), 0, +-#if !defined(__GLIBC__) || (__GLIBC__ < 2) ++#if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__STDC_VERSION__ > 201710L) + (struct sockaddr *) + #endif + &fn_sin, diff --git a/net-analyzer/iplog/iplog-2.2.3-r4.ebuild b/net-analyzer/iplog/iplog-2.2.3-r4.ebuild new file mode 100644 index 000000000000..1abed3079f62 --- /dev/null +++ b/net-analyzer/iplog/iplog-2.2.3-r4.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs autotools + +DESCRIPTION="TCP/IP traffic logger" +HOMEPAGE="https://ojnk.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/ojnk/${P}.tar.gz" + +LICENSE="|| ( GPL-2 FDL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" + +DEPEND="net-libs/libpcap" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${PV}-DLT_LINUX_SSL.patch" + "${FILESDIR}/${P}-C23.patch") + +DOCS=( AUTHORS NEWS README TODO example-iplog.conf ) + +src_prepare() { + default + + #https://bugs.gentoo.org/899936 + #https://bugs.gentoo.org/875155 + eautoreconf +} + +src_compile() { + append-cppflags -D_REENTRANT + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" all +} + +src_install() { + default + newinitd "${FILESDIR}"/iplog.rc6 iplog +} |