From 5f986a91c6f268a3088ef2d5c215077eea7ce9d5 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 16 May 2022 19:21:32 +0430 Subject: [PATCH] Ports: Update dosbox-staging's patches to use git patches --- ...> 0001-Skip-use-of-glob-in-serenity.patch} | 27 ++++++++++++----- ...ch => 0002-Replace-some-size_t-Bitu.patch} | 25 ++++++++++++---- ...-Manually-hardcode-SDL2-library-name.patch | 29 +++++++++++++++++++ ...-Disable-SDL-s-accelerated-rendering.patch | 24 +++++++++++++++ Ports/dosbox-staging/patches/ReadMe.md | 25 ++++++++++++++++ Ports/dosbox-staging/patches/sdl.patch | 16 ---------- Ports/dosbox-staging/patches/swrender.patch | 11 ------- 7 files changed, 117 insertions(+), 40 deletions(-) rename Ports/dosbox-staging/patches/{glob.patch => 0001-Skip-use-of-glob-in-serenity.patch} (51%) rename Ports/dosbox-staging/patches/{gus.patch => 0002-Replace-some-size_t-Bitu.patch} (51%) create mode 100644 Ports/dosbox-staging/patches/0003-Manually-hardcode-SDL2-library-name.patch create mode 100644 Ports/dosbox-staging/patches/0004-Disable-SDL-s-accelerated-rendering.patch create mode 100644 Ports/dosbox-staging/patches/ReadMe.md delete mode 100644 Ports/dosbox-staging/patches/sdl.patch delete mode 100644 Ports/dosbox-staging/patches/swrender.patch diff --git a/Ports/dosbox-staging/patches/glob.patch b/Ports/dosbox-staging/patches/0001-Skip-use-of-glob-in-serenity.patch similarity index 51% rename from Ports/dosbox-staging/patches/glob.patch rename to Ports/dosbox-staging/patches/0001-Skip-use-of-glob-in-serenity.patch index e57495d32d..7169da756f 100644 --- a/Ports/dosbox-staging/patches/glob.patch +++ b/Ports/dosbox-staging/patches/0001-Skip-use-of-glob-in-serenity.patch @@ -1,6 +1,17 @@ -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 +From 6476eefcda05b18de380eca3b772042648107b07 Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Fri, 18 Jun 2021 15:06:37 +0200 +Subject: [PATCH 1/4] Skip use of glob() in serenity + +We don't have that yet. +--- + src/misc/fs_utils_posix.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/misc/fs_utils_posix.cpp b/src/misc/fs_utils_posix.cpp +index fa09872..96002ac 100644 +--- a/src/misc/fs_utils_posix.cpp ++++ b/src/misc/fs_utils_posix.cpp @@ -24,7 +24,9 @@ #include @@ -11,10 +22,7 @@ diff -Naur dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp dosbox-staging-0.76 #include #include #include -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 @@ +@@ -75,6 +77,7 @@ std::string to_native_path(const std::string &path) noexcept // 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); @@ -22,7 +30,7 @@ diff -Naur dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp dosbox-staging-0.76 glob_t pglob; const int err = glob(pattern.c_str(), GLOB_TILDE, nullptr, &pglob); if (err == GLOB_NOMATCH) { -@@ -96,6 +97,9 @@ +@@ -96,6 +99,9 @@ std::string to_native_path(const std::string &path) noexcept const std::string ret = pglob.gl_pathv[0]; globfree(&pglob); return ret; @@ -32,3 +40,6 @@ diff -Naur dosbox-staging-0.76.0/src/misc/fs_utils_posix.cpp dosbox-staging-0.76 } int create_dir(const char *path, uint32_t mode, uint32_t flags) noexcept +-- +2.36.1 + diff --git a/Ports/dosbox-staging/patches/gus.patch b/Ports/dosbox-staging/patches/0002-Replace-some-size_t-Bitu.patch similarity index 51% rename from Ports/dosbox-staging/patches/gus.patch rename to Ports/dosbox-staging/patches/0002-Replace-some-size_t-Bitu.patch index fa2fd59ded..3499e23863 100644 --- a/Ports/dosbox-staging/patches/gus.patch +++ b/Ports/dosbox-staging/patches/0002-Replace-some-size_t-Bitu.patch @@ -1,7 +1,19 @@ -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 @@ +From e62df15632c7473f88055973d2e84aec9f7dc3d8 Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Fri, 18 Jun 2021 15:06:37 +0200 +Subject: [PATCH 2/4] Replace some size_t => Bitu + +FIXME: No information as to why this is a thing exists as of yet, fill + them in when that stuff is known. +--- + src/hardware/gus.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/hardware/gus.cpp b/src/hardware/gus.cpp +index 355a082..6c20b5c 100644 +--- a/src/hardware/gus.cpp ++++ b/src/hardware/gus.cpp +@@ -245,7 +245,7 @@ private: void PopulatePanScalars() noexcept; void PopulateVolScalars() noexcept; void PrepareForPlayback() noexcept; @@ -10,7 +22,7 @@ diff -Naur dosbox-staging-0.76.0/src/hardware/gus.cpp dosbox-staging-0.76.0.sere void RegisterIoHandlers(); void Reset(uint8_t state); void SetLevelCallback(const AudioFrame &level); -@@ -253,7 +253,7 @@ +@@ -253,7 +253,7 @@ private: void UpdateDmaAddress(uint8_t new_address); void UpdateWaveMsw(int32_t &addr) const noexcept; void UpdateWaveLsw(int32_t &addr) const noexcept; @@ -19,3 +31,6 @@ diff -Naur dosbox-staging-0.76.0/src/hardware/gus.cpp dosbox-staging-0.76.0.sere void WriteToRegister(); // Collections +-- +2.36.1 + diff --git a/Ports/dosbox-staging/patches/0003-Manually-hardcode-SDL2-library-name.patch b/Ports/dosbox-staging/patches/0003-Manually-hardcode-SDL2-library-name.patch new file mode 100644 index 0000000000..d8cbda6c19 --- /dev/null +++ b/Ports/dosbox-staging/patches/0003-Manually-hardcode-SDL2-library-name.patch @@ -0,0 +1,29 @@ +From 73cb3bfcc987687c1ff1c1de02905b302a98a47a Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Fri, 18 Jun 2021 15:06:37 +0200 +Subject: [PATCH 3/4] Manually hardcode SDL2 library name + +--- + configure.ac | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 28e9281..1cc3691 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -45,10 +45,8 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + 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" +-- +2.36.1 + diff --git a/Ports/dosbox-staging/patches/0004-Disable-SDL-s-accelerated-rendering.patch b/Ports/dosbox-staging/patches/0004-Disable-SDL-s-accelerated-rendering.patch new file mode 100644 index 0000000000..1ad56d4e17 --- /dev/null +++ b/Ports/dosbox-staging/patches/0004-Disable-SDL-s-accelerated-rendering.patch @@ -0,0 +1,24 @@ +From 19c66fff43c31010e3cae00c4a4a6898c0a9a30a Mon Sep 17 00:00:00 2001 +From: Gunnar Beutner +Date: Fri, 18 Jun 2021 15:06:37 +0200 +Subject: [PATCH 4/4] Disable SDL's accelerated rendering + +--- + src/gui/sdlmain.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp +index 7039f27..d445ebd 100644 +--- a/src/gui/sdlmain.cpp ++++ b/src/gui/sdlmain.cpp +@@ -1048,7 +1048,6 @@ dosurface: + 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()); +-- +2.36.1 + diff --git a/Ports/dosbox-staging/patches/ReadMe.md b/Ports/dosbox-staging/patches/ReadMe.md new file mode 100644 index 0000000000..b277fa7c41 --- /dev/null +++ b/Ports/dosbox-staging/patches/ReadMe.md @@ -0,0 +1,25 @@ +# Patches for dosbox-staging on SerenityOS + +## `0001-Skip-use-of-glob-in-serenity.patch` + +Skip use of glob() in serenity + +We don't have that yet. + +## `0002-Replace-some-size_t-Bitu.patch` + +Replace some size_t => Bitu + +FIXME: No information as to why this is a thing exists as of yet, fill + them in when that stuff is known. + +## `0003-Manually-hardcode-SDL2-library-name.patch` + +Manually hardcode SDL2 library name + + +## `0004-Disable-SDL-s-accelerated-rendering.patch` + +Disable SDL's accelerated rendering + + diff --git a/Ports/dosbox-staging/patches/sdl.patch b/Ports/dosbox-staging/patches/sdl.patch deleted file mode 100644 index 557de97f5c..0000000000 --- a/Ports/dosbox-staging/patches/sdl.patch +++ /dev/null @@ -1,16 +0,0 @@ -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" diff --git a/Ports/dosbox-staging/patches/swrender.patch b/Ports/dosbox-staging/patches/swrender.patch deleted file mode 100644 index ff10af5c0f..0000000000 --- a/Ports/dosbox-staging/patches/swrender.patch +++ /dev/null @@ -1,11 +0,0 @@ -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());