git: f19e878e0cd5 - main - editors/imhex-current: Fix build error on 15-CURRENT

From: MANTANI Nobutaka <nobutaka_at_FreeBSD.org>
Date: Sat, 13 Apr 2024 18:58:21 UTC
The branch main has been updated by nobutaka:

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

commit f19e878e0cd5cb69ea68a977df2ffd545290c870
Author:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
AuthorDate: 2024-04-13 18:57:16 +0000
Commit:     MANTANI Nobutaka <nobutaka@FreeBSD.org>
CommitDate: 2024-04-13 18:57:16 +0000

    editors/imhex-current: Fix build error on 15-CURRENT
---
 editors/imhex-current/Makefile                               |  9 ++++++++-
 .../patch-lib_libimhex_include_hex_api_content__registry.hpp | 10 ++++++++++
 .../patch-lib_third__party_jthread_includes_jthread.hpp      | 12 ++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/editors/imhex-current/Makefile b/editors/imhex-current/Makefile
index 2de90cbe21c1..d4c251b1ab77 100644
--- a/editors/imhex-current/Makefile
+++ b/editors/imhex-current/Makefile
@@ -104,6 +104,11 @@ NLS_USES=	gettext
 IGNORE=	requires libc++ of LLVM 17 on the base system
 .endif
 
+# After LLVM 18 import into the base system
+.if (${OSVERSION} <= 1500018)
+CXXFLAGS+=	-fexperimental-library -D_LIBCPP_ENABLE_EXPERIMENTAL
+.endif
+
 post-extract:
 	${CP} -R ${WRKSRC_libromfs}/* ${WRKSRC}/lib/external/libromfs
 	${CP} -R ${WRKSRC_libwolv}/* ${WRKSRC}/lib/external/libwolv
@@ -115,13 +120,15 @@ post-extract:
 	${CP} -R ${WRKSRC_edlib}/* ${WRKSRC}/lib/third_party/edlib
 	${CP} -R ${WRKSRC_fmt}/* ${WRKSRC}/lib/third_party/fmt
 	${CP} -R ${WRKSRC_hashlibplus}/* ${WRKSRC}/lib/third_party/HashLibPlus
-	${CP} -R ${WRKSRC_jthread}/* ${WRKSRC}/lib/third_party/jthread
 	${CP} -R ${WRKSRC_nativefiledialog}/* ${WRKSRC}/lib/third_party/nativefiledialog
 	${CP} -R ${WRKSRC_yara}/* ${WRKSRC}/lib/third_party/yara/yara
 	${MKDIR} ${WRKDIR}/.build/_deps/imhex_patterns_src
 	${CP} -R ${WRKSRC_imhex_patterns}/* ${WRKDIR}/.build/_deps/imhex_patterns_src
 	${CP} -R ${WRKDIR}/imhex-bastion-pats-${GL_TAG_IMHEX_BASTION_PATS}/* ${WRKDIR}/.build/_deps/imhex_patterns_src/patterns/bastion
 	${CP} -R ${WRKDIR}/imhex-ffx-pats-${GL_TAG_IMHEX_FFX_PATS}/* ${WRKDIR}/.build/_deps/imhex_patterns_src/patterns/ffx
+.if (${OSVERSION} < 1500018)
+	${CP} -R ${WRKSRC_jthread}/* ${WRKSRC}/lib/third_party/jthread
+.endif
 
 post-patch:
 	${CP} -R ${WRKSRC}/lib/external/libwolv/* ${WRKSRC}/lib/external/pattern_language/external/libwolv
diff --git a/editors/imhex-current/files/patch-lib_libimhex_include_hex_api_content__registry.hpp b/editors/imhex-current/files/patch-lib_libimhex_include_hex_api_content__registry.hpp
new file mode 100644
index 000000000000..df20b533c0ee
--- /dev/null
+++ b/editors/imhex-current/files/patch-lib_libimhex_include_hex_api_content__registry.hpp
@@ -0,0 +1,10 @@
+--- lib/libimhex/include/hex/api/content_registry.hpp.orig	2024-04-13 11:25:28 UTC
++++ lib/libimhex/include/hex/api/content_registry.hpp
+@@ -6,6 +6,7 @@
+ 
+ #include <functional>
+ #include <map>
++#include <mutex>
+ #include <span>
+ #include <string>
+ #include <utility>
diff --git a/editors/imhex-current/files/patch-lib_third__party_jthread_includes_jthread.hpp b/editors/imhex-current/files/patch-lib_third__party_jthread_includes_jthread.hpp
new file mode 100644
index 000000000000..dfda843ed3ad
--- /dev/null
+++ b/editors/imhex-current/files/patch-lib_third__party_jthread_includes_jthread.hpp
@@ -0,0 +1,12 @@
+--- lib/third_party/jthread/includes/jthread.hpp.orig	2024-04-13 11:34:49 UTC
++++ lib/third_party/jthread/includes/jthread.hpp
+@@ -1,6 +1,8 @@
+ #pragma once
+ 
+-#if __cpp_lib_jthread >= 201911L
++#include <osreldate.h>
++
++#if __cpp_lib_jthread >= 201911L || __FreeBSD_version >= 1500018
+     #include <thread>
+ #else
+     #include "../jthread/source/jthread.hpp"