head 1.10; access; symbols pkgsrc-2024Q3:1.9.0.2 pkgsrc-2024Q3-base:1.9 pkgsrc-2024Q2:1.6.0.8 pkgsrc-2024Q2-base:1.6 pkgsrc-2024Q1:1.6.0.6 pkgsrc-2024Q1-base:1.6 pkgsrc-2023Q4:1.6.0.4 pkgsrc-2023Q4-base:1.6 pkgsrc-2023Q3:1.6.0.2 pkgsrc-2023Q3-base:1.6 pkgsrc-2023Q2:1.4.0.16 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.14 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.12 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.10 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.8 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.6 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.4 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.2 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.3.0.6 pkgsrc-2021Q2-base:1.3 pkgsrc-2021Q1:1.3.0.4 pkgsrc-2021Q1-base:1.3 pkgsrc-2020Q4:1.3.0.2 pkgsrc-2020Q4-base:1.3 pkgsrc-2020Q3:1.2.0.6 pkgsrc-2020Q3-base:1.2 pkgsrc-2020Q2:1.2.0.4 pkgsrc-2020Q2-base:1.2 pkgsrc-2020Q1:1.2.0.2 pkgsrc-2020Q1-base:1.2 pkgsrc-2019Q4:1.1.0.6 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.2 pkgsrc-2019Q3-base:1.1; locks; strict; comment @// @; 1.10 date 2024.11.16.01.57.06; author ktnb; state dead; branches; next 1.9; commitid N8rUqN8cVoVtoOxF; 1.9 date 2024.09.09.07.46.20; author nia; state Exp; branches; next 1.8; commitid 9Pfw0stb2VUMv6pF; 1.8 date 2024.08.23.10.08.24; author nia; state Exp; branches; next 1.7; commitid h1IH3tfyts1nQVmF; 1.7 date 2024.08.13.14.45.28; author ktnb; state Exp; branches; next 1.6; commitid x7qfnP8ZhAPkHFlF; 1.6 date 2023.08.28.07.01.29; author nia; state Exp; branches; next 1.5; commitid X9J12E5ch9EHpwCE; 1.5 date 2023.08.18.10.51.52; author pin; state dead; branches; next 1.4; commitid eBeUaZI3iClB0gBE; 1.4 date 2021.09.15.12.20.15; author nia; state Exp; branches; next 1.3; commitid Hnz1j6LcLsMV339D; 1.3 date 2020.12.01.13.16.26; author nia; state Exp; branches; next 1.2; commitid vpxRbVfcfiYcD2yC; 1.2 date 2020.02.18.16.46.51; author joerg; state Exp; branches; next 1.1; commitid 6u9J91DYsZkn1bXB; 1.1 date 2019.06.30.22.27.22; author nia; state Exp; branches; next ; commitid EX2zT976XYdsogtB; desc @@ 1.10 log @luanti: update to 5.10.0 Packaging changes: - games/minetest -> games/luanti - made myself (ktnb) maintainer Upstream changes: - name change - many updates to the client and scripting parts https://dev.minetest.net/Changelog#5.9.1_.E2.86.92_5.10.0 @ text @$NetBSD: patch-src_util_string.cpp,v 1.9 2024/09/09 07:46:20 nia Exp $ Support non-POSIX iconv on NetBSD before 10 and SunOS. --- src/util/string.cpp.orig 2024-08-11 15:54:55.000000000 +0000 +++ src/util/string.cpp @@@@ -39,6 +39,13 @@@@ with this program; if not, write to the #include #endif +#if defined(__NetBSD__) +#include +#if __NetBSD_Prereq__(9,99,17) +#define NETBSD_POSIX_ICONV 1 +#endif +#endif + #ifndef _WIN32 namespace { @@@@ -77,7 +84,11 @@@@ static bool convert(iconv_t cd, char *ou const size_t old_outbuf_size = *outbuf_size; size_t old_size = inbuf_size; while (inbuf_size > 0) { +#if (defined(__NetBSD__) && !defined(NETBSD_POSIX_ICONV)) || defined(__sun) + iconv(cd, (const char **)&inbuf_ptr, &inbuf_size, &outbuf_ptr, outbuf_size); +#else iconv(cd, &inbuf_ptr, &inbuf_size, &outbuf_ptr, outbuf_size); +#endif if (inbuf_size == old_size) { return false; } @ 1.9 log @minetest: Fix typo in patch. @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.7 2024/08/13 14:45:28 ktnb Exp $ @ 1.8 log @minetest: Fix iconv patch broken in previous update @ text @d26 1 a26 1 + iconv(cd, (const char *)&inbuf_ptr, &inbuf_size, &outbuf_ptr, outbuf_size); @ 1.7 log @Fixed issue with patch and luaJIT @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.6 2023/08/28 07:01:29 nia Exp $ d7 1 a7 1 @@@@ -39,6 +39,15 @@@@ with this program; if not, write to the a14 2 +#else +#define NETBSD_POSIX_ICONV 0 d21 12 @ 1.6 log @minetest: Fix build on NetBSD 9. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- src/util/string.cpp.orig 2023-04-08 16:04:52.000000000 +0000 d22 1 a22 13 static bool convert(const char *to, const char *from, char *outbuf, @@@@ -54,7 +63,11 @@@@ static bool convert(const char *to, cons const size_t old_outbuf_size = *outbuf_size; size_t old_size = inbuf_size; while (inbuf_size > 0) { +#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun) + iconv(cd, (const char **)&inbuf_ptr, inbuf_left_ptr, &outbuf_ptr, outbuf_size); +#else iconv(cd, &inbuf_ptr, inbuf_left_ptr, &outbuf_ptr, outbuf_size); +#endif if (inbuf_size == old_size) { iconv_close(cd); return false; @ 1.5 log @games/minetest: fix messed-up patches @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.4 2021/09/15 12:20:15 nia Exp $ d3 1 a3 2 NetBSD does not support iconv("UTF-8", "WCHAR_T"), so use UTF-32, as on Android. d5 1 a5 1 --- src/util/string.cpp.orig 2021-04-10 16:41:12.000000000 +0000 d7 1 a7 1 @@@@ -39,9 +39,14 @@@@ with this program; if not, write to the d11 10 a20 41 -#if defined(_ICONV_H_) && (defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) || defined(__DragonFly__)) - #define BSD_ICONV_USED +#ifdef __NetBSD__ +# include +# if __NetBSD_Version__ <= 999001500 +# define BSD_ICONV_USED +# endif +#elif defined(_ICONV_H_) && (defined(__FreeBSD__) || \ + defined(__OpenBSD__) || defined(__DragonFly__)) +# define BSD_ICONV_USED #endif static bool parseHexColorString(const std::string &value, video::SColor &color, @@@@ -80,9 +85,17 @@@@ static bool convert(const char *to, cons return true; } -#ifdef __ANDROID__ +#if defined(__ANDROID__) // On Android iconv disagrees how big a wchar_t is for whatever reason const char *DEFAULT_ENCODING = "UTF-32LE"; +#elif defined(__NetBSD__) +// NetBSD does not support WCHAR_T as an argument to iconv +#include +# if BYTE_ORDER == LITTLE_ENDIAN +const char *DEFAULT_ENCODING = "UTF-32LE"; +# else +const char *DEFAULT_ENCODING = "UTF-32BE"; +# endif #else const char *DEFAULT_ENCODING = "WCHAR_T"; #endif @@@@ -98,7 +111,7 @@@@ std::wstring utf8_to_wide(const std::str std::wstring out; out.resize(outbuf_size / sizeof(wchar_t)); -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__NetBSD__) SANITY_CHECK(sizeof(wchar_t) == 4); #endif d22 13 @ 1.4 log @minetest: update to 5.4.1 Changes: https://dev.minetest.net/Changelog#5.3.0_.E2.86.92_5.4.0 @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.3 2020/12/01 13:16:26 nia Exp $ @ 1.3 log @minetest: Update to 5.3.0 Changelog: https://dev.minetest.net/Changelog#5.2.0_.E2.86.92_5.3.0 @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.2 2020/02/18 16:46:51 joerg Exp $ d6 1 a6 1 --- src/util/string.cpp.orig 2020-07-09 20:04:20.000000000 +0000 d8 1 a8 1 @@@@ -38,9 +38,11 @@@@ with this program; if not, write to the d20 3 d26 7 a32 3 @@@@ -82,6 +84,13 @@@@ bool convert(const char *to, const char #ifdef __ANDROID__ // Android need manual caring to support the full character set possible with wchar_t d35 1 d45 3 a47 3 @@@@ -97,7 +106,7 @@@@ std::wstring utf8_to_wide(const std::str char *outbuf = new char[outbuf_size]; memset(outbuf, 0, outbuf_size); a50 1 // Android need manual caring to support the full character set possible with wchar_t a52 10 @@@@ -209,7 +218,7 @@@@ wchar_t *narrow_to_wide_c(const char *st } std::wstring narrow_to_wide(const std::string &mbs) { -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__NetBSD__) return utf8_to_wide(mbs); #else size_t wcl = mbs.size(); @@@@ -225,7 +234,7 @@@@ std::wstring narrow_to_wide(const std::s a53 7 std::string wide_to_narrow(const std::wstring &wcs) { -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__NetBSD__) return wide_to_utf8(wcs); #else size_t mbl = wcs.size() * 4; @ 1.2 log @Fix iconv fallout on NetBSD. @ text @d1 1 a1 1 $NetBSD: patch-src_util_string.cpp,v 1.1 2019/06/30 22:27:22 nia Exp $ d3 2 a4 1 Work around iconv("UTF-8", "WCHAR_T") failing on NetBSD. d6 1 a6 1 --- src/util/string.cpp.orig 2019-10-12 13:48:58.000000000 +0000 d23 17 a39 3 @@@@ -79,6 +81,12 @@@@ bool convert(const char *to, const char return true; } d41 6 a46 12 +#ifdef __NetBSD__ +std::wstring utf8_to_wide(const std::string &input) +{ + return narrow_to_wide(input); +} +#else std::wstring utf8_to_wide(const std::string &input) { size_t inbuf_size = input.length() + 1; @@@@ -104,8 +112,9 @@@@ std::wstring utf8_to_wide(const std::str return out; a47 1 +#endif d49 1 d52 6 a57 2 // TODO: this is an ugly fix for wide_to_utf8 somehow not working on android std::string wide_to_utf8(const std::wstring &input) d59 5 @ 1.1 log @Add minetest-5.0.1 as games/minetest. Minetest is an infinite-world block sandbox game engine with support for survival and crafting. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- src/util/string.cpp.orig 2019-03-31 20:57:45.000000000 +0000 d7 16 a22 1 @@@@ -79,6 +79,12 @@@@ bool convert(const char *to, const char d35 1 a35 1 @@@@ -104,8 +110,9 @@@@ std::wstring utf8_to_wide(const std::str @