Tuesday, September 26, 2023

Re: emulators/desmume 0.9.11 (from 2015) to 0.9.13 (from 2022)

On Tue, Sep 26, 2023 at 07:57:54PM -0400, Daniel Dickman wrote:
> desmume 0.9.11 was released in 2015. There was no release of 0.9.12, and
> 0.9.13 was released in May 2022.
>
> Below diff updates to the latest release which moves us forward by 7
> years.
>
> The nice thing about the update is a lot of patches go away as they are
> already integrated upstream. Also the updates switches from sdl1 -> sdl2.
> The changelog mentions a lot of bug fixes and enhancements too.
>
> Appears to continue to work on amd64. There are no consumers so this
> update should be low risk for release.
>
> ok?

builds, runs... I played a few rounds of Plants vs. Zombies. The only
nit I have is the reference to mimmutable(1) in the patch is wrong and
should be mimmutable(2).

ok thfr@
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/emulators/desmume/Makefile,v
> retrieving revision 1.33
> diff -u -p -u -r1.33 Makefile
> --- Makefile 21 Sep 2023 13:10:25 -0000 1.33
> +++ Makefile 26 Sep 2023 23:49:56 -0000
> @@ -2,8 +2,9 @@ USE_WXNEEDED = Yes
>
> COMMENT = Nintendo DS emulator
>
> -DISTNAME = desmume-0.9.11
> -REVISION = 12
> +V = 0.9.13
> +DISTNAME = desmume-${V}
> +EXTRACT_SUFX = .tar.xz
>
> CATEGORIES = emulators
>
> @@ -12,37 +13,36 @@ HOMEPAGE = https://desmume.org/
> # GPLv2+
> PERMIT_PACKAGE = Yes
>
> -WANTLIB += agg c m pthread ${LIBCXX} z GL GLU X11 Xcomposite
> +WANTLIB += ${COMPILER_LIBCXX} GL GLU SDL2 SoundTouch X11 Xcomposite
> WANTLIB += Xcursor Xdamage Xext Xfixes Xi Xinerama Xrandr Xrender
> -WANTLIB += fontconfig freetype gdk_pixbuf-2.0 gio-2.0
> -WANTLIB += glib-2.0 gobject-2.0 gthread-2.0 SDL SoundTouch
> -WANTLIB += atk-1.0 cairo gdk-x11-2.0 gtk-x11-2.0 iconv intl
> -WANTLIB += pango-1.0 pangocairo-1.0 pangoft2-1.0 zzip
> -WANTLIB += harfbuzz
> +WANTLIB += agg atk-1.0 c cairo fontconfig freetype gdk-x11-2.0
> +WANTLIB += gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gthread-2.0
> +WANTLIB += gtk-x11-2.0 harfbuzz intl m pango-1.0 pangocairo-1.0
> +WANTLIB += pangoft2-1.0 pcap z zzip
>
> -SITES = ${SITE_SOURCEFORGE:=desmume/}
> +SITES = https://github.com/TASEmulators/desmume/releases/download/release_${V:S/./_/g}/
>
> RUN_DEPENDS = devel/desktop-file-utils
>
> LIB_DEPENDS = archivers/zziplib \
> audio/soundtouch \
> - devel/sdl \
> + devel/sdl2 \
> graphics/agg \
> graphics/gdk-pixbuf2 \
> x11/gtk+2
>
> -CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
> - LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
> -
> MODULES = textproc/intltool
>
> -
> COMPILER = base-clang ports-gcc
>
> +FIX_CRLF_FILES = desmume/src/arm_jit.cpp \
> + desmume/src/utils/task.cpp
> +
> CONFIGURE_STYLE = gnu
> -FIX_CRLF_FILES = src/MMU_timing.h \
> - src/path.h \
> - src/arm_jit.cpp \
> - src/utils/AsmJit/core/stringbuilder.h
> +
> +CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
> + LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
> +
> +WRKSRC=${WRKDIST}/desmume/src/frontend/posix
>
> .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/emulators/desmume/distinfo,v
> retrieving revision 1.4
> diff -u -p -u -r1.4 distinfo
> --- distinfo 19 Apr 2015 04:11:16 -0000 1.4
> +++ distinfo 26 Sep 2023 23:49:56 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (desmume-0.9.11.tar.gz) = OrNLpswAlWYkUCXB3ZS/RJtqG0FtJDh8tC4YPHjjiJY=
> -SIZE (desmume-0.9.11.tar.gz) = 5359305
> +SHA256 (desmume-0.9.13.tar.xz) = VzRFDgwl9ELdRM2mpAQQ/WVHD0/i+h658Le22uItq68=
> +SIZE (desmume-0.9.13.tar.xz) = 10437780
> Index: patches/patch-desmume_src_arm_jit_cpp
> ===================================================================
> RCS file: patches/patch-desmume_src_arm_jit_cpp
> diff -N patches/patch-desmume_src_arm_jit_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-desmume_src_arm_jit_cpp 26 Sep 2023 23:49:56 -0000
> @@ -0,0 +1,18 @@
> +BSS is immutable so mark it as mutable so that mprotect RWX works
> +
> +see: mimmutable(1)
> +https://github.com/google/syzkaller/commit/bc009f82ea71c399f19eef28f115ff5cda7be4ba
> +
> +Index: desmume/src/arm_jit.cpp
> +--- desmume/src/arm_jit.cpp.orig
> ++++ desmume/src/arm_jit.cpp
> +@@ -205,7 +205,8 @@ static u8 recompile_counts[(1<<26)/16];
> + // Reduces memory needed for function pointers.
> + // FIXME win64 needs this too, x86_32 doesn't
> +
> +-DS_ALIGN(4096) static u8 scratchpad[1<<25];
> ++DS_ALIGN(4096) static u8 scratchpad[1<<25]
> ++ __attribute__((section(".openbsd.mutable")));
> + static u8 *scratchptr;
> +
> + struct ASMJIT_API StaticCodeGenerator : public Context
> Index: patches/patch-desmume_src_frontend_posix_gtk2_main_cpp
> ===================================================================
> RCS file: patches/patch-desmume_src_frontend_posix_gtk2_main_cpp
> diff -N patches/patch-desmume_src_frontend_posix_gtk2_main_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-desmume_src_frontend_posix_gtk2_main_cpp 26 Sep 2023 23:49:56 -0000
> @@ -0,0 +1,17 @@
> +https://forums.desmume.org/viewtopic.php?id=10415
> +
> +Index: desmume/src/frontend/posix/gtk2/main.cpp
> +--- desmume/src/frontend/posix/gtk2/main.cpp.orig
> ++++ desmume/src/frontend/posix/gtk2/main.cpp
> +@@ -3551,6 +3551,11 @@ common_gtk_main( class configured_features *my_config)
> +
> + gtk_container_add (GTK_CONTAINER (pVBox), pDrawingArea);
> +
> ++ /* Set a black background color for a usable full-screen mode. */
> ++ GdkColor color;
> ++ memset(&color, 0, sizeof(color));
> ++ gtk_widget_modify_bg(pDrawingArea, GTK_STATE_NORMAL, &color);
> ++
> + gtk_widget_set_events(pDrawingArea,
> + GDK_EXPOSURE_MASK | GDK_LEAVE_NOTIFY_MASK |
> + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
> Index: patches/patch-desmume_src_libretro-common_rthreads_rthreads_c
> ===================================================================
> RCS file: patches/patch-desmume_src_libretro-common_rthreads_rthreads_c
> diff -N patches/patch-desmume_src_libretro-common_rthreads_rthreads_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-desmume_src_libretro-common_rthreads_rthreads_c 26 Sep 2023 23:49:56 -0000
> @@ -0,0 +1,14 @@
> +OpenBSD does not implement pthread_setname_np
> +
> +Index: desmume/src/libretro-common/rthreads/rthreads.c
> +--- desmume/src/libretro-common/rthreads/rthreads.c.orig
> ++++ desmume/src/libretro-common/rthreads/rthreads.c
> +@@ -323,7 +323,7 @@ void sthread_setname(sthread_t *thread, const char *na
> + // any thread. At the time of this writing (2021/08/30), there is no way to
> + // set the thread name from a different thread when running an Apple OS.
> + #if !defined(USE_WIN32_THREADS) && !defined(__APPLE__)
> +- pthread_setname_np(thread->id, name);
> ++ pthread_set_name_np(thread->id, name);
> +

No comments:

Post a Comment