pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

suricata: add support for unittest, debug and profiling options, compile fix



Module Name:	pkgsrc-wip
Committed By:	kami <kisskamizeg%gmail.com@localhost>
Pushed By:	kami
Date:		Fri Sep 26 22:48:00 2025 +0200
Changeset:	1be0ea44857f297fe30a229bf38388e45867bf50

Modified Files:
	suricata/Makefile
	suricata/distinfo
Added Files:
	suricata/patches/patch-src_util-affinity.c

Log Message:
suricata: add support for unittest, debug and profiling options, compile fix

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1be0ea44857f297fe30a229bf38388e45867bf50

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 suricata/Makefile                          | 20 ++++++++++++++++++--
 suricata/distinfo                          |  1 +
 suricata/patches/patch-src_util-affinity.c | 23 +++++++++++++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

diffs:
diff --git a/suricata/Makefile b/suricata/Makefile
index 0b1dc71dc1..7d018fb958 100644
--- a/suricata/Makefile
+++ b/suricata/Makefile
@@ -21,11 +21,27 @@ USE_TOOLS+=		pkg-config
 
 USE_LANGUAGES=		c c++
 
-LIBS.NetBSD+= -lm
+LIBS.NetBSD+=		 -lm
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.suricata
+PKG_SUPPORTED_OPTIONS=	enable-unittests enable-debug enable-profiling
+#PKG_SUGGESTED_OPTIONS=
 
 .include "../../mk/bsd.prefs.mk"
 
-#.include "options.mk"
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Menable-unittests)
+CONFIGURE_ARGS+=	--enable-unittests
+.endif
+
+.if !empty(PKG_OPTIONS:Menable-debug)
+CONFIGURE_ARGS+=	--enable-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Menable-profiling)
+CONFIGURE_ARGS+=	--enable-profiling
+.endif
 
 .include "../../devel/pcre2/buildlink3.mk"
 .include "../../textproc/libyaml/buildlink3.mk"
diff --git a/suricata/distinfo b/suricata/distinfo
index ecdc83bfa1..f52a21cf42 100644
--- a/suricata/distinfo
+++ b/suricata/distinfo
@@ -7,6 +7,7 @@ SHA1 (patch-configure) = 379edddcef392fecd2d1f3cb2a66b2223a0fca33
 SHA1 (patch-src_threads.h) = bd3764e1ac575d2b2c7b6b88ea2dbd93c3c5a4cb
 SHA1 (patch-src_tm-threads.c) = cf2e747c3c26f72844184baf8dbdbf1aa9407665
 SHA1 (patch-src_unix-manager.c) = d5e64cff26de3865c0939383aa72011dd1cbf8d2
+SHA1 (patch-src_util-affinity.c) = eae96313d1f1978836373d2db19aca5507d6bdc4
 SHA1 (patch-src_util-affinity.h) = a5ede16436ae6b1d28615726bf8afa4a94159694
 SHA1 (patch-src_util-byte.h) = 2f4dd27b60eccc55a684d513765346bdbd120552
 SHA1 (patch-src_util-fmemopen.c) = 49e52146820ff96dc6f257b1a348bf1805eed25b
diff --git a/suricata/patches/patch-src_util-affinity.c b/suricata/patches/patch-src_util-affinity.c
new file mode 100644
index 0000000000..b4c0dd1433
--- /dev/null
+++ b/suricata/patches/patch-src_util-affinity.c
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- src/util-affinity.c.orig	2025-09-16 02:07:13.000000000 +0000
++++ src/util-affinity.c
+@@ -35,6 +35,18 @@
+ #include "util-dpdk.h"
+ #include "util-unittest.h"
+ 
++#if defined __NetBSD_ && defined UNITTESTS
++int cpuCount(cpu_set_t *cset) {
++  int c = 0;
++  for (int i = 0; i < MAX_CPU_SET; i++) {
++    if(cpuset_isset(0, *cset) > 0) c++;
++  }
++  return c;
++}
++
++#define CPU_COUNT(cset) (cpuCount(cset))
++#endif
++
+ ThreadsAffinityType thread_affinity[MAX_CPU_SET] = {
+     {
+             .name = "receive-cpu-set",


Home | Main Index | Thread Index | Old Index