Thomas Frohwein <tfrohw...@fastmail.com> writes:

> Thanks for this diff and the interest in the port.

I don't know why but I've completely overlooked the MAINTAINER variable
in the makefile, and assumed that the port was without one.  I should
have cc'd you in the first place, I'm sorry.

> On Fri, May 29, 2020 at 03:15:11PM +0200, Omar Polo wrote:
> [...]
>> On my machine (amdgpu) it leaves a core file around but otherwise is
>> working; on my friend machine (inteldrm) it doesn't core dumps. We
>
> Can you provide some details about the core dump? Does Godot crash on
> amdgpu? Can you share a backtrace with gdb(egdb) from ports? I don't
> understand if this is just like the already known bugs with amdgpu at
> this point or something new.

The amdgpu vs inteldrm was a red herring, the cause is the window
manager.  If I close the game (or the editor window) either by
left-clicking its icon in tint2 or with the cwm keybinding, Godot logs:

        X connection to :0 broken (explicit kill or server shutdown).
        Pure virtual function called!

That's why I got that dump every time.  I still haven't asked my friend,
but I suspect he quits either by <C-q> or Scene -> quit.

The (not so useful I fear) stacktrace is the following:

; egdb `which godot` godot.core 
[...]
Reading symbols from /usr/local/bin/godot...(no debugging symbols found)...done.
[New process 125523]
[New process 452006]
[New process 330887]
[New process 200582]
Core was generated by `godot'.
Program terminated with signal SIGABRT, Aborted.
#0  thrkill () at -:3
3       -: No such file or directory.
[Current thread is 1 (process 125523)]
(gdb) bt
#0  thrkill () at -:3
#1  0x0000114ce6265fce in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#2  0x0000114cdefcb11c in abort_message (format=<optimized out>)
    at /usr/src/lib/libcxxabi/src/abort_message.cpp:77
#3  0x0000114cdefcb352 in __cxa_pure_virtual ()
    at /usr/src/lib/libcxxabi/src/cxa_virtual.cpp:17
#4  0x0000114a9f9b7806 in ?? ()
#5  0x0000114a9dc286db in ?? ()
#6  0x0000114cff782361 in _rthread_start (v=<optimized out>)
    at /usr/src/lib/librthread/rthread.c:96
#7  0x0000114ce6248e48 in __tfork_thread ()
    at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:77
#8  0x0000000000000000 in ?? ()
(gdb) 

I'm rebuilding Godot with DEBUG_PACKAGES set to make the stacktrace more
useful.

(note that DEBUG_PACKAGES is not included in the updated diff)

By the way, do you know why the scons module explicitly disables ccache?
I was hoping to reduce the compilation time, but even with
USE_CCACHE=Yes and forcing NO_CCACHE=No scons still uses c++

>> working; on my friend machine (inteldrm) it doesn't core dumps. We
>> tested everything but the networking stuff AFAIK.
>
> As your patch includes disabling ssl in favor of mbedtls, I would think
> that some networking should be tested.

I'm still learning godot.  I'm going to study how to test this properly
and report back.

>> I didn't have the time (yet) to fully debug this issue.
>>
>> Do I have to reset the REVISION back to 0 since this changes the port
>> version?
>
> Yes, REVISION is only used if changes happen in the package while the
> version doesn't change. It effectively adds pX to the package. See
> packages-specs(7) and bsd.port.mk(5). So just remove the REVISION line
> when updating the port's version.

done!

> [...]
>> - pulseaudio is still disabled: I have a WIP patch (not included) to
>>   bring back audio support using libao.  I plan to submit it soon
>>   after this update
>
> I would be _very_ interested in this after the update. I've been trying
> to come up with an sndio backend myself, but haven't got it to work so
> far.

It's basically a revert of #2840[0] ("Revert libao audio driver", it's a
revert of a revert...) with adjustments to match the changes in the
AudioDriver.

After a quick search on the github issues, it seems that they added the
libao support explicitly to support sndio, but then later they removed
it without an explanation (or I didn't found it).

My plan was to handle this directly with upstream, but since mid April I
am no longer able to run Godot from master (i.e. after the merge of the
vulkan branch).  I can still build it, but it doesn't start due to some
error in the vulkan loader I don't understand (and didn't have the time
to investigate further.)

> [...]
>> - in 3.1 they replaced openssl with mbedtls, hence the removal of ssl
>>   from WANTLIB
>
> Must be a bundled mbedtls, as nothing is added to WANTLIB and/or
> LIB_DEPENDS. Might be better to find a way to use our ports version...

also done!

> [...]
>
> I haven't tested this yet. I am comparing it with the diff that I have
> been working on and will get back to you. Your diff is much longer than
> what I had (537 vs 199 lines). I'm gonna see what we need.

That's quite a difference.  I just started by bumping the version and
then patching until it ran :)

If you find unnecessary hunks I'll be more than happy to drop them.

> Port updates are usually preferred as inline diff. Just make sure your
> mail client doesn't mangle whitespace.

also done!

Cheers!

[0]: https://github.com/godotengine/godot/pull/2840

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile    12 Apr 2020 13:30:55 -0000      1.10
+++ Makefile    2 Jun 2020 18:32:33 -0000
@@ -2,22 +2,21 @@
 
 COMMENT =      2D and 3D game engine
 
-V =            3.0.6
+V =            3.2.1
 DISTNAME =     godot-${V}-stable
 PKGNAME =      godot-${V}
 CATEGORIES =   games
 HOMEPAGE =     https://godotengine.org/
 MAINTAINER =   Thomas Frohwein <t...@openbsd.org>
-REVISION =     3
 
 # 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 += webp xcb z pcre2-32 vpx zstd
+WANTLIB += Xrender c enet execinfo freetype intl m mbedtls mbedcrypto
+WANTLIB += mbedx509 mpcdec ogg opus opusfile png theora theoradec
+WANTLIB += vorbis vorbisfile webp xcb z pcre2-32 vpx zstd
 
 COMPILER =             base-clang ports-gcc base-gcc
 
@@ -32,7 +31,7 @@ MODULES =             devel/scons
 MODSCONS_FLAGS =       CC="${CC}" \
                        CXX="${CXX}" \
                        CFLAGS="${CFLAGS}" \
-                       CXXFLAGS="${CXXFLAGS}" \
+                       CXXFLAGS="${CXXFLAGS} -Wno-deprecated-register" \
                        LINKFLAGS="${LDFLAGS} -lintl -lmpcdec" \
                        builtin_enet=no \
                        builtin_freetype=no \
@@ -44,7 +43,7 @@ MODSCONS_FLAGS =      CC="${CC}" \
                        builtin_libvorbis=no \
                        builtin_libvpx=no \
                        builtin_libwebp=no \
-                       builtin_openssl=no \
+                       builtin_mbedtls=no \
                        builtin_opus=no \
                        builtin_pcre2=no \
                        builtin_zlib=no \
@@ -65,7 +64,8 @@ LIB_DEPENDS =         archivers/zstd \
                        graphics/png \
                        multimedia/libtheora \
                        multimedia/libvpx \
-                       net/enet
+                       net/enet \
+                       security/polarssl
 
 NO_TEST =              Yes
 
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    2 Jun 2020 18:32:33 -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.2.1-stable.tar.xz) = 
VWtWQHn7GyGgUyDDWSaLIDLIfYs7+qT9EE6/nJCauH0=
+SIZE (godot-3.2.1-stable.tar.xz) = 14066488
Index: patches/patch-core_io_SCsub
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-core_io_SCsub,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-core_io_SCsub
--- patches/patch-core_io_SCsub 27 Apr 2018 07:32:53 -0000      1.1.1.1
+++ patches/patch-core_io_SCsub 2 Jun 2020 18:32:33 -0000
@@ -9,9 +9,9 @@ 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")
+@@ -3,3 +3,5 @@
+ Import('env')
  
- Export('env')
--
+ env.add_source_files(env.core_sources, "*.cpp")
++
 +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       2 Jun 2020 18:32:33 -0000
@@ -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);
                } 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_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     2 Jun 2020 18:32:33 -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);
+@@ -1202,14 +1202,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-core_safe_refcount_h
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-core_safe_refcount_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-core_safe_refcount_h
--- patches/patch-core_safe_refcount_h  2 Sep 2019 18:20:12 -0000       1.1
+++ patches/patch-core_safe_refcount_h  2 Jun 2020 18:32:33 -0000
@@ -7,57 +7,65 @@ https://github.com/godotengine/godot/pul
 Index: core/safe_refcount.h
 --- core/safe_refcount.h.orig
 +++ core/safe_refcount.h
-@@ -99,8 +99,8 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(re
- 
- /* Implementation for GCC & Clang */
- 
--// GCC guarantees atomic intrinsics for sizes of 1, 2, 4 and 8 bytes.
--// Clang states it supports GCC atomic builtins.
-+#include <stdbool.h>
-+#include <atomic>
- 
- template <class T>
- static _ALWAYS_INLINE_ T atomic_conditional_increment(register T *pw) {
-@@ -109,7 +109,7 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(
-               T tmp = static_cast<T const volatile &>(*pw);
-               if (tmp == 0)
-                       return 0; // if zero, can't add to it anymore
--              if (__sync_val_compare_and_swap(pw, tmp, tmp + 1) == tmp)
-+              if (__atomic_compare_exchange_n(pw, &tmp, tmp + 1, false, 
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) == true)
-                       return tmp + 1;
-       }
- }
-@@ -117,25 +117,25 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(
+@@ -55,33 +55,26 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(
  template <class T>
- static _ALWAYS_INLINE_ T atomic_decrement(register T *pw) {
+ static _ALWAYS_INLINE_ T atomic_decrement(volatile T *pw) {
  
--      return __sync_sub_and_fetch(pw, 1);
+-      (*pw)--;
+-
+-      return *pw;
 +      return __atomic_sub_fetch(pw, 1, __ATOMIC_SEQ_CST);
  }
  
  template <class T>
- static _ALWAYS_INLINE_ T atomic_increment(register T *pw) {
+ static _ALWAYS_INLINE_ T atomic_increment(volatile T *pw) {
  
--      return __sync_add_and_fetch(pw, 1);
+-      (*pw)++;
+-
+-      return *pw;
 +      return __atomic_add_fetch(pw, 1, __ATOMIC_SEQ_CST);
  }
  
  template <class T, class V>
- static _ALWAYS_INLINE_ T atomic_sub(register T *pw, register V val) {
+ static _ALWAYS_INLINE_ T atomic_sub(volatile T *pw, volatile V val) {
+ 
+-      (*pw) -= val;
  
--      return __sync_sub_and_fetch(pw, val);
+-      return *pw;
 +      return __atomic_sub_fetch(pw, val, __ATOMIC_SEQ_CST);
  }
  
  template <class T, class V>
- static _ALWAYS_INLINE_ T atomic_add(register T *pw, register V val) {
+ static _ALWAYS_INLINE_ T atomic_add(volatile T *pw, volatile V val) {
  
--      return __sync_add_and_fetch(pw, val);
+-      (*pw) += val;
+-
+-      return *pw;
 +      return __atomic_add_fetch(pw, val, __ATOMIC_SEQ_CST);
  }
  
  template <class T, class V>
-@@ -145,7 +145,7 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(re
+@@ -97,8 +90,8 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(vo
+ 
+ /* Implementation for GCC & Clang */
+ 
+-// GCC guarantees atomic intrinsics for sizes of 1, 2, 4 and 8 bytes.
+-// Clang states it supports GCC atomic builtins.
++#include <stdbool.h>
++#include <atomic>
+ 
+ template <class T>
+ static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) {
+@@ -107,7 +100,7 @@ static _ALWAYS_INLINE_ T atomic_conditional_increment(
+               T tmp = static_cast<T const volatile &>(*pw);
+               if (tmp == 0)
+                       return 0; // if zero, can't add to it anymore
+-              if (__sync_val_compare_and_swap(pw, tmp, tmp + 1) == tmp)
++              if (__atomic_compare_exchange_n(pw, &tmp, tmp + 1, false, 
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) == true)
+                       return tmp + 1;
+       }
+ }
+@@ -143,7 +136,7 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(vo
                T tmp = static_cast<T const volatile &>(*pw);
                if (tmp >= val)
                        return tmp; // already greater, or equal
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      2 Jun 2020 18:32:33 -0000
@@ -1,11 +1,11 @@
 $OpenBSD: patch-drivers_unix_os_unix_cpp,v 1.3 2018/08/25 19:20:29 thfr Exp $
 
-- hardcode executable path
+hardcode executable path
 
 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 {
+@@ -510,7 +510,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 2 Jun 2020 18:32:33 -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));
+@@ -1084,6 +1084,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_uwp_export_export_cpp
===================================================================
RCS file: patches/patch-platform_uwp_export_export_cpp
diff -N patches/patch-platform_uwp_export_export_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-platform_uwp_export_export_cpp        2 Jun 2020 18:32:33 
-0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+fix comparison of integers of different signs
+
+Index: platform/uwp/export/export.cpp
+--- platform/uwp/export/export.cpp.orig
++++ platform/uwp/export/export.cpp
+@@ -554,7 +554,7 @@ Error AppxPackager::add_file(String p_file_name, const
+               //package->store_buffer(strm_out.ptr(), strm.total_out - 
total_out_before);
+               int start = file_buffer.size();
+               file_buffer.resize(file_buffer.size() + (strm.total_out - 
total_out_before));
+-              for (uint64_t i = 0; i < (strm.total_out - total_out_before); 
i++)
++              for (int64_t i = 0; i < (strm.total_out - total_out_before); 
i++)
+                       file_buffer.write[start + i] = strm_out[i];
+ 
+               deflateEnd(&strm);
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        2 Jun 2020 18:32:33 -0000
@@ -5,12 +5,13 @@ 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'])
+@@ -96,7 +96,8 @@ 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["debug_symbols"] == "yes"):
-             env.Prepend(CCFLAGS=['-g1'])
-         if (env["debug_symbols"] == "full"):
+         if (env["optimize"] == "speed"): #optimize for speed (default)
+-            env.Prepend(CCFLAGS=['-O2'])
++            # env.Prepend(CCFLAGS=['-O2'])
++            pass
+         else: #optimize for size
+             env.Prepend(CCFLAGS=['-Os'])
+         env.Prepend(CPPDEFINES=['DEBUG_ENABLED'])
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       2 Jun 2020 18:32:33 -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
+@@ -163,7 +163,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: /cvs/ports/games/godot/patches/patch-servers_audio_server_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-servers_audio_server_cpp
--- patches/patch-servers_audio_server_cpp      25 Aug 2018 19:20:29 -0000      
1.1
+++ patches/patch-servers_audio_server_cpp      2 Jun 2020 18:32:33 -0000
@@ -6,41 +6,38 @@ add dummy audio driver to AudioDriverMan
 Index: servers/audio_server.cpp
 --- servers/audio_server.cpp.orig
 +++ servers/audio_server.cpp
-@@ -119,14 +119,19 @@ AudioDriver::AudioDriver() {
-       _mix_amount = 0;
+@@ -160,16 +160,16 @@ AudioDriver::AudioDriver() {
+ #endif
  }
  
--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;
+-AudioDriverDummy AudioDriverManager::dummy_driver;
+-AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS] = {
++AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS] {
+       &AudioDriverManager::dummy_driver,
+ };
+ int AudioDriverManager::driver_count = 1;
++AudioDriverDummy AudioDriverManager::dummy_driver;
  
  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;
- }
+-      drivers[driver_count - 1] = p_driver;
++      drivers[driver_count-1] = p_driver;
  
- int AudioDriverManager::get_driver_count() {
-@@ -158,14 +163,6 @@ void AudioDriverManager::initialize(int p_driver) {
+       // Last driver is always our dummy driver
+       drivers[driver_count++] = &AudioDriverManager::dummy_driver;
+@@ -205,6 +205,14 @@ void AudioDriverManager::initialize(int p_driver) {
                        drivers[i]->set_singleton();
-                       return;
+                       break;
                }
--      }
--
--      // 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()");
++      }
++
++      // 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()");
        }
- }
  
+       if (driver_count > 1 && 
String(AudioDriver::get_singleton()->get_name()) == "Dummy") {
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
--- patches/patch-servers_visual_shader_language_cpp    16 Aug 2019 15:38:15 
-0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-servers_visual_shader_language_cpp,v 1.1 2019/08/16 15:38:15 
thfr Exp $
-
-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_unzip_c
===================================================================
RCS file: patches/patch-thirdparty_minizip_unzip_c
diff -N patches/patch-thirdparty_minizip_unzip_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_minizip_unzip_c    2 Jun 2020 18:32:33 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+z_crc_t is defined as unsigned long on zlib 1.2.11, which is newer than
+the one we have in base.
+
+Index: thirdparty/minizip/unzip.c
+--- thirdparty/minizip/unzip.c.orig
++++ thirdparty/minizip/unzip.c
+@@ -118,6 +118,7 @@
+ #define SIZECENTRALDIRITEM (0x2e)
+ #define SIZEZIPLOCALHEADER (0x1e)
+ 
++typedef unsigned long z_crc_t;
+ 
+ const char unz_copyright[] =
+    " unzip 1.01 Copyright 1998-2004 Gilles Vollant - 
http://www.winimage.com/zLibDll";;
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      2 Jun 2020 18:32:33 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+z_crc_t is defined as unsigned long on zlib 1.2.11, which is newer than
+the one we have in base.
+
+Index: thirdparty/minizip/zip.c
+--- thirdparty/minizip/zip.c.orig
++++ thirdparty/minizip/zip.c
+@@ -111,6 +111,8 @@ const char zip_copyright[] =" zip 1.01 Copyright 1998-
+ 
+ #define SIZECENTRALHEADER (0x2e) /* 46 */
+ 
++typedef unsigned long z_crc_t;
++
+ typedef struct linkedlist_datablock_internal_s
+ {
+   struct linkedlist_datablock_internal_s* next_datablock;
Index: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
===================================================================
RCS file: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
diff -N patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
--- patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h       16 Aug 2019 
15:38:15 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-thirdparty_thekla_atlas_nvcore_nvcore_h,v 1.1 2019/08/16 
15:38:15 thfr Exp $
-
-Overzealous #error, the code builds fine even if the CPU isn't known.
-
-Index: thirdparty/thekla_atlas/nvcore/nvcore.h
---- thirdparty/thekla_atlas/nvcore/nvcore.h.orig
-+++ thirdparty/thekla_atlas/nvcore/nvcore.h
-@@ -115,7 +115,7 @@
- #elif defined POSH_CPU_STRONGARM
- #   define NV_CPU_ARM 1
- #else
--#   error "Unsupported CPU"
-+//#   error "Unsupported CPU"
- #endif
- 
- 

Reply via email to