mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
Initial import of dosbox-x-2023.10.26.
ok thfr@
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
COMMENT= x86 with DOS emulator targeted at playing games
|
||||
|
||||
VERSION= 2023.10.06
|
||||
DISTNAME= dosbox-x-v${VERSION}
|
||||
PKGNAME= dosbox-x-${VERSION}
|
||||
CATEGORIES= games x11 emulators
|
||||
|
||||
GH_ACCOUNT= joncampbell123
|
||||
GH_PROJECT= dosbox-x
|
||||
GH_TAGNAME= dosbox-x-v${VERSION}
|
||||
|
||||
HOMEPAGE= https://dosbox-x.com/
|
||||
|
||||
MAINTAINER= SASANO Takayoshi <uaa@openbsd.org>
|
||||
|
||||
# GPLv2+
|
||||
PERMIT_PACKAGE= Yes
|
||||
|
||||
WANTLIB += GL SDL2 SDL2_net ${COMPILER_LIBCXX} c m png X11 pthread sndio z
|
||||
WANTLIB += Xrandr freetype pcap xkbfile avcodec avformat avutil
|
||||
WANTLIB += glib-2.0 iconv intl swresample swscale slirp fluidsynth
|
||||
|
||||
FIX_CRLF_FILES = Makefile.am include/dos_inc.h
|
||||
|
||||
COMPILER = base-clang ports-gcc base-gcc
|
||||
|
||||
LIB_DEPENDS= audio/fluidsynth \
|
||||
devel/sdl2 \
|
||||
devel/sdl2-net \
|
||||
graphics/png \
|
||||
graphics/ffmpeg \
|
||||
net/libslirp
|
||||
|
||||
RUN_DEPENDS = devel/desktop-file-utils \
|
||||
x11/gtk+4,-guic
|
||||
|
||||
NO_TEST= Yes
|
||||
|
||||
AUTOCONF_VERSION= 2.69
|
||||
AUTOMAKE_VERSION= 1.12
|
||||
|
||||
CONFIGURE_STYLE= autoreconf
|
||||
CONFIGURE_ENV=CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include"
|
||||
CONFIGURE_ENV+=LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
|
||||
CONFIGURE_ARGS+= --disable-alsatest --disable-sdl --enable-sdl2
|
||||
|
||||
# needs W+X memory
|
||||
CONFIGURE_ARGS+= --disable-dynamic-core
|
||||
|
||||
pre-configure:
|
||||
cp ${FILESDIR}/midi_sndio.h ${WRKSRC}/src/gui
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.debugger ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.joystick ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.keyboard-layout-handling ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.source-code-description ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.video ${PREFIX}/share/doc/dosbox
|
||||
${INSTALL_DATA} ${WRKSRC}/README.xbrz ${PREFIX}/share/doc/dosbox
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1,2 @@
|
||||
SHA256 (dosbox-x-v2023.10.06.tar.gz) = ZfdW4p+cm4mP29IrDLmzskxuO+y13NpYiqIKP96VOaU=
|
||||
SIZE (dosbox-x-v2023.10.06.tar.gz) = 119420489
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2010 The DOSBox Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <sndio.h>
|
||||
|
||||
class MidiHandler_sndio: public MidiHandler {
|
||||
private:
|
||||
struct mio_hdl *hdl;
|
||||
public:
|
||||
MidiHandler_sndio() : MidiHandler(), hdl(NULL) {};
|
||||
const char * GetName(void) { return "sndio"; }
|
||||
bool Open(const char * conf) {
|
||||
if (hdl) return false;
|
||||
hdl = mio_open((conf && conf[0]) ? conf : MIO_PORTANY, MIO_OUT, 0);
|
||||
return (hdl != NULL);
|
||||
};
|
||||
void Close(void) {
|
||||
if (!hdl) return;
|
||||
mio_close(hdl);
|
||||
hdl = NULL;
|
||||
};
|
||||
void PlayMsg(uint8_t * msg) {
|
||||
Bitu len=MIDI_evt_len[*msg];
|
||||
if (hdl) mio_write(hdl, msg, len);
|
||||
};
|
||||
void PlaySysex(uint8_t * sysex,Bitu len) {
|
||||
if (hdl) mio_write(hdl, sysex, len);
|
||||
}
|
||||
};
|
||||
|
||||
MidiHandler_sndio Midi_sndio;
|
||||
@@ -0,0 +1,14 @@
|
||||
--- Makefile.am.orig.port Mon Nov 27 22:44:22 2023
|
||||
+++ Makefile.am Mon Nov 27 22:44:22 2023
|
||||
@@ -163,11 +163,9 @@ install: src/dosbox-x
|
||||
install -m 644 $(srcdir)/contrib/linux/dosbox-x.1 $(DESTDIR)$(mandir)/man1
|
||||
mkdir -p $(DESTDIR)$(prefix)/share/bash-completion/completions
|
||||
install -m 644 $(srcdir)/contrib/linux/dosbox-x $(DESTDIR)$(prefix)/share/bash-completion/completions
|
||||
- -command -v setcap >/dev/null && setcap cap_net_raw=ep $(DESTDIR)$(bindir)/dosbox-x
|
||||
|
||||
install_strip: src/dosbox-x install
|
||||
install -m 755 -s src/dosbox-x $(DESTDIR)$(bindir)
|
||||
- -command -v setcap >/dev/null && setcap cap_net_raw=ep $(DESTDIR)$(bindir)/dosbox-x
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(bindir)/dosbox-x
|
||||
@@ -0,0 +1,27 @@
|
||||
--- configure.ac.orig Thu Nov 2 18:58:53 2023
|
||||
+++ configure.ac Fri Nov 3 05:04:23 2023
|
||||
@@ -97,6 +97,24 @@ AC_PREFIX_DEFAULT([/usr/local])
|
||||
dnl this code needs large file support on 32-bit systems
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
+dnl enable disable sndio and pass it's cflags to CXXFLAGS
|
||||
+AH_TEMPLATE([HAVE_SNDIO],[Determines if sndio is available on the system.])
|
||||
+AC_ARG_ENABLE(sndio-midi,
|
||||
+AC_HELP_STRING([--enable-sndio-midi],[compile with sndio midi support (default yes)]),
|
||||
+[ case "${enableval}" in
|
||||
+ yes) sndio_midi=true;;
|
||||
+ no) sndio_midi=false;;
|
||||
+esac],
|
||||
+[sndio_midi=true])
|
||||
+if test x$sndio_midi = xtrue ; then
|
||||
+ AC_CHECK_HEADER(sndio.h,have_sndio_h=yes,)
|
||||
+ AC_CHECK_LIB(sndio, sio_initpar, have_sndio_lib=yes, , )
|
||||
+ if test x$have_sndio_lib = xyes -a x$have_sndio_h = xyes ; then
|
||||
+ LIBS="$LIBS -lsndio"
|
||||
+ AC_DEFINE(HAVE_SNDIO,1)
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
#Check for big endian machine, should #define WORDS_BIGENDIAN if so
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- include/dos_inc.h.orig.port Mon Nov 27 22:44:22 2023
|
||||
+++ include/dos_inc.h Mon Nov 27 22:44:22 2023
|
||||
@@ -390,7 +390,7 @@ static INLINE uint16_t DOS_PackDate(uint16_t year,uint
|
||||
|
||||
|
||||
/* Remains some classes used to access certain things */
|
||||
-#define sOffset(s,m) ((char*)&(((s*)NULL)->m)-(char*)NULL)
|
||||
+#define sOffset(s,m) offsetof(s,m)
|
||||
#define sGet(s,m) GetIt(sizeof(((s *)&pt)->m),(PhysPt)sOffset(s,m))
|
||||
#define sSave(s,m,val) SaveIt(sizeof(((s *)&pt)->m),(PhysPt)sOffset(s,m),val)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
%ebx is used by PIE so as-is this doesn't build on i386 as the compiler
|
||||
detects that the register has been clobbered. dosbox has some alternative
|
||||
code for MacOS X to avoid using %ebx so make use of this. This is done by
|
||||
enabling all the OSX-related changes in this file; some of these are for
|
||||
another purpose (to deal with aligning the stack on 16 bytes which they
|
||||
do as they use SSE extensively, see ABI docs and libgmalloc manual) which
|
||||
wouldn't be needed on OpenBSD, but as I don't have full understanding of
|
||||
the asm and how different parts interact, it seems safer to enable all
|
||||
the related code together. -sthen
|
||||
|
||||
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.htm
|
||||
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/libgmalloc.3.html
|
||||
|
||||
--- src/cpu/core_dyn_x86/risc_x86.h.orig Thu Nov 2 18:58:55 2023
|
||||
+++ src/cpu/core_dyn_x86/risc_x86.h Fri Nov 3 05:17:36 2023
|
||||
@@ -110,7 +110,7 @@ return_address:
|
||||
pop ebx
|
||||
mov [retval],eax
|
||||
}
|
||||
-#elif defined (MACOSX)
|
||||
+#elif defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
register uint32_t tempflags=reg_flags & FMASK_TEST;
|
||||
__asm__ volatile (
|
||||
"pushl %%ebx \n"
|
||||
@@ -786,7 +786,7 @@ static void gen_call_function(void * func,char const*
|
||||
if (ops) {
|
||||
va_list params;
|
||||
va_start(params,ops);
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
Bitu stack_used=0;
|
||||
bool free_flags=false;
|
||||
#endif
|
||||
@@ -795,7 +795,7 @@ static void gen_call_function(void * func,char const*
|
||||
if (*ops=='%') {
|
||||
pinfo[pindex].line=ops+1;
|
||||
pinfo[pindex].value=va_arg(params,Bitu);
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
const char * scan=pinfo[pindex].line;
|
||||
if ((*scan=='I') || (*scan=='D')) stack_used+=4;
|
||||
else if (*scan=='F') free_flags=true;
|
||||
@@ -806,7 +806,7 @@ static void gen_call_function(void * func,char const*
|
||||
}
|
||||
va_end(params);
|
||||
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
/* align stack */
|
||||
stack_used+=4; // saving esp on stack as well
|
||||
|
||||
@@ -881,7 +881,7 @@ static void gen_call_function(void * func,char const*
|
||||
IllegalOption("gen_call_function unknown param");
|
||||
}
|
||||
}
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
if (free_flags) release_flags=false;
|
||||
} else {
|
||||
/* align stack */
|
||||
@@ -941,7 +941,7 @@ static void gen_call_function(void * func,char const*
|
||||
/* Restore EAX registers to be used again */
|
||||
x86gen.regs[X86_REG_EAX]->notusable=false;
|
||||
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
/* restore stack */
|
||||
cache_addb(0x5c); // pop esp
|
||||
#endif
|
||||
@@ -953,7 +953,7 @@ static void gen_call_write(DynReg * dr,uint32_t val,Bi
|
||||
x86gen.regs[X86_REG_EAX]->notusable=true;
|
||||
gen_protectflags();
|
||||
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
/* align stack */
|
||||
Bitu stack_used=12;
|
||||
|
||||
@@ -993,7 +993,7 @@ static void gen_call_write(DynReg * dr,uint32_t val,Bi
|
||||
x86gen.regs[X86_REG_EAX]->notusable=false;
|
||||
gen_releasereg(dr);
|
||||
|
||||
-#if defined (MACOSX)
|
||||
+#if defined (MACOSX) || (defined (__OpenBSD__) && defined(__i386__))
|
||||
/* restore stack */
|
||||
cache_addb(0x5c); // pop esp
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
--- src/dos/dos_programs.cpp.orig Sat Oct 7 14:52:23 2023
|
||||
+++ src/dos/dos_programs.cpp Fri Nov 3 05:51:29 2023
|
||||
@@ -5926,7 +5926,7 @@ class IMGMOUNT : public Program {
|
||||
FILE* newDisk = fopen_lock(fname, ro ? "rb" : "rb+", ro);
|
||||
if(!newDisk) {
|
||||
if(!qmount) WriteOut("Unable to open '%s'\n", fname);
|
||||
- return NULL;
|
||||
+ return false;
|
||||
}
|
||||
QCow2Image::QCow2Header qcow2_header = QCow2Image::read_header(newDisk);
|
||||
// uint64_t sectors; /* unused */
|
||||
@@ -5936,7 +5936,7 @@ class IMGMOUNT : public Program {
|
||||
uint32_t cluster_size = 1u << qcow2_header.cluster_bits;
|
||||
if((sizes[0] < 512) || ((cluster_size % sizes[0]) != 0)) {
|
||||
WriteOut("Sector size must be larger than 512 bytes and evenly divide the image cluster size of %lu bytes.\n", cluster_size);
|
||||
- return 0;
|
||||
+ return false;
|
||||
}
|
||||
// sectors = (uint64_t)qcow2_header.size / (uint64_t)sizes[0]; /* unused */
|
||||
imagesize = (uint32_t)(qcow2_header.size / 1024L);
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/gui/Makefile.am.orig Thu Nov 2 18:58:55 2023
|
||||
+++ src/gui/Makefile.am Fri Nov 3 05:10:28 2023
|
||||
@@ -8,7 +8,7 @@ libgui_a_SOURCES = \
|
||||
render_templates.h render_loops.h render_simple.h \
|
||||
render_templates_sai.h render_templates_hq.h \
|
||||
render_templates_hq2x.h render_templates_hq3x.h \
|
||||
- midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h \
|
||||
+ midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_sndio.h \
|
||||
midi_alsa.h midi_coremidi.h sdl_gui.cpp dosbox_splash.h \
|
||||
menu.cpp menu_callback.cpp bitop.cpp ptrop.cpp zipcrc.c zipfile.cpp
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--- src/gui/midi.cpp.orig Thu Nov 2 18:58:55 2023
|
||||
+++ src/gui/midi.cpp Fri Nov 3 05:13:47 2023
|
||||
@@ -115,6 +115,10 @@ static struct {
|
||||
|
||||
#include "midi_win32.h"
|
||||
|
||||
+#elif defined (HAVE_SNDIO)
|
||||
+
|
||||
+#include "midi_sndio.h"
|
||||
+
|
||||
#else
|
||||
|
||||
#include "midi_oss.h"
|
||||
@@ -0,0 +1,12 @@
|
||||
DOSBox-X is a fork of DOSBox cross-platform DOS emulator.
|
||||
|
||||
This is a platform for running DOS applications, including emulating the
|
||||
environments to run Windows 3.x, 9x and ME and software written for those
|
||||
versions of Windows. Moreover, DOSBox-X supports DOS/V and NEC PC-98
|
||||
emulations so that you can play DOS/V and PC-98 games with it.
|
||||
|
||||
Compared with DOSBox, DOSBox-X focuses more on general emulation and accuracy.
|
||||
The goal of this project is to make a complete emulation package that covers
|
||||
all pre-2000 DOS and Windows 9x based system scenarios, including peripherals,
|
||||
motherboards, CPUs, and all manner of hardware that was made for PC hardware
|
||||
of that time.
|
||||
@@ -0,0 +1,82 @@
|
||||
@bin bin/dosbox-x
|
||||
@man man/man1/dosbox-x.1
|
||||
share/applications/com.dosbox_x.DOSBox-X.desktop
|
||||
share/bash-completion/completions/dosbox-x
|
||||
share/doc/dosbox/
|
||||
share/doc/dosbox/README.debugger
|
||||
share/doc/dosbox/README.joystick
|
||||
share/doc/dosbox/README.keyboard-layout-handling
|
||||
share/doc/dosbox/README.md
|
||||
share/doc/dosbox/README.source-code-description
|
||||
share/doc/dosbox/README.video
|
||||
share/doc/dosbox/README.xbrz
|
||||
share/dosbox-x/
|
||||
share/dosbox-x/CHANGELOG
|
||||
share/dosbox-x/FREECG98.BMP
|
||||
share/dosbox-x/Nouveau_IBM.ttf
|
||||
share/dosbox-x/SarasaGothicFixed.ttf
|
||||
share/dosbox-x/dosbox-x.reference.conf
|
||||
share/dosbox-x/dosbox-x.reference.full.conf
|
||||
share/dosbox-x/drivez/
|
||||
share/dosbox-x/drivez/readme.txt
|
||||
share/dosbox-x/glshaders/
|
||||
share/dosbox-x/glshaders/ScanLine.glsl
|
||||
share/dosbox-x/glshaders/advinterp2x.glsl
|
||||
share/dosbox-x/glshaders/advinterp3x.glsl
|
||||
share/dosbox-x/glshaders/advmame2x.glsl
|
||||
share/dosbox-x/glshaders/advmame3x.glsl
|
||||
share/dosbox-x/glshaders/crt-aperture.glsl
|
||||
share/dosbox-x/glshaders/crt-caligari.glsl
|
||||
share/dosbox-x/glshaders/crt-easymode.glsl
|
||||
share/dosbox-x/glshaders/crt-easymode.tweaked.glsl
|
||||
share/dosbox-x/glshaders/crt-geom.glsl
|
||||
share/dosbox-x/glshaders/crt-geom.tweaked.glsl
|
||||
share/dosbox-x/glshaders/crt-hyllian.glsl
|
||||
share/dosbox-x/glshaders/crt-lottes-fast.glsl
|
||||
share/dosbox-x/glshaders/crt-lottes-fast.subtle+gain.glsl
|
||||
share/dosbox-x/glshaders/crt-lottes.glsl
|
||||
share/dosbox-x/glshaders/crt-lottes.tweaked.glsl
|
||||
share/dosbox-x/glshaders/crt-nes-mini.glsl
|
||||
share/dosbox-x/glshaders/crt-pi.glsl
|
||||
share/dosbox-x/glshaders/default.glsl
|
||||
share/dosbox-x/glshaders/fakelottes.glsl
|
||||
share/dosbox-x/glshaders/fakelottes.tweaked.glsl
|
||||
share/dosbox-x/glshaders/none.glsl
|
||||
share/dosbox-x/glshaders/pixel_perfect-scanlines.glsl
|
||||
share/dosbox-x/glshaders/pixel_perfect.glsl
|
||||
share/dosbox-x/glshaders/pixellate.glsl
|
||||
share/dosbox-x/glshaders/rgb2x.glsl
|
||||
share/dosbox-x/glshaders/rgb3x.glsl
|
||||
share/dosbox-x/glshaders/scan2x.glsl
|
||||
share/dosbox-x/glshaders/scan3x.glsl
|
||||
share/dosbox-x/glshaders/sharp.glsl
|
||||
share/dosbox-x/glshaders/tv2x.glsl
|
||||
share/dosbox-x/glshaders/tv3x.glsl
|
||||
share/dosbox-x/glshaders/xbr-lv2-3d.glsl
|
||||
share/dosbox-x/glshaders/xbr-lv2-noblend.glsl
|
||||
share/dosbox-x/glshaders/xbr-lv2.glsl
|
||||
share/dosbox-x/glshaders/xbr-lv3.glsl
|
||||
share/dosbox-x/glshaders/yee64.glsl
|
||||
share/dosbox-x/glshaders/yeetron.glsl
|
||||
share/dosbox-x/glshaders/zfast_crt.glsl
|
||||
share/dosbox-x/languages/
|
||||
share/dosbox-x/languages/de_DE.lng
|
||||
share/dosbox-x/languages/de_pc98.lng
|
||||
share/dosbox-x/languages/en_US.lng
|
||||
share/dosbox-x/languages/es_ES.lng
|
||||
share/dosbox-x/languages/fr_FR.lng
|
||||
share/dosbox-x/languages/it_IT.lng
|
||||
share/dosbox-x/languages/ja_JP.lng
|
||||
share/dosbox-x/languages/ko_KR.lng
|
||||
share/dosbox-x/languages/nl_NL.lng
|
||||
share/dosbox-x/languages/pt_BR.lng
|
||||
share/dosbox-x/languages/tr_TR.lng
|
||||
share/dosbox-x/languages/zh_CN.lng
|
||||
share/dosbox-x/languages/zh_TW.lng
|
||||
share/dosbox-x/wqy_11pt.bdf
|
||||
share/dosbox-x/wqy_12pt.bdf
|
||||
share/icons/hicolor/scalable/apps/dosbox-x.svg
|
||||
share/metainfo/
|
||||
share/metainfo/com.dosbox_x.DOSBox-X.metainfo.xml
|
||||
@tag update-desktop-database
|
||||
@tag gtk-update-icon-cache %D/share/icons/hicolor
|
||||
Reference in New Issue
Block a user