summaryrefslogtreecommitdiff
path: root/net-misc/iperf/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/iperf/files')
-rw-r--r--net-misc/iperf/files/iperf-3.12-Unbundle-cJSON.patch109
-rw-r--r--net-misc/iperf/files/iperf-3.12-fix-bashism.patch43
2 files changed, 152 insertions, 0 deletions
diff --git a/net-misc/iperf/files/iperf-3.12-Unbundle-cJSON.patch b/net-misc/iperf/files/iperf-3.12-Unbundle-cJSON.patch
new file mode 100644
index 000000000000..c5b1b49ec1a7
--- /dev/null
+++ b/net-misc/iperf/files/iperf-3.12-Unbundle-cJSON.patch
@@ -0,0 +1,109 @@
+From 85b225cdd00b9a483a603b8b124a829ffbf92b88 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 2 Oct 2022 03:07:40 +0100
+Subject: [PATCH] Unbundle cJSON
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,6 +62,8 @@ AC_ARG_ENABLE([profiling],
+ AS_HELP_STRING([--enable-profiling], [Enable iperf3 profiling binary]))
+ AM_CONDITIONAL([ENABLE_PROFILING], [test x$enable_profiling = xyes])
+
++PKG_CHECK_MODULES([libcjson], [libcjson >= 1.7.15])
++
+ # Check for the math library (needed by cjson on some platforms)
+ AC_SEARCH_LIBS(floor, [m], [], [
+ echo "floor()"
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -10,8 +10,6 @@ include_HEADERS = iperf_api.h # Define
+
+ # Specify the source files and flags for the iperf library
+ libiperf_la_SOURCES = \
+- cjson.c \
+- cjson.h \
+ flowlabel.h \
+ iperf.h \
+ iperf_api.c \
+@@ -44,10 +42,13 @@ libiperf_la_SOURCES = \
+ units.c \
+ units.h \
+ version.h
++libiperf_la_CPPFLAGS = $(CPPFLAGS) @libcjson_CFLAGS@
++libiperf_la_LIBADD = @libcjson_LIBS@
+
+ # Specify the sources and various flags for the iperf binary
+ iperf3_SOURCES = main.c
+-iperf3_LDADD = libiperf.la
++iperf3_CPPFLAGS = $(CPPFLAGS) @libcjson_CFLAGS@
++iperf3_LDADD = libiperf.la @libcjson_LIBS@
+
+ if ENABLE_PROFILING
+ # If the iperf-profiled-binary is enabled
+--- a/src/iperf.h
++++ b/src/iperf.h
+@@ -65,7 +65,7 @@
+
+ #include "timer.h"
+ #include "queue.h"
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+ #include "iperf_time.h"
+
+ #if defined(HAVE_SSL)
+--- a/src/iperf_api.c
++++ b/src/iperf_api.c
+@@ -81,7 +81,7 @@
+ #endif /* HAVE_SCTP_H */
+ #include "timer.h"
+
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+ #include "units.h"
+ #include "iperf_util.h"
+ #include "iperf_locale.h"
+--- a/src/iperf_tcp.c
++++ b/src/iperf_tcp.c
+@@ -42,7 +42,7 @@
+ #include "iperf_api.h"
+ #include "iperf_tcp.h"
+ #include "net.h"
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+
+ #if defined(HAVE_FLOWLABEL)
+ #include "flowlabel.h"
+--- a/src/iperf_udp.c
++++ b/src/iperf_udp.c
+@@ -46,7 +46,7 @@
+ #include "iperf_udp.h"
+ #include "timer.h"
+ #include "net.h"
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+ #include "portable_endian.h"
+
+ #if defined(HAVE_INTTYPES_H)
+--- a/src/iperf_util.c
++++ b/src/iperf_util.c
+@@ -46,7 +46,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+ #include "iperf.h"
+ #include "iperf_api.h"
+
+--- a/src/iperf_util.h
++++ b/src/iperf_util.h
+@@ -28,7 +28,7 @@
+ #define __IPERF_UTIL_H
+
+ #include "iperf_config.h"
+-#include "cjson.h"
++#include <cjson/cJSON.h>
+ #include <sys/select.h>
+ #include <stddef.h>
+
diff --git a/net-misc/iperf/files/iperf-3.12-fix-bashism.patch b/net-misc/iperf/files/iperf-3.12-fix-bashism.patch
new file mode 100644
index 000000000000..1f3a321f42c9
--- /dev/null
+++ b/net-misc/iperf/files/iperf-3.12-fix-bashism.patch
@@ -0,0 +1,43 @@
+https://github.com/esnet/iperf/pull/1398
+
+From 3a03f775ca103f2e824abef903130280c57ca8ac Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 2 Oct 2022 02:58:59 +0100
+Subject: [PATCH] config/iperf_config_static_bin.m4: fix bashism
+
+configure scripts need to be runnable with a POSIX-compliant /bin/sh.
+
+On many (but not all!) systems, /bin/sh is provided by Bash, so errors
+like this aren't spotted. Notably Debian defaults to /bin/sh provided
+by dash which doesn't tolerate such bashisms as '=='.
+
+This retains compatibility with bash.
+
+Fixes configure warnings/errors like:
+```
+./configure: 2670: test: x: unexpected operator
+```
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/config/iperf_config_static_bin.m4
++++ b/config/iperf_config_static_bin.m4
+@@ -7,6 +7,6 @@ AC_ARG_ENABLE([static-bin],
+ [:])
+ AM_CONDITIONAL([ENABLE_STATIC_BIN], [test x$enable_static_bin = xno])
+
+-AS_IF([test "x$enable_static_bin" == xyes],
++AS_IF([test "x$enable_static_bin" = xyes],
+ [LDFLAGS="$LDFLAGS --static"]
+ [])
+--- a/configure
++++ b/configure
+@@ -2667,7 +2667,7 @@ else
+ fi
+
+
+-if test "x$enable_static_bin" == xyes
++if test "x$enable_static_bin" = xyes
+ then :
+ LDFLAGS="$LDFLAGS --static"
+
+