On Mon, Aug 05, 2019 at 12:05:05PM +0200, Jeremie Courreges-Anglas wrote: [...] > Here's a diff with proper comments which I deem desirable. Charlene, > Thomas, others: ok?
I'd like to combine this with the update to the latest release (3.1.1) as previously proposed [1]. This update also does away with the thirdparty module that included nvcore.h, so that patch isn't needed anymore. The combined diff is below. I did a build and runtime test on amd64 and didn't notice any issues. ok for combined diff? [1] https://marc.info/?l=openbsd-ports&m=155822680415354&w=2 Index: Makefile =================================================================== RCS file: /cvs/ports/games/godot/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile 12 Jul 2019 20:46:19 -0000 1.7 +++ Makefile 5 Aug 2019 16:56:19 -0000 @@ -1,25 +1,24 @@ -# $OpenBSD: Makefile,v 1.7 2019/07/12 20:46:19 sthen Exp $ +# $OpenBSD: Makefile,v 1.5 2018/10/24 14:28:03 sthen Exp $ COMMENT = 2D and 3D game engine -V = 3.0.6 +V = 3.1.1 DISTNAME = godot-${V}-stable PKGNAME = godot-${V} CATEGORIES = games HOMEPAGE = https://godotengine.org/ MAINTAINER = Thomas Frohwein <t...@openbsd.org> -REVISION = 1 # MIT PERMIT_PACKAGE = Yes WANTLIB += ${COMPILER_LIBCXX} WANTLIB += GL X11 Xau Xcursor Xdmcp Xext Xfixes Xi Xinerama Xrandr -WANTLIB += Xrender c crypto enet execinfo freetype intl m mpcdec -WANTLIB += ogg opus opusfile png ssl theora theoradec vorbis vorbisfile +WANTLIB += Xrender c enet execinfo freetype intl m mpcdec +WANTLIB += ogg opus opusfile png pulse theora theoradec vorbis vorbisfile WANTLIB += webp xcb z pcre2-32 vpx zstd -COMPILER = base-clang ports-gcc base-gcc +COMPILER = base-clang ports-gcc base-gcc MASTER_SITES = https://downloads.tuxfamily.org/godotengine/${V}/ EXTRACT_SUFX = .tar.xz @@ -50,15 +49,17 @@ MODSCONS_FLAGS = CC="${CC}" \ builtin_zlib=no \ builtin_zstd=no \ dev=yes \ + module_upnp_enabled=no \ + minizip=no \ platform=x11 \ progress=no \ - pulseaudio=no \ target=release_debug LIB_DEPENDS = archivers/zstd \ audio/libvorbis \ audio/musepack \ audio/opusfile \ - devel/gettext,-runtime \ + audio/pulseaudio \ + devel/gettext \ devel/libexecinfo \ devel/pcre2 \ graphics/libwebp \ Index: distinfo =================================================================== RCS file: /cvs/ports/games/godot/distinfo,v retrieving revision 1.3 diff -u -p -r1.3 distinfo --- distinfo 25 Aug 2018 19:20:29 -0000 1.3 +++ distinfo 5 Aug 2019 16:56:19 -0000 @@ -1,2 +1,2 @@ -SHA256 (godot-3.0.6-stable.tar.xz) = LfHLNqAMaHrnShHX31vcEyyBapNOJpbswzgnAI/5xrk= -SIZE (godot-3.0.6-stable.tar.xz) = 12517428 +SHA256 (godot-3.1.1-stable.tar.xz) = ohunblBO84QLDcpKfc0eGE7UmuwoNWpo2JdXAKDZCiU= +SIZE (godot-3.1.1-stable.tar.xz) = 13112996 Index: patches/patch-core_io_SCsub =================================================================== RCS file: patches/patch-core_io_SCsub diff -N patches/patch-core_io_SCsub --- patches/patch-core_io_SCsub 27 Apr 2018 07:32:53 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -$OpenBSD: patch-core_io_SCsub,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $ - -revert long-distance matching in zstd which is based on private functions and -doesn't compile if archivers/zstd is installed -this is a revert of pertinent parts of commit -f3436a841a3b59fc3a9deb94d5fdfd1e550d0351 -based on github issue #17374 - -Index: core/io/SCsub ---- core/io/SCsub.orig -+++ core/io/SCsub -@@ -5,4 +5,4 @@ Import('env') - env.add_source_files(env.core_sources, "*.cpp") - - Export('env') -- -+env.Append(CCFLAGS="-DZSTD_STATIC_LINKING_ONLY") Index: patches/patch-core_io_compression_cpp =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-core_io_compression_cpp,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-core_io_compression_cpp --- patches/patch-core_io_compression_cpp 27 Apr 2018 07:32:53 -0000 1.1.1.1 +++ patches/patch-core_io_compression_cpp 5 Aug 2019 16:56:19 -0000 @@ -1,4 +1,4 @@ -$OpenBSD: patch-core_io_compression_cpp,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $ +$OpenBSD$ revert long-distance matching in zstd which is based on private functions and doesn't compile if archivers/zstd is installed @@ -9,17 +9,16 @@ based on github issue #17374 Index: core/io/compression.cpp --- core/io/compression.cpp.orig +++ core/io/compression.cpp -@@ -79,16 +79,9 @@ int Compression::compress(uint8_t *p_dst, const uint8_ +@@ -80,16 +80,8 @@ int Compression::compress(uint8_t *p_dst, const uint8_ } break; case MODE_ZSTD: { - ZSTD_CCtx *cctx = ZSTD_createCCtx(); -- ZSTD_CCtx_setParameter(cctx, ZSTD_p_compressionLevel, zstd_level); +- ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, zstd_level); - if (zstd_long_distance_matching) { -- ZSTD_CCtx_setParameter(cctx, ZSTD_p_enableLongDistanceMatching, 1); -- ZSTD_CCtx_setParameter(cctx, ZSTD_p_windowLog, zstd_window_log_size); +- ZSTD_CCtx_setParameter(cctx, ZSTD_c_enableLongDistanceMatching, 1); +- ZSTD_CCtx_setParameter(cctx, ZSTD_c_windowLog, zstd_window_log_size); - } -+ int max_dst_size = get_max_compressed_buffer_size(p_src_size, MODE_ZSTD); - int ret = ZSTD_compressCCtx(cctx, p_dst, max_dst_size, p_src, p_src_size, zstd_level); - ZSTD_freeCCtx(cctx); @@ -28,23 +27,24 @@ Index: core/io/compression.cpp } break; } -@@ -173,11 +166,8 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_ +@@ -174,13 +166,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_ return total; } break; case MODE_ZSTD: { - ZSTD_DCtx *dctx = ZSTD_createDCtx(); -- if (zstd_long_distance_matching) ZSTD_DCtx_setMaxWindowSize(dctx, 1 << zstd_window_log_size); +- if (zstd_long_distance_matching) { +- ZSTD_DCtx_setParameter(dctx, ZSTD_d_windowLogMax, zstd_window_log_size); +- } - int ret = ZSTD_decompressDCtx(dctx, p_dst, p_dst_max_size, p_src, p_src_size); - ZSTD_freeDCtx(dctx); - return ret; -+ -+ return ZSTD_decompress(p_dst, p_dst_max_size, p_src, p_src_size); ++ return ZSTD_decompress(p_dst, p_dst_max_size, p_src, p_src_size); } break; } -@@ -187,5 +177,3 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_ +@@ -190,5 +176,3 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_ int Compression::zlib_level = Z_DEFAULT_COMPRESSION; int Compression::gzip_level = Z_DEFAULT_COMPRESSION; int Compression::zstd_level = 3; -bool Compression::zstd_long_distance_matching = false; --int Compression::zstd_window_log_size = 27; +-int Compression::zstd_window_log_size = 27; // ZSTD_WINDOWLOG_LIMIT_DEFAULT Index: patches/patch-core_io_compression_h =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-core_io_compression_h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-core_io_compression_h --- patches/patch-core_io_compression_h 27 Apr 2018 07:32:53 -0000 1.1.1.1 +++ patches/patch-core_io_compression_h 5 Aug 2019 16:56:19 -0000 @@ -1,4 +1,4 @@ -$OpenBSD: patch-core_io_compression_h,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $ +$OpenBSD$ revert long-distance matching in zstd which is based on private functions and doesn't compile if archivers/zstd is installed Index: patches/patch-core_project_settings_cpp =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-core_project_settings_cpp,v retrieving revision 1.2 diff -u -p -r1.2 patch-core_project_settings_cpp --- patches/patch-core_project_settings_cpp 25 Aug 2018 19:20:29 -0000 1.2 +++ patches/patch-core_project_settings_cpp 5 Aug 2019 16:56:19 -0000 @@ -9,8 +9,8 @@ based on github issue #17374 Index: core/project_settings.cpp --- core/project_settings.cpp.orig +++ core/project_settings.cpp -@@ -1041,14 +1041,11 @@ ProjectSettings::ProjectSettings() { - GLOBAL_DEF("debug/settings/profiler/max_functions", 16384); +@@ -1172,14 +1172,11 @@ ProjectSettings::ProjectSettings() { + custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1"); //assigning here, because using GLOBAL_GET on every block for compressing can be slow - Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false); Index: patches/patch-drivers_unix_os_unix_cpp =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-drivers_unix_os_unix_cpp,v retrieving revision 1.3 diff -u -p -r1.3 patch-drivers_unix_os_unix_cpp --- patches/patch-drivers_unix_os_unix_cpp 25 Aug 2018 19:20:29 -0000 1.3 +++ patches/patch-drivers_unix_os_unix_cpp 5 Aug 2019 16:56:19 -0000 @@ -5,7 +5,7 @@ $OpenBSD: patch-drivers_unix_os_unix_cpp Index: drivers/unix/os_unix.cpp --- drivers/unix/os_unix.cpp.orig +++ drivers/unix/os_unix.cpp -@@ -462,7 +462,7 @@ String OS_Unix::get_executable_path() const { +@@ -518,7 +518,7 @@ String OS_Unix::get_executable_path() const { #elif defined(__OpenBSD__) char resolved_path[MAXPATHLEN]; Index: patches/patch-main_main_cpp =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-main_main_cpp,v retrieving revision 1.1 diff -u -p -r1.1 patch-main_main_cpp --- patches/patch-main_main_cpp 25 Aug 2018 19:20:29 -0000 1.1 +++ patches/patch-main_main_cpp 5 Aug 2019 16:56:19 -0000 @@ -5,8 +5,8 @@ log on falling back to dummy audio drive Index: main/main.cpp --- main/main.cpp.orig +++ main/main.cpp -@@ -938,6 +938,10 @@ Error Main::setup(const char *execpath, int argc, char - audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0)); +@@ -976,6 +976,10 @@ Error Main::setup(const char *execpath, int argc, char + audio_driver = GLOBAL_DEF_RST("audio/driver", OS::get_singleton()->get_audio_driver_name(0)); } + if (audio_driver == "Dummy") { Index: patches/patch-platform_x11_detect_py =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-platform_x11_detect_py,v retrieving revision 1.1 diff -u -p -r1.1 patch-platform_x11_detect_py --- patches/patch-platform_x11_detect_py 25 Aug 2018 19:20:29 -0000 1.1 +++ patches/patch-platform_x11_detect_py 5 Aug 2019 16:56:19 -0000 @@ -5,12 +5,15 @@ remove hardcoded -O2, found by bcallah@ Index: platform/x11/detect.py --- platform/x11/detect.py.orig +++ platform/x11/detect.py -@@ -84,7 +84,7 @@ def configure(env): - env.Prepend(CCFLAGS=['-g2']) +@@ -97,9 +97,9 @@ def configure(env): elif (env["target"] == "release_debug"): -- env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) -+ env.Prepend(CCFLAGS=['-ffast-math', '-DDEBUG_ENABLED']) + if (env["optimize"] == "speed"): #optimize for speed (default) +- env.Prepend(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) ++ env.Prepend(CCFLAGS=['-DDEBUG_ENABLED']) + else: #optimize for size +- env.Prepend(CCFLAGS=['-Os', '-DDEBUG_ENABLED']) ++ env.Prepend(CCFLAGS=['-DDEBUG_ENABLED']) + if (env["debug_symbols"] == "yes"): env.Prepend(CCFLAGS=['-g1']) - if (env["debug_symbols"] == "full"): Index: patches/patch-platform_x11_os_x11_cpp =================================================================== RCS file: /cvs/ports/games/godot/patches/patch-platform_x11_os_x11_cpp,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-platform_x11_os_x11_cpp --- patches/patch-platform_x11_os_x11_cpp 27 Apr 2018 07:32:53 -0000 1.1.1.1 +++ patches/patch-platform_x11_os_x11_cpp 5 Aug 2019 16:56:19 -0000 @@ -5,7 +5,7 @@ fix libXrandr library name Index: platform/x11/os_x11.cpp --- platform/x11/os_x11.cpp.orig +++ platform/x11/os_x11.cpp -@@ -160,7 +160,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i +@@ -157,7 +157,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i int xrandr_minor = 0; int event_base, error_base; xrandr_ext_ok = XRRQueryExtension(x11_display, &event_base, &error_base); Index: patches/patch-servers_audio_server_cpp =================================================================== RCS file: patches/patch-servers_audio_server_cpp diff -N patches/patch-servers_audio_server_cpp --- patches/patch-servers_audio_server_cpp 25 Aug 2018 19:20:29 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -$OpenBSD: patch-servers_audio_server_cpp,v 1.1 2018/08/25 19:20:29 thfr Exp $ - -add dummy audio driver to AudioDriverManager list -(github issue #20986) - -Index: servers/audio_server.cpp ---- servers/audio_server.cpp.orig -+++ servers/audio_server.cpp -@@ -119,14 +119,19 @@ AudioDriver::AudioDriver() { - _mix_amount = 0; - } - --AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS]; --int AudioDriverManager::driver_count = 0; - AudioDriverDummy AudioDriverManager::dummy_driver; -+AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS] = { -+ &AudioDriverManager::dummy_driver, -+}; -+int AudioDriverManager::driver_count = 1; - - void AudioDriverManager::add_driver(AudioDriver *p_driver) { - - ERR_FAIL_COND(driver_count >= MAX_DRIVERS); -- drivers[driver_count++] = p_driver; -+ drivers[driver_count - 1] = p_driver; -+ -+ // Last driver is always our dummy driver -+ drivers[driver_count++] = &AudioDriverManager::dummy_driver; - } - - int AudioDriverManager::get_driver_count() { -@@ -158,14 +163,6 @@ void AudioDriverManager::initialize(int p_driver) { - drivers[i]->set_singleton(); - return; - } -- } -- -- // Fallback to our dummy driver -- if (dummy_driver.init() == OK) { -- ERR_PRINT("AudioDriverManager: all drivers failed, falling back to dummy driver"); -- dummy_driver.set_singleton(); -- } else { -- ERR_PRINT("AudioDriverManager: dummy driver failed to init()"); - } - } - Index: patches/patch-servers_visual_shader_language_cpp =================================================================== RCS file: patches/patch-servers_visual_shader_language_cpp diff -N patches/patch-servers_visual_shader_language_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-servers_visual_shader_language_cpp 5 Aug 2019 16:56:19 -0000 @@ -0,0 +1,22 @@ +$OpenBSD$ + +Fix error with ports-gcc: + error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive] + +Index: servers/visual/shader_language.cpp +--- servers/visual/shader_language.cpp.orig ++++ servers/visual/shader_language.cpp +@@ -2046,11 +2046,11 @@ const ShaderLanguage::BuiltinFuncOutArgs ShaderLanguag + + bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) { + +- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL); ++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false); + + Vector<DataType> args; + +- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL); ++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false); + + StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String(); + Index: patches/patch-servers_visual_shader_language_cpp.orig =================================================================== RCS file: patches/patch-servers_visual_shader_language_cpp.orig diff -N patches/patch-servers_visual_shader_language_cpp.orig --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-servers_visual_shader_language_cpp.orig 5 Aug 2019 16:56:19 -0000 @@ -0,0 +1,22 @@ +$OpenBSD$ + +Fix error with ports-gcc: + error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive] + +Index: servers/visual/shader_language.cpp +--- servers/visual/shader_language.cpp.orig ++++ servers/visual/shader_language.cpp +@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b + + bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) { + +- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL); ++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false); + + Vector<DataType> args; + +- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL); ++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false); + + StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String(); + Index: patches/patch-thirdparty_minizip_crypt_h =================================================================== RCS file: patches/patch-thirdparty_minizip_crypt_h diff -N patches/patch-thirdparty_minizip_crypt_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-thirdparty_minizip_crypt_h 5 Aug 2019 16:56:19 -0000 @@ -0,0 +1,17 @@ +$OpenBSD$ + +fix missing type z_crc_t; gleaned from +https://github.com/ZipArchive/ZipArchive/issues/360 + +Index: thirdparty/minizip/crypt.h +--- thirdparty/minizip/crypt.h.orig ++++ thirdparty/minizip/crypt.h +@@ -27,6 +27,8 @@ + Encryption is not supported. + */ + ++typedef unsigned long z_crc_t; ++ + #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + + /*********************************************************************** Index: patches/patch-thirdparty_minizip_zip_c =================================================================== RCS file: patches/patch-thirdparty_minizip_zip_c diff -N patches/patch-thirdparty_minizip_zip_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-thirdparty_minizip_zip_c 5 Aug 2019 16:56:19 -0000 @@ -0,0 +1,16 @@ +$OpenBSD$ + +fix missing type z_crc_t; gleaned from +https://github.com/ZipArchive/ZipArchive/issues/360 + +Index: thirdparty/minizip/zip.c +--- thirdparty/minizip/zip.c.orig ++++ thirdparty/minizip/zip.c +@@ -21,6 +21,7 @@ + + */ + ++typedef unsigned long z_crc_t; + + #include <stdio.h> + #include <stdlib.h>