git: c911bdba1d80 - 2023Q1 - emulators/yuzu: unbreak build after 3eff87c4dc8d

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 04 Feb 2023 13:14:50 UTC
The branch 2023Q1 has been updated by jbeich:

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

commit c911bdba1d80ed72bd3ee70abf0389601c9e7440
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-02-04 12:59:50 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-02-04 13:09:45 +0000

    emulators/yuzu: unbreak build after 3eff87c4dc8d
    
    Boost 1.80 seems to be incompatible with libc++ 16. As ebbef4b5f84b is
    slated for 2023Q2 downgrade 2023Q1 to the last good snapshot.
    
    In file included from externals/dynarmic/src/dynarmic/ir/ir_emitter.cpp:6:
    In file included from externals/dynarmic/src/dynarmic/../dynarmic/ir/ir_emitter.h:11:
    In file included from externals/dynarmic/src/dynarmic/../dynarmic/ir/basic_block.h:18:
    In file included from externals/dynarmic/src/dynarmic/../dynarmic/ir/terminal.h:8:
    In file included from /usr/local/include/boost/variant.hpp:17:
    In file included from /usr/local/include/boost/variant/variant.hpp:21:
    In file included from /usr/local/include/boost/type_index.hpp:29:
    In file included from /usr/local/include/boost/type_index/stl_type_index.hpp:47:
    /usr/local/include/boost/container_hash/hash.hpp:132:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
            struct hash_base : std::unary_function<T, std::size_t> {};
                               ~~~~~^
    libcxx_prefix/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
    using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
    ^
    
    Reported by:    pkg-fallout
    
    This reverts commit 29a004faf6639fcf3028177b0e32c4fa1312fd45.
    This reverts commit 10fa39ec869df8f056ffee0e3cf50c84a28cfdab.
    This reverts commit 787091ab9135602e2be137ddf10b1fbe467ea091.
    This reverts commit 41bd9b325c3908523790d8a77f4a8c194b04eb86.
    This reverts commit 3eff87c4dc8d063ac99abb4569c90a20291cbfd5.
---
 emulators/yuzu/Makefile             | 22 +++++++---------------
 emulators/yuzu/distinfo             | 14 +++++++-------
 emulators/yuzu/files/patch-libc++13 | 13 +++++++++++++
 3 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/emulators/yuzu/Makefile b/emulators/yuzu/Makefile
index 204f177cf709..e0facfe1669b 100644
--- a/emulators/yuzu/Makefile
+++ b/emulators/yuzu/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	yuzu
-PORTVERSION=	s20230203
+PORTVERSION=	s20230130
 CATEGORIES=	emulators wayland
 .if make(makesum)
 MASTER_SITES=	https://api.yuzu-emu.org/gamedb/?dummy=/:gamedb
@@ -53,7 +53,7 @@ qt6_OPTIONS_EXCLUDE=	QT5
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	yuzu-emu
-GH_TAGNAME=	5aca9386c
+GH_TAGNAME=	ed4a88bd9
 GH_TUPLE=	yuzu-emu:mbedtls:v2.16.9-115-g8c88150ca:mbedtls/externals/mbedtls \
 		yuzu-emu:sirit:ab75463:sirit/externals/sirit \
 		KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-201-gc214f6f:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
@@ -71,6 +71,7 @@ CMAKE_ON+=	BUNDLE_SPEEX # only used by cubeb tests
 CMAKE_OFF=	YUZU_CHECK_SUBMODULES YUZU_USE_EXTERNAL_SDL2 YUZU_USE_EXTERNAL_VULKAN_HEADERS
 CMAKE_OFF+=	${CMAKE_TESTING_ON}
 CMAKE_TESTING_ON=	YUZU_TESTS
+CXXFLAGS+=	-D_LIBCPP_HAS_NO_INCOMPLETE_RANGES # common/polyfill_ranges.h
 LDFLAGS+=	-Wl,--as-needed # Qt5Network
 ELF_FEATURES=	${PLIST_FILES:Mbin/*:S/^/+wxneeded:/}
 PLIST_FILES=	bin/${PORTNAME}-cmd \
@@ -150,26 +151,17 @@ post-patch-VAAPI-off:
 	@${REINPLACE_CMD} -i .nova '/pkg_check.*libva/d' \
 		${WRKSRC}/CMakeLists.txt
 
-# XXX Drop after FreeBSD 13.2 EOL around 2024-05-01 (don't forget distinfo)
-.if !exists(/usr/include/c++/v1/__ranges/as_rvalue_view.h) || make(makesum) || make(fetch)
-. if !exists(/usr/include/c++/v1/__memory/concepts.h)
-USES+=		llvm:min=14,build
-CC=		clang${LLVM_VERSION}
-CXX=		clang++${LLVM_VERSION}
-CPP=		clang-cpp${LLVM_VERSION}
-CONFIGURE_ENV+=	CC="${CC}" CXX="${CXX}" CPP="${CPP}"
-. endif
-
+# libc++ >= 14 defines std::ranges outside -D_LIBCPP_HAS_NO_INCOMPLETE_RANGES
+.if exists(/usr/include/c++/v1/__memory/concepts.h)
 # XXX Move into separate port and standardize via USES
-GH_TUPLE+=	llvm:llvm-project:llvmorg-16.0.0-rc1:libcxx
+GH_TUPLE+=	llvm:llvm-project:llvmorg-13.0.1:libcxx
 CXXFLAGS+=	-nostdinc++ -isystem${WRKDIR}/libcxx_prefix/include/c++/v1
-# Don't link against new libc++ to avoid ABI mismatch in Qt
+# Don't link against old libc++ to avoid ABI mismatch in Qt
 #LDFLAGS+=	-nostdlib++ -L${WRKDIR}/libcxx_prefix/lib -l:libc++.a -lcxxrt
 
 pre-configure:	bundled-libcxx
 bundled-libcxx:
 	@${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS:M*Ninja*} \
-		-DLIBCXX_INCLUDE_BENCHMARKS:BOOL=OFF \
 		-DCMAKE_INSTALL_PREFIX:PATH=${WRKDIR}/libcxx_prefix \
 		-B ${WRKDIR}/libcxx_build -S ${WRKSRC_libcxx}/libcxx
 	@${DO_MAKE_BUILD:NDESTDIR*} install -C ${WRKDIR}/libcxx_build
diff --git a/emulators/yuzu/distinfo b/emulators/yuzu/distinfo
index 4697c6243c7f..e967daffaf40 100644
--- a/emulators/yuzu/distinfo
+++ b/emulators/yuzu/distinfo
@@ -1,8 +1,8 @@
-TIMESTAMP = 1675469369
-SHA256 (yuzu-s20230203/compatibility_list.json) = 1293b9d395aca23bcfbb7f694010faa080365250f989774d5f53ca9b99936ecf
-SIZE (yuzu-s20230203/compatibility_list.json) = 1709794
-SHA256 (yuzu-emu-yuzu-s20230203-5aca9386c_GH0.tar.gz) = e528857dfcc95cffdc14997e08e28a693173fd19515ed911c6ab1c17006ce2f3
-SIZE (yuzu-emu-yuzu-s20230203-5aca9386c_GH0.tar.gz) = 5536286
+TIMESTAMP = 1675109829
+SHA256 (yuzu-s20230130/compatibility_list.json) = 5bd5471a62b068400a98f1101cbcf66b3d6fe6b2cdf0988b8830642d65e3b66f
+SIZE (yuzu-s20230130/compatibility_list.json) = 1701739
+SHA256 (yuzu-emu-yuzu-s20230130-ed4a88bd9_GH0.tar.gz) = 9ff59f5a03e240dded3a5df03ddecfaa10896277ec575084110f9e48b182154b
+SIZE (yuzu-emu-yuzu-s20230130-ed4a88bd9_GH0.tar.gz) = 5505973
 SHA256 (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 8cd6d075b4da0ad5fb995eb37390e2e6088be8d41ab1cdfc7e7e4256bd991450
 SIZE (yuzu-emu-mbedtls-v2.16.9-115-g8c88150ca_GH0.tar.gz) = 2679189
 SHA256 (yuzu-emu-sirit-ab75463_GH0.tar.gz) = 6b61e265be182b7a78075fc1b98ccf80fd33008343205dd0e22a10a439c45319
@@ -21,7 +21,7 @@ SHA256 (kinetiknz-cubeb-cubeb-0.2-1350-gf79e0cf_GH0.tar.gz) = 8629757290774a34ed
 SIZE (kinetiknz-cubeb-cubeb-0.2-1350-gf79e0cf_GH0.tar.gz) = 220847
 SHA256 (yhirose-cpp-httplib-v0.10.8-1-g305a7ab_GH0.tar.gz) = 2b8ebbe60c5fab1254e454518108cb8da5ee3a07e1cf9f432448d985efe4a003
 SIZE (yhirose-cpp-httplib-v0.10.8-1-g305a7ab_GH0.tar.gz) = 620778
-SHA256 (llvm-llvm-project-llvmorg-16.0.0-rc1_GH0.tar.gz) = 724d4d38bb5d70c5f8cb6020d0aea517c2e93e82502bc2182f1e38d2ff6ee438
-SIZE (llvm-llvm-project-llvmorg-16.0.0-rc1_GH0.tar.gz) = 180322198
+SHA256 (llvm-llvm-project-llvmorg-13.0.1_GH0.tar.gz) = 09c50d558bd975c41157364421820228df66632802a4a6a7c9c17f86a7340802
+SIZE (llvm-llvm-project-llvmorg-13.0.1_GH0.tar.gz) = 147290251
 SHA256 (c17d71240b23.patch) = 4aaf5522ec3f7d393cec59638220d6142489c4e946060ec94444ca3f47e2b2a7
 SIZE (c17d71240b23.patch) = 7562
diff --git a/emulators/yuzu/files/patch-libc++13 b/emulators/yuzu/files/patch-libc++13
new file mode 100644
index 000000000000..c37d22530975
--- /dev/null
+++ b/emulators/yuzu/files/patch-libc++13
@@ -0,0 +1,13 @@
+https://github.com/merryhime/dynarmic/pull/742
+
+--- externals/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_table_lookup.cpp.orig	2023-01-15 02:29:49 UTC
++++ externals/dynarmic/src/dynarmic/frontend/A64/translate/impl/simd_table_lookup.cpp
+@@ -3,6 +3,8 @@
+  * SPDX-License-Identifier: 0BSD
+  */
+ 
++#include <vector>
++
+ #include "dynarmic/frontend/A64/translate/impl/impl.h"
+ 
+ namespace Dynarmic::A64 {