1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-24 09:25:01 +00:00

games/openenroth: unbreak the port's build in pre-C++20 environments

Pull Clang 13 when it's not available in the base (via USES+=llvm:13)
and use Boost's ``unordered_map'' implementation while the system one
is insufficient; avoid ``std::u8string'' for the same reason.

Set LLD_UNSAFE to unbreak linking against OpenAL on i386 (ld: error:
cannot preempt symbol: alGetError).

While here, slightly wordsmith the installation message.

Reported by:	pkg-fallout
This commit is contained in:
Alexey Dokuchaev 2023-02-04 15:10:00 +00:00
parent 1aa477cd02
commit 84ba2383e7
2 changed files with 22 additions and 3 deletions

View File

@ -28,6 +28,18 @@ GH_SUBDIR= thirdparty/cli11:cli11 thirdparty/fast_float:ff \
thirdparty/magic_enum:me thirdparty/mini:mini \
thirdparty/nlohmann_json:nj
.include <bsd.port.options.mk>
.if !exists(/usr/include/c++/v1/concepts)
BUILD_DEPENDS+= ${LOCALBASE}/include/boost/unordered_map.hpp:devel/boost-libs
USES+= llvm:13
CXX= ${LLVM_PREFIX}/bin/clang++
.endif
.if ${ARCH} == i386
LLD_UNSAFE= yes
.endif
post-patch:
@${REINPLACE_CMD} -e '/CMAKE_CXX_STANDARD/s,23,20,' \
${WRKSRC}/CMakeLists.txt
@ -40,6 +52,13 @@ post-patch:
${WRKSRC}/src/Utility/CMakeLists.txt
@${REINPLACE_CMD} -e 's, c++abi,,' \
${WRKSRC}/thirdparty/luajit/cmake/src/CMakeLists.txt
.if !exists(/usr/include/c++/v1/concepts)
@${REINPLACE_CMD} -e '/#include/s,unordered_map,boost/&.hpp,' \
-e 's,std::unordered_map,boost::unordered_map,' \
${WRKSRC}/src/Library/Serialization/EnumSerializer.h
@${REINPLACE_CMD} -e '/#ifdef/s,ANDROID,${OPSYS},' \
${WRKSRC}/src/Utility/FileSystem.cpp
.endif
do-install:
${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/OpenEnroth \

View File

@ -1,12 +1,12 @@
[
{ type: install
message: <<EOM
OpenEnroth requires original or GoG version of Might and Magic VII
OpenEnroth requires original or GOG version of Might and Magic VII
game assets available in the current directory or the path pointed
by the OPENENROTH_MM7_PATH environment variable.
Additionally, then you would have to copy (or create symbolic link
to) the `%%DATADIR%%/shaders' directory there.
Additionally, you would have to copy (or create a symbolic link to)
the `%%DATADIR%%/shaders' directory there.
EOM
}
]