git: 0815295e0b79 - main - multimedia/pipewire: unbreak on FreeBSD < 13.2 after ea9c61f86374

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Wed, 11 Oct 2023 14:34:25 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0815295e0b7988daf05dc1665b4ff523c7083763

commit 0815295e0b7988daf05dc1665b4ff523c7083763
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-10-11 11:40:13 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-10-11 14:18:49 +0000

    multimedia/pipewire: unbreak on FreeBSD < 13.2 after ea9c61f86374
    
    In file included from ../src/modules/module-netjack2-manager.c:38:
    ../src/modules/module-netjack2/peer.c:2:10: fatal error: 'byteswap.h' file not found
     #include <byteswap.h>
              ^~~~~~~~~~~~
    
    PR:             273258
---
 .../files/patch-src_modules_module-netjack2_peer.c | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/multimedia/pipewire/files/patch-src_modules_module-netjack2_peer.c b/multimedia/pipewire/files/patch-src_modules_module-netjack2_peer.c
new file mode 100644
index 000000000000..c815c5c7b85b
--- /dev/null
+++ b/multimedia/pipewire/files/patch-src_modules_module-netjack2_peer.c
@@ -0,0 +1,23 @@
+Drop after FreeBSD 12.4 EOL around 2023-12-31.
+https://cgit.freebsd.org/src/commit/?id=1dd126163b94
+
+In file included from ../src/modules/module-netjack2-manager.c:38:
+../src/modules/module-netjack2/peer.c:2:10: fatal error: 'byteswap.h' file not found
+#include <byteswap.h>
+         ^~~~~~~~~~~~
+
+--- src/modules/module-netjack2/peer.c.orig	2023-10-06 09:37:06 UTC
++++ src/modules/module-netjack2/peer.c
+@@ -1,5 +1,12 @@
+ 
++#if __has_include(<byteswap.h>)
+ #include <byteswap.h>
++#else
++#include <sys/endian.h>
++#define bswap_16(x) bswap16(x)
++#define bswap_32(x) bswap32(x)
++#define bswap_64(x) bswap64(x)
++#endif
+ 
+ #ifdef HAVE_OPUS_CUSTOM
+ #include <opus/opus.h>