Tuesday, January 02, 2024

Re: amnesia-tdd, crack-attack, manaplus vs libcxx update

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/manaplus/Makefile,v
retrieving revision 1.106
diff -u -p -r1.106 Makefile
--- Makefile 26 Sep 2023 09:41:38 -0000 1.106
+++ Makefile 2 Jan 2024 14:48:33 -0000
@@ -1,5 +1,5 @@
V = 2.1.3.17
-REVISION = 1
+REVISION = 2
COMMENT = client for The Mana World
DISTNAME = manaplus-${V}
EXTRACT_SUFX = .tar.xz
Index: patches/patch-src_utils_dtor_h
===================================================================
RCS file: patches/patch-src_utils_dtor_h
diff -N patches/patch-src_utils_dtor_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_utils_dtor_h 2 Jan 2024 14:48:33 -0000
@@ -0,0 +1,24 @@
+C++17 compliance
+
+Index: src/utils/dtor.h
+--- src/utils/dtor.h.orig
++++ src/utils/dtor.h
+@@ -30,7 +30,7 @@
+ #include "localconsts.h"
+
+ template<typename T>
+-struct dtor final : public std::unary_function <T, void>
++struct dtor final
+ {
+ A_DEFAULT_COPY(dtor)
+
+@@ -39,8 +39,7 @@ struct dtor final : public std::unary_function <T, voi
+ };
+
+ template<typename T1, typename T2>
+-struct dtor<std::pair<T1, T2> > :
+-public std::unary_function <std::pair<T1, T2>, void>
++struct dtor<std::pair<T1, T2> >
+ {
+ void operator()(std::pair<T1, T2> &pair)
+ { delete pair.second; }
On 1/2/2024 7:45 AM, Theo Buehler wrote:
> On Tue, Jan 02, 2024 at 11:13:58AM +0100, Theo Buehler wrote:
>> The following games will no longer build once robert updates libcxx and
>> friends because they use std::unary_function or std::binary_function,
>> which were deprecated in C++11 and removed in C++17.
>>
>> An ugly workaround is to re-enable these to fix the build as in the diff
>> below. Another ugly workaround is to switch to a build with C++ <= 14.
>>
>> Please check if upstream has fixed this already and do either one of
>> 1. update the port
>> 2. backport the fix
>> 3. remove the annotations in the affected functions and test
>> 4. if you don't like the below, figure out a better fix.
>>
>> Thanks
>
> Index: games/manaplus/Makefile
> ===================================================================
> RCS file: /cvs/ports/games/manaplus/Makefile,v
> diff -u -p -r1.106 Makefile
> --- games/manaplus/Makefile 26 Sep 2023 09:41:38 -0000 1.106
> +++ games/manaplus/Makefile 2 Jan 2024 10:03:56 -0000
> @@ -41,6 +41,8 @@ CONFIGURE_ARGS = --without-librt \
> --with-sdl2 \
> --without-internalsdlgfx
>
> +CXXFLAGS += -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
> +
> FAKE_FLAGS += desktopdir=${PREFIX}/share/applications/
>
> AUTOCONF_VERSION = 2.69
>

For manaplus, the unary_function bits can simply be removed.

OK?

~Brian

No comments:

Post a Comment