git: 143fa66a1a58 - main - www/nghttp2: Attempt to fix build on 13.2 and 14.0

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sat, 08 Jun 2024 10:29:38 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=143fa66a1a58f7c673e217c53dd5807075b72240

commit 143fa66a1a58f7c673e217c53dd5807075b72240
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-06-08 10:21:56 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-06-08 10:28:30 +0000

    www/nghttp2: Attempt to fix build on 13.2 and 14.0
    
    Attempt to fix build failure introduced in 1.62.0
    
    PR:             278965
    Approved by:    portmgr (blanket, build fix)
---
 www/nghttp2/Makefile                            | 11 +++++++++++
 www/nghttp2/files/extra-patch-compatibility-fix | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/www/nghttp2/Makefile b/www/nghttp2/Makefile
index cde21d14801d..54f0a124df23 100644
--- a/www/nghttp2/Makefile
+++ b/www/nghttp2/Makefile
@@ -43,6 +43,17 @@ HPACK_BUILD_DEPENDS=	jansson>=2.5:devel/jansson
 HPACK_CMAKE_BOOL=	ENABLE_HPACK_TOOLS
 HPACK_LIB_DEPENDS=	libjansson.so:devel/jansson
 
+.include <bsd.port.options.mk>
+
+.if ${OPSYS}_${OSREL:C/\\./-/} == FreeBSD_13-2
+USES+=	llvm
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-compatibility-fix
+.endif
+
+.if ${OPSYS}_${OSREL:C/\\./-/} == FreeBSD_14-0
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-compatibility-fix
+.endif
+
 post-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/etc/nghttpx/
 	${INSTALL_DATA} ${FILESDIR}/nghttpx.conf.sample ${STAGEDIR}${PREFIX}/etc/nghttpx/nghttpx.conf.sample
diff --git a/www/nghttp2/files/extra-patch-compatibility-fix b/www/nghttp2/files/extra-patch-compatibility-fix
new file mode 100644
index 000000000000..932cc6aebff9
--- /dev/null
+++ b/www/nghttp2/files/extra-patch-compatibility-fix
@@ -0,0 +1,11 @@
+--- src/template.h.orig	2024-06-08 10:06:50 UTC
++++ src/template.h
+@@ -444,7 +444,7 @@ inline constexpr bool operator==(const StringRef &lhs,
+          std::equal(std::begin(lhs), std::end(lhs), std::begin(rhs));
+ }
+ 
+-#ifndef __APPLE__
++#ifndef __FreeBSD__
+ inline constexpr std::strong_ordering
+ operator<=>(const StringRef &lhs, const StringRef &rhs) noexcept {
+   return std::lexicographical_compare_three_way(std::begin(lhs), std::end(lhs),