Hi, New version, don't mind the UNSTABLE in the name since they use it for all .0 releases, any objections to remove it from the name with PKGNAME? Or should it be kept but s/-/./ instead?
Just tested it on amd64 -current for several consoles including snes which is not crashing anymore, at least for me, can someone confirm if it also doesn't crash on i386 and therefore the patches are not required? Comments? OK? Index: Makefile =================================================================== RCS file: /cvs/ports/emulators/mednafen/Makefile,v retrieving revision 1.33 diff -u -p -u -r1.33 Makefile --- Makefile 16 Jul 2021 07:49:39 -0000 1.33 +++ Makefile 16 Nov 2021 17:06:52 -0000 @@ -3,7 +3,9 @@ BROKEN-hppa = ../../include/mednafen/state.h:21:7: error: 'exception_ptr' in namespace 'std' does not name a type COMMENT = emulates numerous game consoles -DISTNAME = mednafen-1.27.1 +VERSION = 1.28.0-UNSTABLE +DISTNAME = mednafen-${VERSION} +PKGNAME = mednafen-${VERSION:C/-UNSTABLE//} CATEGORIES = emulators games HOMEPAGE = https://mednafen.github.io Index: distinfo =================================================================== RCS file: /cvs/ports/emulators/mednafen/distinfo,v retrieving revision 1.16 diff -u -p -u -r1.16 distinfo --- distinfo 16 Jul 2021 07:49:39 -0000 1.16 +++ distinfo 16 Nov 2021 17:06:52 -0000 @@ -1,2 +1,2 @@ -SHA256 (mednafen-1.27.1.tar.xz) = 86ibLzL0DDIyWTgI0F4MIcvfRDaIrOBMnCfkz01ZVfs= -SIZE (mednafen-1.27.1.tar.xz) = 3363540 +SHA256 (mednafen-1.28.0-UNSTABLE.tar.xz) = Cu8rLtMKI/0VhqWQhgB311gm7Qd+fTJ3KxrPP8vwP1M= +SIZE (mednafen-1.28.0-UNSTABLE.tar.xz) = 3501032 Index: patches/patch-src_snes_src_lib_libco_amd64_c =================================================================== RCS file: patches/patch-src_snes_src_lib_libco_amd64_c diff -N patches/patch-src_snes_src_lib_libco_amd64_c --- patches/patch-src_snes_src_lib_libco_amd64_c 29 Mar 2020 10:10:29 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@ -$OpenBSD: patch-src_snes_src_lib_libco_amd64_c,v 1.1 2020/03/29 10:10:29 solene Exp $ - -This prevent the snes module to crash on load on amd64 - -Index: src/snes/src/lib/libco/amd64.c ---- src/snes/src/lib/libco/amd64.c.orig -+++ src/snes/src/lib/libco/amd64.c -@@ -13,6 +13,10 @@ - - #include <assert.h> - #include <stdlib.h> -+#include <err.h> -+#include <stdint.h> -+#include <unistd.h> -+#include <sys/mman.h> - - #ifdef __cplusplus - extern "C" { -@@ -21,6 +25,7 @@ extern "C" { - static thread_local long long co_active_buffer[64]; - static thread_local cothread_t co_active_handle = 0; - static void (*co_swap)(cothread_t, cothread_t) = 0; -+long pagesize, newsize; - - #ifdef _WIN32 - /* ABI: Win64 */ -@@ -119,7 +124,19 @@ cothread_t co_create(unsigned int size, void (*entrypo - size += 512; /* allocate additional space for storage */ - size &= ~15; /* align stack to 16-byte boundary */ - -- if(handle = (cothread_t)malloc(size)) { -+ pagesize = sysconf(_SC_PAGESIZE); -+ if(pagesize == -1) -+ err(1, "sysconf failed"); -+ newsize = size / pagesize * pagesize + !!(size % pagesize) * pagesize; -+ handle = (cothread_t)malloc(newsize); -+ if(handle == NULL) -+ err(1, "malloc failed"); -+ if((uintptr_t)handle % pagesize) -+ err(1, "misaligned allocation"); -+ handle = (cothread_t)mmap(handle, newsize, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_STACK|MAP_PRIVATE|MAP_ANON, -1, 0); -+ if(handle == MAP_FAILED) -+ err(1, "mmap failed"); -+ else { - long long *p = (long long*)((char*)handle + size); /* seek to top of stack */ - *--p = (long long)crash; /* crash if entrypoint returns */ - *--p = (long long)entrypoint; /* start of function */ Index: patches/patch-src_snes_src_lib_libco_x86_c =================================================================== RCS file: patches/patch-src_snes_src_lib_libco_x86_c diff -N patches/patch-src_snes_src_lib_libco_x86_c --- patches/patch-src_snes_src_lib_libco_x86_c 31 Mar 2020 11:47:01 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@ -$OpenBSD: patch-src_snes_src_lib_libco_x86_c,v 1.2 2020/03/31 11:47:01 solene Exp $ - -This prevent the snes module to crash on load on i386 - -Index: src/snes/src/lib/libco/x86.c ---- src/snes/src/lib/libco/x86.c.orig -+++ src/snes/src/lib/libco/x86.c -@@ -9,6 +9,10 @@ - - #include <assert.h> - #include <stdlib.h> -+#include <err.h> -+#include <stdint.h> -+#include <unistd.h> -+#include <sys/mman.h> - - #ifdef __cplusplus - extern "C" { -@@ -25,6 +29,7 @@ extern "C" { - static thread_local long co_active_buffer[64]; - static thread_local cothread_t co_active_handle = 0; - static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; -+long pagesize, newsize; - - /* ABI: fastcall */ - force_text_section static const unsigned char co_swap_function[] = { -@@ -64,7 +69,19 @@ cothread_t co_create(unsigned int size, void (*entrypo - size += 256; /* allocate additional space for storage */ - size &= ~15; /* align stack to 16-byte boundary */ - -- if(handle = (cothread_t)malloc(size)) { -+ pagesize = sysconf(_SC_PAGESIZE); -+ if(pagesize == -1) -+ err(1, "sysconf failed"); -+ newsize = size / pagesize * pagesize + !!(size % pagesize) * pagesize; -+ handle = (cothread_t)malloc(newsize); -+ if(handle == NULL) -+ err(1, "malloc failed"); -+ if((uintptr_t)handle % pagesize) -+ err(1, "misaligned allocation"); -+ handle = (cothread_t)mmap(handle, newsize, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_STACK|MAP_PRIVATE|MAP_ANON, -1, 0); -+ if(handle == MAP_FAILED) -+ err(1, "mmap failed"); -+ else { - long *p = (long*)((char*)handle + size); /* seek to top of stack */ - *--p = (long)crash; /* crash if entrypoint returns */ - *--p = (long)entrypoint; /* start of function */