Skip to contentSkip to conversation

package/nethogs: add patch to fix missing time.h includes

PATCH New Marcus Hoffmann via buildroot 1 participant 2 messages Feb 10 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/nethogs: add patch to fix missing time.h includes

Fixes:
- https://autobuild.buildroot.net/results/489/489e92cf7d1d1f7c29b452f09e06872cc61b9116/
- https://autobuild.buildroot.net/results/2b6/2b6e3d723b4101cef61e36e13039288923ebffe2/
- https://autobuild.buildroot.net/results/1da/1dae32417c889639da6d2c5aa80b565e7bfcddd0/

---
 ...ode2prog-add-missing-time.h-includes.patch | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/nethogs/0001-main-inode2prog-add-missing-time.h-includes.patch
package/nethogs/0001-main-inode2prog-add-missing-time.h-includes.patch new file +46 -0
new file mode 100644
index 0000000000..a6294e0c4f
@@ -0,0 +1,46 @@
+From f451eefaf4ebf5042f15cddad440722d5078b571 Mon Sep 17 00:00:00 2001
+From: Marcus Hoffmann <[email protected]>
+Date: Mon, 9 Feb 2026 17:22:28 +0100
+Subject: [PATCH] main,inode2prog: add missing time.h includes
+
+clock_gettime() and time() are both declared in time.h, so add
+that to the includes in main.cpp and inode2prog.h
+
+time.h gets included implicitly included via many other stdlib headers,
+but this isn't guaranteed and indeed this fails to compile in buildroot
+for some configurations.
+
+Signed-off-by: Marcus Hoffmann <[email protected]>
+Upstream: https://github.com/raboof/nethogs/pull/305
+---
+ src/inode2prog.cpp | 1 +
+ src/main.cpp       | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/inode2prog.cpp b/src/inode2prog.cpp
+index 8ec1f65..e554256 100644
+--- a/src/inode2prog.cpp
++++ b/src/inode2prog.cpp
+@@ -36,6 +36,7 @@
+ #include <string>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <time.h>
+ #include <unistd.h>
+ 
+ #include "inode2prog.h"
+diff --git a/src/main.cpp b/src/main.cpp
+index 7501461..0ccc7dd 100644
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -3,6 +3,7 @@
+ #include <set>
+ #include <vector>
+ #include <list>
++#include <time.h>
+ 
+ #ifdef __linux__
+ #include <linux/capability.h>
+-- 
+2.53.0
+
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/nethogs: switch to meson build

Add two patches from upstream that are required to get meson builds to work.

Disable building (and installing) libnethogs, as it has currently no consumer. It wasn't available previously either.

This fixes linker errrors in static builds when libnl is also built (which is a dependency of libpcap but the linking flags from pkgconfig are not picked up in the handwritten makefiles).

Fixes:
* https://autobuild.buildroot.net/results/9f8/9f8e9214b8f1d62e1638c42d3dcca482c02c16c5/
* https://autobuild.buildroot.net/results/eea/eea5023d2732e6b8c1be0e3f4e5d9b28954f0a60/
* https://autobuild.buildroot.net/results/f59/f59f789add493337da7d92e3372a450f74d2c8f3/

---
 ...ild-remove-unused-ncurses-dependency.patch | 35 ++++++++++++++++
 ...n-fix-build-with-libnethogs-disabled.patch | 41 +++++++++++++++++++
 package/nethogs/nethogs.mk                    | 11 +----
 3 files changed, 78 insertions(+), 9 deletions(-)
 create mode 100644 package/nethogs/0002-src-meson.build-remove-unused-ncurses-dependency.patch
 create mode 100644 package/nethogs/0003-meson-fix-build-with-libnethogs-disabled.patch
package/nethogs/0002-src-meson.build-remove-unused-ncurses-dependency.patch new file +35 -0
new file mode 100644
index 0000000000..45e410796b
@@ -0,0 +1,35 @@
+From 974378443bdaec7206370291ffafc08afa54cfbc Mon Sep 17 00:00:00 2001
+From: Marcus Hoffmann <[email protected]>
+Date: Wed, 4 Feb 2026 15:31:34 +0100
+Subject: [PATCH] src/meson.build: remove unused ncurses++ dependency
+
+Signed-off-by: Marcus Hoffmann <[email protected]>
+Upstream: https://github.com/raboof/nethogs/commit/92954b33067facb43fc783b4e9541d577e82f9d3
+---
+ src/meson.build | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/meson.build b/src/meson.build
+index 03f1b58..19788b3 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -24,7 +24,6 @@ if get_option('enable-nethogs-app').enabled()
+     ])
+   ]
+ 
+-  cursespp_dep = dependency('ncurses++', required: true)
+   curses_dep = dependency('ncurses', required: true)
+ 
+   executable('nethogs',
+@@ -33,7 +32,7 @@ if get_option('enable-nethogs-app').enabled()
+     cpp_args: c_args,
+     c_args: c_args,
+     install: true,
+-    dependencies : [project_deps, cursespp_dep, curses_dep]
++    dependencies : [project_deps, curses_dep]
+   )
+ endif
+ 
+-- 
+2.53.0
+
package/nethogs/0003-meson-fix-build-with-libnethogs-disabled.patch new file +41 -0

41 lines not on this page · raw message

package/nethogs/nethogs.mk +2 -9
index 74387d7397..773c769ff2 100644
@@ -9,13 +9,6 @@ NETHOGS_SITE = $(call github,raboof,nethogs,v$(NETHOGS_VERSION))
 NETHOGS_LICENSE = GPL-2.0+
 NETHOGS_LICENSE_FILES = COPYING
 NETHOGS_DEPENDENCIES = libpcap ncurses
+NETHOGS_CONF_OPTS += -Denable-libnethogs=disabled
 
-define NETHOGS_BUILD_CMDS
-	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) nethogs
-endef
-
-define NETHOGS_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/src/nethogs $(TARGET_DIR)/usr/sbin/nethogs
-endef
-
-$(eval $(generic-package))
+$(eval $(meson-package))
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot