mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
Ports: Add port for DOSBox Staging
This commit is contained in:
parent
cf79b499f6
commit
94f56b5f6d
Notes:
sideshowbarker
2024-07-18 12:05:18 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/94f56b5f6dc Pull-request: https://github.com/SerenityOS/serenity/pull/8134
7 changed files with 138 additions and 0 deletions
|
@ -25,6 +25,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
|
|||
| [`diffutils`](diffutils/) | GNU Diffutils | 3.7 | https://www.gnu.org/software/diffutils/ |
|
||||
| [`dmidecode`](dmidecode/) | dmidecode | 3.3 | https://github.com/mirror/dmidecode |
|
||||
| [`doom`](doom/) | DOOM | | https://github.com/SerenityOS/SerenityDOOM |
|
||||
| [`dosbox-staging`](dosbox-staging/) | DOSBox Staging | 0.76.0 | https://dosbox-staging.github.io/ |
|
||||
| [`dropbear`](dropbear/) | Dropbear SSH | 2019.78 | https://dropbear.nl/mirror/dropbear.html |
|
||||
| [`dungeonrush`](dungeonrush/) | DungeonRush | 1.1-beta | https://github.com/Rapiz1/DungeonRush |
|
||||
| [`ed`](ed/) | GNU ed | 1.15 | https://www.gnu.org/software/ed/ |
|
||||
|
|
20
Ports/dosbox-staging/package.sh
Executable file
20
Ports/dosbox-staging/package.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port=dosbox-staging
|
||||
version=0.76.0
|
||||
useconfigure=true
|
||||
configopts='--disable-opus-cdda --disable-fluidsynth --disable-dynamic-core'
|
||||
files="https://github.com/dosbox-staging/dosbox-staging/archive/refs/tags/v${version}.tar.gz v${version}.tar.gz 7df53c22f7ce78c70afb60b26b06742b90193b56c510219979bf12e0bb2dc6c7"
|
||||
auth_type=sha256
|
||||
depends=SDL2
|
||||
launcher_name=DOSBox
|
||||
launcher_category=Games
|
||||
launcher_command=/usr/local/bin/dosbox
|
||||
icon_file=contrib/icons/dosbox-staging.ico
|
||||
|
||||
export CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
|
||||
export CPPFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
|
||||
|
||||
pre_configure() {
|
||||
run ./autogen.sh
|
||||
run sed -i 's@irix\* \\@irix* | serenity* \\@' config.sub
|
||||
}
|
34
Ports/dosbox-staging/patches/glob.patch
Normal file
34
Ports/dosbox-staging/patches/glob.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
diff -Naur dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp dosbox-staging-0.76.0.serenity/src/misc/fs_utils_posix.cpp
|
||||
--- dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp 2021-06-18 15:09:39.038730252 +0200
|
||||
+++ dosbox-staging-0.76.0.serenity/src/misc/fs_utils_posix.cpp 2021-06-18 15:08:17.603767140 +0200
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
#include <cerrno>
|
||||
#include <cctype>
|
||||
+#ifndef __serenity__
|
||||
#include <glob.h>
|
||||
+#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
diff -Naur dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp dosbox-staging-0.76.0.serenity/src/misc/fs_utils_posix.cpp
|
||||
--- dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp 2020-12-03 19:36:19.000000000 +0100
|
||||
+++ dosbox-staging-0.76.0.serenity/src/misc/fs_utils_posix.cpp 2021-06-18 14:41:19.022036547 +0200
|
||||
@@ -75,6 +75,7 @@
|
||||
// glob(3) sorts by default, so if more than one path will match
|
||||
// the pattern, return the first one (in alphabetic order) that matches.
|
||||
const std::string pattern = translate_to_glob_pattern(path);
|
||||
+#ifndef __serenity__
|
||||
glob_t pglob;
|
||||
const int err = glob(pattern.c_str(), GLOB_TILDE, nullptr, &pglob);
|
||||
if (err == GLOB_NOMATCH) {
|
||||
@@ -96,6 +97,9 @@
|
||||
const std::string ret = pglob.gl_pathv[0];
|
||||
globfree(&pglob);
|
||||
return ret;
|
||||
+#else
|
||||
+ return path;
|
||||
+#endif
|
||||
}
|
||||
|
||||
int create_dir(const char *path, uint32_t mode, uint32_t flags) noexcept
|
21
Ports/dosbox-staging/patches/gus.patch
Normal file
21
Ports/dosbox-staging/patches/gus.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
diff -Naur dosbox-staging-0.76.0/src/hardware/gus.cpp dosbox-staging-0.76.0.serenity/src/hardware/gus.cpp
|
||||
--- dosbox-staging-0.76.0/src/hardware/gus.cpp 2020-12-03 19:36:19.000000000 +0100
|
||||
+++ dosbox-staging-0.76.0.serenity/src/hardware/gus.cpp 2021-06-18 14:10:46.735285326 +0200
|
||||
@@ -245,7 +245,7 @@
|
||||
void PopulatePanScalars() noexcept;
|
||||
void PopulateVolScalars() noexcept;
|
||||
void PrepareForPlayback() noexcept;
|
||||
- size_t ReadFromPort(const size_t port, const size_t iolen);
|
||||
+ Bitu ReadFromPort(const Bitu port, const Bitu iolen);
|
||||
void RegisterIoHandlers();
|
||||
void Reset(uint8_t state);
|
||||
void SetLevelCallback(const AudioFrame &level);
|
||||
@@ -253,7 +253,7 @@
|
||||
void UpdateDmaAddress(uint8_t new_address);
|
||||
void UpdateWaveMsw(int32_t &addr) const noexcept;
|
||||
void UpdateWaveLsw(int32_t &addr) const noexcept;
|
||||
- void WriteToPort(size_t port, size_t val, size_t iolen);
|
||||
+ void WriteToPort(Bitu port, Bitu val, Bitu iolen);
|
||||
void WriteToRegister();
|
||||
|
||||
// Collections
|
16
Ports/dosbox-staging/patches/sdl.patch
Normal file
16
Ports/dosbox-staging/patches/sdl.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
diff -Naur dosbox-staging-0.76.0/configure.ac dosbox-staging-0.76.0.serenity/configure.ac
|
||||
--- dosbox-staging-0.76.0/configure.ac 2020-12-03 19:36:19.000000000 +0100
|
||||
+++ dosbox-staging-0.76.0.serenity/configure.ac 2021-06-18 14:26:25.057372241 +0200
|
||||
@@ -45,10 +45,8 @@
|
||||
|
||||
dnl Check for SDL
|
||||
SDL_VERSION=2.0.2
|
||||
-AM_PATH_SDL($SDL_VERSION,
|
||||
- :,
|
||||
- AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
|
||||
-)
|
||||
+SDL_LIBS="-lSDL2"
|
||||
+SDL_CFLAGS=""
|
||||
PRESDL_LIBS="$LIBS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
|
11
Ports/dosbox-staging/patches/swrender.patch
Normal file
11
Ports/dosbox-staging/patches/swrender.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
diff -Naur dosbox-staging-0.76.0/src/gui/sdlmain.cpp dosbox-staging-0.76.0.serenity/src/gui/sdlmain.cpp
|
||||
--- dosbox-staging-0.76.0/src/gui/sdlmain.cpp 2020-12-03 19:36:19.000000000 +0100
|
||||
+++ dosbox-staging-0.76.0.serenity/src/gui/sdlmain.cpp 2021-06-18 14:44:11.245266708 +0200
|
||||
@@ -1048,7 +1048,6 @@
|
||||
if (sdl.render_driver != "auto")
|
||||
SDL_SetHint(SDL_HINT_RENDER_DRIVER, sdl.render_driver.c_str());
|
||||
sdl.renderer = SDL_CreateRenderer(sdl.window, -1,
|
||||
- SDL_RENDERER_ACCELERATED |
|
||||
(sdl.desktop.vsync ? SDL_RENDERER_PRESENTVSYNC : 0));
|
||||
if (!sdl.renderer) {
|
||||
LOG_MSG("%s\n", SDL_GetError());
|
35
Ports/dosbox-staging/patches/wchar.patch
Normal file
35
Ports/dosbox-staging/patches/wchar.patch
Normal file
|
@ -0,0 +1,35 @@
|
|||
diff -Naur dosbox-staging-0.76.0/src/libs/decoders/dr_mp3.h dosbox-staging-0.76.0.serenity/src/libs/decoders/dr_mp3.h
|
||||
--- dosbox-staging-0.76.0/src/libs/decoders/dr_mp3.h 2020-12-03 19:36:19.000000000 +0100
|
||||
+++ dosbox-staging-0.76.0.serenity/src/libs/decoders/dr_mp3.h 2021-06-18 14:15:49.491277178 +0200
|
||||
@@ -3378,6 +3378,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#ifndef __serenity__
|
||||
static drmp3_result drmp3_wfopen(FILE** ppFile, const wchar_t* pFilePath, const wchar_t* pOpenMode, const drmp3_allocation_callbacks* pAllocationCallbacks)
|
||||
{
|
||||
if (ppFile != NULL) {
|
||||
@@ -3459,6 +3460,7 @@
|
||||
|
||||
return DRMP3_SUCCESS;
|
||||
}
|
||||
+#endif
|
||||
|
||||
|
||||
|
||||
@@ -3482,6 +3484,7 @@
|
||||
return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
|
||||
}
|
||||
|
||||
+#ifndef __serenity__
|
||||
DRMP3_API drmp3_bool32 drmp3_init_file_w(drmp3* pMP3, const wchar_t* pFilePath, const drmp3_allocation_callbacks* pAllocationCallbacks)
|
||||
{
|
||||
FILE* pFile;
|
||||
@@ -3492,6 +3495,7 @@
|
||||
return drmp3_init(pMP3, drmp3__on_read_stdio, drmp3__on_seek_stdio, (void*)pFile, pAllocationCallbacks);
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
DRMP3_API void drmp3_uninit(drmp3* pMP3)
|
||||
{
|
Loading…
Reference in a new issue