git: be396f0514bb - main - emulators/dosbox-x: update to 2023.10.06

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Sun, 18 Feb 2024 15:30:25 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=be396f0514bb4834a4be13c4f32e710f1b41083d

commit be396f0514bb4834a4be13c4f32e710f1b41083d
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-02-18 15:01:10 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-02-18 15:30:11 +0000

    emulators/dosbox-x: update to 2023.10.06
    
    Release Notes: https://dosbox-x.com/release-2023.10.06.html
    Also move manpage in share/ and add several build options.
    
    Approved by:            arrowd (mentor)
    Differential Revision:  https://reviews.freebsd.org/D43959
---
 emulators/dosbox-x/Makefile                        | 44 ++++++++++++++++++----
 emulators/dosbox-x/distinfo                        |  8 ++--
 emulators/dosbox-x/files/patch-configure.ac        | 14 +++++++
 emulators/dosbox-x/files/patch-src_gui_sdlmain.cpp | 11 ------
 emulators/dosbox-x/pkg-descr                       |  5 ++-
 emulators/dosbox-x/pkg-plist                       |  4 +-
 6 files changed, 63 insertions(+), 23 deletions(-)

diff --git a/emulators/dosbox-x/Makefile b/emulators/dosbox-x/Makefile
index fb66b3c95c98..2229c7a8549b 100644
--- a/emulators/dosbox-x/Makefile
+++ b/emulators/dosbox-x/Makefile
@@ -1,31 +1,61 @@
 PORTNAME=	dosbox-x
 DISTVERSIONPREFIX=	${PORTNAME}-v
-DISTVERSION=	2022.12.26
+DISTVERSION=	2023.10.06
 CATEGORIES=	emulators
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/
+PATCHFILES+=	48c13acd1f3048891252cb92087cb6b20c29dc16.patch:-p1
+# https://github.com/joncampbell123/dosbox-x/pull/4575
+# dos_programs.cpp:5929:17: error: cannot initialize return object of type 'bool' with an rvalue of type 'std::nullptr_t'
+
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	DOSBox fork
 WWW=		https://dosbox-x.com/
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	libpng.so:graphics/png
-
-USES=		autoreconf iconv sdl
+LIB_DEPENDS=	libpng.so:graphics/png \
+		libslirp.so:net/libslirp
+BUILD_DEPENDS=	${BUILD_DEPENDS_${ARCH}}
+BUILD_DEPENDS_amd64=	nasm:devel/nasm
+BUILD_DEPENDS_i386=	nasm:devel/nasm
+
+USES=		autoreconf gettext-runtime gl gnome iconv localbase pkgconfig sdl xorg
+USE_GL=		gl
+USE_GNOME=	glib20
+USE_SDL=	net2 sdl2
+USE_XORG=	x11 xkbfile xrandr
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--enable-core-inline
-USE_SDL=	net sdl sound
+GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
+CONFIGURE_ARGS=	--disable-emscripten --enable-hx-dos --enable-libslirp --enable-mt32 \
+		--enable-opengl --enable-printer --disable-sdl --enable-sdl2 --enable-x11
+INSTALL_TARGET=	install_strip
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	joncampbell123
 
-OPTIONS_DEFINE=		DOCS
+OPTIONS_DEFINE=		ALSA DOCS FFMPEG FLUIDSYNTH FREETYPE
+OPTIONS_DEFAULT=	FFMPEG FLUIDSYNTH
 OPTIONS_RADIO=		DEBUGGER
 OPTIONS_RADIO_DEBUGGER=	DEBUGGER_ENABLE DEBUGGER_HEAVY
+
+ALSA_DESC=		ALSA midi support
+ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
+ALSA_CONFIGURE_ENABLE=	alsa alsa-midi alsatest
+
 DEBUGGER_ENABLE_DESC=	Enable internal debugger
 DEBUGGER_HEAVY_DESC=	Enable internal debugger with extra features
 
 DEBUGGER_ENABLE_CONFIGURE_ON=	--enable-debug=yes
 DEBUGGER_HEAVY_CONFIGURE_ON=	--enable-debug=heavy
 
+FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
+FFMPEG_CONFIGURE_ENABLE=	avcodec
+
+FLUIDSYNTH_LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth
+FLUIDSYNTH_CONFIGURE_ENABLE=	libfluidsynth
+
+FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
+FREETYPE_CONFIGURE_ENABLE=	freetype
+
 .include <bsd.port.mk>
diff --git a/emulators/dosbox-x/distinfo b/emulators/dosbox-x/distinfo
index d3dd9aac5cfa..c8754dbaa325 100644
--- a/emulators/dosbox-x/distinfo
+++ b/emulators/dosbox-x/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1674249678
-SHA256 (joncampbell123-dosbox-x-dosbox-x-v2022.12.26_GH0.tar.gz) = 39fb1ed19ea31e11883aa57655493b3100ac6b328ef59c799b840b9bfdfacb7b
-SIZE (joncampbell123-dosbox-x-dosbox-x-v2022.12.26_GH0.tar.gz) = 67886370
+TIMESTAMP = 1708108946
+SHA256 (joncampbell123-dosbox-x-dosbox-x-v2023.10.06_GH0.tar.gz) = 65f756e29f9c9b898fdbd22b0cb9b3b24c6e3becb5dcda588aa20a3fde9539a5
+SIZE (joncampbell123-dosbox-x-dosbox-x-v2023.10.06_GH0.tar.gz) = 119420489
+SHA256 (48c13acd1f3048891252cb92087cb6b20c29dc16.patch) = 38896e53c3b594dd31ac0aa9d347acb90ebc6fe199bd84ff7a8acb2913e538b1
+SIZE (48c13acd1f3048891252cb92087cb6b20c29dc16.patch) = 1574
diff --git a/emulators/dosbox-x/files/patch-configure.ac b/emulators/dosbox-x/files/patch-configure.ac
new file mode 100644
index 000000000000..cb301169b08a
--- /dev/null
+++ b/emulators/dosbox-x/files/patch-configure.ac
@@ -0,0 +1,14 @@
+--- configure.ac.orig	2023-10-07 05:52:23 UTC
++++ configure.ac
+@@ -656,7 +656,10 @@ esac
+ dnl TODO: Need GCC to know this code is using C++ lamda functions
+ 
+ dnl LIBRARY TEST: ALSA
+-AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : )
++AC_ARG_ENABLE(alsa,AC_HELP_STRING([--disable-alsa],[Disable ALSA]),,enable_alsa=yes)
++if test x$enable_alsa != xno; then
++    AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : )
++fi
+ 
+ dnl Some stuff for the icon.
+ case "$host" in
diff --git a/emulators/dosbox-x/files/patch-src_gui_sdlmain.cpp b/emulators/dosbox-x/files/patch-src_gui_sdlmain.cpp
deleted file mode 100644
index fca740b9fb78..000000000000
--- a/emulators/dosbox-x/files/patch-src_gui_sdlmain.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/gui/sdlmain.cpp.orig	2023-01-20 21:33:36 UTC
-+++ src/gui/sdlmain.cpp
-@@ -221,7 +221,7 @@ typedef enum PROCESS_DPI_AWARENESS {
- extern "C" void sdl1_hax_macosx_highdpi_set_enable(const bool enable);
- #endif
- 
--#if !defined(C_SDL2) && !defined(RISCOS)
-+#if !defined(C_SDL2) && !defined(RISCOS) && !defined(__FreeBSD__)
- # include "SDL_version.h"
- # ifndef SDL_DOSBOX_X_SPECIAL
- #  warning It is STRONGLY RECOMMENDED to compile the DOSBox-X code using the SDL 1.x library provided in this source repository.
diff --git a/emulators/dosbox-x/pkg-descr b/emulators/dosbox-x/pkg-descr
index 8282a28f7044..978c72e0107d 100644
--- a/emulators/dosbox-x/pkg-descr
+++ b/emulators/dosbox-x/pkg-descr
@@ -1 +1,4 @@
-DOSBox-X is a cross-platform DOS emulator based on the DOSBox project.
+DOSBox-X is an open-source cross-platform DOS emulator for running DOS
+applications and games based on the DOSBox project.
+DOS-based Windows such as Windows 3.x and Windows 9x are officially supported.
+Compared to DOSBox, DOSBox-X is much more flexible and provides more features.
diff --git a/emulators/dosbox-x/pkg-plist b/emulators/dosbox-x/pkg-plist
index 4be9a9fd2f23..cb0eec10f919 100644
--- a/emulators/dosbox-x/pkg-plist
+++ b/emulators/dosbox-x/pkg-plist
@@ -1,5 +1,4 @@
 bin/dosbox-x
-man/man1/dosbox-x.1.gz
 share/applications/com.dosbox_x.DOSBox-X.desktop
 share/bash-completion/completions/dosbox-x
 %%DATADIR%%/CHANGELOG
@@ -49,9 +48,11 @@ share/bash-completion/completions/dosbox-x
 %%DATADIR%%/glshaders/yeetron.glsl
 %%DATADIR%%/glshaders/zfast_crt.glsl
 %%DATADIR%%/languages/de_DE.lng
+%%DATADIR%%/languages/de_pc98.lng
 %%DATADIR%%/languages/en_US.lng
 %%DATADIR%%/languages/es_ES.lng
 %%DATADIR%%/languages/fr_FR.lng
+%%DATADIR%%/languages/it_IT.lng
 %%DATADIR%%/languages/ja_JP.lng
 %%DATADIR%%/languages/ko_KR.lng
 %%DATADIR%%/languages/nl_NL.lng
@@ -62,4 +63,5 @@ share/bash-completion/completions/dosbox-x
 %%DATADIR%%/wqy_11pt.bdf
 %%DATADIR%%/wqy_12pt.bdf
 share/icons/hicolor/scalable/apps/dosbox-x.svg
+share/man/man1/dosbox-x.1.gz
 share/metainfo/com.dosbox_x.DOSBox-X.metainfo.xml