summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-01-25 16:09:09 +0000
committerSam James <sam@gentoo.org>2025-01-25 16:09:41 +0000
commit769c936892ecbe54b0a2a36179335a9e13c0dfaf (patch)
treea21f5deb66e62b83cd0bae05d0128dabcaca1b23 /net-analyzer
parentsys-libs/ncurses: add 6.5_p20250118 (diff)
downloadgentoo-769c936892ecbe54b0a2a36179335a9e13c0dfaf.tar.gz
gentoo-769c936892ecbe54b0a2a36179335a9e13c0dfaf.tar.bz2
gentoo-769c936892ecbe54b0a2a36179335a9e13c0dfaf.zip
net-analyzer/nethogs: add 0.8.8
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/nethogs/Manifest1
-rw-r--r--net-analyzer/nethogs/files/nethogs-0.8.8-meson.patch85
-rw-r--r--net-analyzer/nethogs/nethogs-0.8.8.ebuild40
3 files changed, 126 insertions, 0 deletions
diff --git a/net-analyzer/nethogs/Manifest b/net-analyzer/nethogs/Manifest
index c56737e97dda..3299ce9b8f89 100644
--- a/net-analyzer/nethogs/Manifest
+++ b/net-analyzer/nethogs/Manifest
@@ -1 +1,2 @@
DIST nethogs-0.8.7.tar.gz 270631 BLAKE2B 179227d4b1fde5328e4885ce72bb28ac20482fa161afee7562546af5b403be1e851533e3861dfa2f514968aebe91a822e6b792520407853dfb1055c6d29ad121 SHA512 d965f3fa439ea9fbba83578b4272d03f396bf3cff9ae73a94936d47a3422d066d885c7f6f2a47fbe2f445a017bffa3fb3a1215976522ef0ad120fae3b95b31a2
+DIST nethogs-0.8.8.tar.gz 272792 BLAKE2B ec18cd291768c1baf22ab71b4219ab050c8f919419510234e71ec3d618fb0ff72cac4ccf04a4b1b063f71cf308f2ce2db09c595e4845372e4e6c61bf074e3ef3 SHA512 df076204c329f48161b01b51f89a6e7946b83ef330349e0df39e0358b9d3d973be9cdb64eb86ab9a83fb4f9389865a7859739de6a896374952ec2a08b2084b0d
diff --git a/net-analyzer/nethogs/files/nethogs-0.8.8-meson.patch b/net-analyzer/nethogs/files/nethogs-0.8.8-meson.patch
new file mode 100644
index 000000000000..2c87197b9933
--- /dev/null
+++ b/net-analyzer/nethogs/files/nethogs-0.8.8-meson.patch
@@ -0,0 +1,85 @@
+https://github.com/raboof/nethogs/pull/285
+
+[Formatting patch 3/3 dropped.]
+
+From 049fff5623720fcd0b4fdc92501b586addbb6b48 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 25 Jan 2025 16:03:12 +0000
+Subject: [PATCH 1/3] meson: cleanup version detection
+
+Tell Meson what version the project is, so that we set the right versioning
+on libnethogs.
+---
+ meson.build | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 81d7b59..16e61b4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -5,11 +5,11 @@
+ project('nethogs',
+ ['c', 'cpp'],
+ default_options : ['warning_level=3',
+- 'cpp_std=c++14']
++ 'cpp_std=c++14'],
++ version : run_command('./determineVersion.sh').stdout().strip(),
+ )
+
+ cc = meson.get_compiler('cpp')
+-version = run_command('./determineVersion.sh', check: true).stdout().strip()
+
+ #######################################
+ ## Dependencies and flags definition ##
+@@ -19,7 +19,7 @@ projectinc = [include_directories('.', 'src')]
+
+ # flags
+ c_args = [
+- '-DVERSION="' + version + '"'
++ '-DVERSION="' + meson.project_version() + '"'
+ ]
+
+ # dependencies
+@@ -42,5 +42,5 @@ pkgconfig = import('pkgconfig')
+ pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
+ pkgconfig.generate(libnethogs,
+ requires: ['libpcap'],
+- version: version
++ version: meson.project_version()
+ )
+
+From 5afce747f142f6df6a264ab368c99f47050d9984 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 25 Jan 2025 16:05:20 +0000
+Subject: [PATCH 2/3] meson: fix build with libnethogs disabled
+
+Fix `meson.build:43:19: ERROR: Unknown variable "libnethogs".`.
+
+While src/ has this correct, the top-level meson.build wasn't right.
+---
+ meson.build | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 16e61b4..8537718 100644
+--- a/meson.build
++++ b/meson.build
+@@ -38,9 +38,11 @@ subdir('src')
+ #############################
+ ## Pkgconfig definition ##
+ #############################
+-pkgconfig = import('pkgconfig')
+-pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
+-pkgconfig.generate(libnethogs,
+- requires: ['libpcap'],
+- version: meson.project_version()
+- )
++if get_option('enable-libnethogs').enabled()
++ pkgconfig = import('pkgconfig')
++ pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
++ pkgconfig.generate(libnethogs,
++ requires: ['libpcap'],
++ version: meson.project_version()
++ )
++endif
+
diff --git a/net-analyzer/nethogs/nethogs-0.8.8.ebuild b/net-analyzer/nethogs/nethogs-0.8.8.ebuild
new file mode 100644
index 000000000000..9b5e7a08fb1b
--- /dev/null
+++ b/net-analyzer/nethogs/nethogs-0.8.8.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit fcaps meson
+
+DESCRIPTION="Small 'net top' tool, grouping bandwidth by process"
+HOMEPAGE="https://github.com/raboof/nethogs"
+SRC_URI="https://github.com/raboof/nethogs/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+RDEPEND="
+ net-libs/libpcap
+ sys-libs/ncurses:=[cxx]
+"
+DEPEND="${RDEPEND}"
+
+DOCS=( DESIGN README.decpcap.txt README.md )
+
+FILECAPS=(
+ cap_net_admin,cap_net_raw usr/sbin/nethogs
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.8.8-meson.patch
+)
+
+src_prepare() {
+ default
+
+ cat <<-EOF > determineVersion.sh || die
+ #!/bin/sh
+ printf "${PV}"
+ EOF
+ chmod +x determineVersion.sh || die
+}