Files
gentoo/net-analyzer/nethogs/files/nethogs-0.8.8-meson.patch
Sam James 769c936892 net-analyzer/nethogs: add 0.8.8
Signed-off-by: Sam James <sam@gentoo.org>
2025-01-25 16:09:41 +00:00

86 lines
2.7 KiB
Diff

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