mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 09:20:28 +03:00
Ports: Add VVVVVV port
Co-Authored-By: Tim Schumacher <timschumi@gmx.de> (thanks for the line ending and assert() troubleshooting)
This commit is contained in:
parent
2a45d30302
commit
51315c0b1d
Notes:
sideshowbarker
2024-07-17 10:07:26 +09:00
Author: https://github.com/lightspot21 Commit: https://github.com/SerenityOS/serenity/commit/51315c0b1d Pull-request: https://github.com/SerenityOS/serenity/pull/14224 Reviewed-by: https://github.com/timschumi ✅
@ -229,6 +229,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
|
||||
| [`vitetris`](vitetris/) | vitetris | 0.59.1 | https://github.com/vicgeralds/vitetris |
|
||||
| [`vlang`](vlang/) | V programming language | weekly.2021.31 | https://github.com/vlang/v |
|
||||
| [`vttest`](vttest/) | vttest | 20220215 | https://invisible-island.net/vttest/ |
|
||||
| [`VVVVVV`](VVVVVV/) | Terry Cavanagh's VVVVVV | 2.3.6 | https://github.com/TerryCavanagh/VVVVVV/ |
|
||||
| [`wget`](wget/) | GNU Wget | 1.21.3 | https://www.gnu.org/software/wget/ |
|
||||
| [`wireguard-tools`](wireguard-tools/) | WireGuard Tools | 1.0.20210914 | https://www.wireguard.com/ |
|
||||
| [`x264`](x264/) | x264 | baee400 | https://www.videolan.org/developers/x264.html |
|
||||
|
30
Ports/VVVVVV/package.sh
Executable file
30
Ports/VVVVVV/package.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port='VVVVVV'
|
||||
version='2.3.6'
|
||||
useconfigure='true'
|
||||
auth_type='sha256'
|
||||
files="https://github.com/TerryCavanagh/VVVVVV/archive/refs/tags/${version}.tar.gz VVVVVV-${version}.tar.gz a3366aab9e8462d330044ab1ec63927e9f5c3801c0ed96b24f08c553dcb911e9"
|
||||
configopts=(
|
||||
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-Sdesktop_version"
|
||||
)
|
||||
depends=("SDL2" "SDL2_mixer")
|
||||
icon_file='desktop_version/icon.ico'
|
||||
launcher_name='VVVVVV'
|
||||
launcher_category='Games'
|
||||
launcher_command='/opt/VVVVVV/VVVVVV'
|
||||
|
||||
configure() {
|
||||
run cmake "${configopts[@]}"
|
||||
}
|
||||
|
||||
install() {
|
||||
run mkdir -p "${SERENITY_INSTALL_ROOT}/opt/VVVVVV"
|
||||
run cp VVVVVV "${SERENITY_INSTALL_ROOT}/opt/VVVVVV"
|
||||
echo -e "\033[0;34m=====================================================================\033[0m"
|
||||
echo -e "\033[1;31mNOTE: \033[0mVVVVVV needs the assets from the original game to work."
|
||||
echo -e "Place the \033[1;33mdata.zip\033[0m file from the Make and Play edition AS IS"
|
||||
echo -e "under \033[1;32m${SERENITY_INSTALL_ROOT}/opt/VVVVVV\033[0m."
|
||||
echo -e "\033[0;34m=====================================================================\033[0m"
|
||||
}
|
25
Ports/VVVVVV/patches/0001-Change-C-standard-to-C99.patch
Normal file
25
Ports/VVVVVV/patches/0001-Change-C-standard-to-C99.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Grigoris Pavlakis <grigpavl@ece.auth.gr>
|
||||
Date: Thu, 9 Jun 2022 00:19:08 +0300
|
||||
Subject: [PATCH] Change C standard to C99
|
||||
|
||||
The originally-set C90 doesn't support the `inline` keyword, causing
|
||||
weird compile errors because isalnum() and other functions under
|
||||
ctype.h are actually #define'd as inline.
|
||||
---
|
||||
desktop_version/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt
|
||||
index 7405c12..49d44bb 100644
|
||||
--- a/desktop_version/CMakeLists.txt
|
||||
+++ b/desktop_version/CMakeLists.txt
|
||||
@@ -27,7 +27,7 @@ endif()
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.1.3")
|
||||
message(WARNING "Your CMake version is too old; set -std=c90 -std=c++98 yourself!")
|
||||
else()
|
||||
- set(CMAKE_C_STANDARD 90)
|
||||
+ set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 98)
|
@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Grigoris Pavlakis <grigpavl@ece.auth.gr>
|
||||
Date: Fri, 17 Jun 2022 19:26:30 +0300
|
||||
Subject: [PATCH] Add SerenityOS in platform-specific defines
|
||||
|
||||
---
|
||||
desktop_version/src/FileSystemUtils.cpp | 6 +++---
|
||||
third_party/tinyxml2/tinyxml2.cpp | 2 +-
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp
|
||||
index 833a3de..22372f2 100644
|
||||
--- a/desktop_version/src/FileSystemUtils.cpp
|
||||
+++ b/desktop_version/src/FileSystemUtils.cpp
|
||||
@@ -26,7 +26,7 @@ int mkdir(char* path, int mode)
|
||||
return CreateDirectoryW(utf16_path, NULL);
|
||||
}
|
||||
#define VNEEDS_MIGRATION (mkdirResult != 0)
|
||||
-#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__)
|
||||
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined (__serenity__)
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
@@ -1005,7 +1005,7 @@ static void PLATFORM_migrateSaveData(char* output)
|
||||
char oldLocation[MAX_PATH];
|
||||
char newLocation[MAX_PATH];
|
||||
char oldDirectory[MAX_PATH];
|
||||
-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__)
|
||||
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined (__serenity__)
|
||||
DIR *dir = NULL;
|
||||
struct dirent *de = NULL;
|
||||
DIR *subDir = NULL;
|
||||
@@ -1018,7 +1018,7 @@ static void PLATFORM_migrateSaveData(char* output)
|
||||
return;
|
||||
}
|
||||
const char oldPath[] =
|
||||
- #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__)
|
||||
+ #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined (__serenity__)
|
||||
"/.vvvvvv/";
|
||||
#elif defined(__APPLE__)
|
||||
"/Documents/VVVVVV/";
|
||||
diff --git a/third_party/tinyxml2/tinyxml2.cpp b/third_party/tinyxml2/tinyxml2.cpp
|
||||
index 1606ce0..d78c6ba 100644
|
||||
--- a/third_party/tinyxml2/tinyxml2.cpp
|
||||
+++ b/third_party/tinyxml2/tinyxml2.cpp
|
||||
@@ -103,7 +103,7 @@ distribution.
|
||||
#if defined(_WIN64)
|
||||
#define TIXML_FSEEK _fseeki64
|
||||
#define TIXML_FTELL _ftelli64
|
||||
-#elif defined(__APPLE__) || (__FreeBSD__) || (__OpenBSD__)
|
||||
+#elif defined(__APPLE__) || (__FreeBSD__) || (__OpenBSD__) || (__serenity__)
|
||||
#define TIXML_FSEEK fseeko
|
||||
#define TIXML_FTELL ftello
|
||||
#elif defined(__unix__) && defined(__x86_64__)
|
@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Grigoris Pavlakis <grigpavl@ece.auth.gr>
|
||||
Date: Fri, 17 Jun 2022 19:29:00 +0300
|
||||
Subject: [PATCH] Defer sound system initialization until main()
|
||||
|
||||
The original VVVVVV source code initializes the sound subsystem
|
||||
during global variable initialization. Technically speaking, the
|
||||
order of initialization of global variables is unspecified. This
|
||||
results in SerenityOS's dynamic linker to call Mix_OpenAudio()
|
||||
(which uses EventLoop under the hood) before all global variable
|
||||
initializers finish executing, resulting in an inconsistent state
|
||||
that causes assertion failure.
|
||||
|
||||
This patch moves initialization of the culprit sound system to
|
||||
a separate method, which is called first thing inside main(), thus
|
||||
preventing the setup from happening during musicclass's initialization
|
||||
in the global scope, which causes the aforementioned crash.
|
||||
---
|
||||
desktop_version/src/SoundSystem.cpp | 4 ++++
|
||||
desktop_version/src/SoundSystem.h | 1 +
|
||||
desktop_version/src/main.cpp | 1 +
|
||||
3 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/desktop_version/src/SoundSystem.cpp b/desktop_version/src/SoundSystem.cpp
|
||||
index 8c5f962..056d946 100644
|
||||
--- a/desktop_version/src/SoundSystem.cpp
|
||||
+++ b/desktop_version/src/SoundSystem.cpp
|
||||
@@ -52,6 +52,10 @@ SoundTrack::SoundTrack(const char* fileName)
|
||||
}
|
||||
|
||||
SoundSystem::SoundSystem(void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+void SoundSystem::initialize(void)
|
||||
{
|
||||
int audio_rate = 44100;
|
||||
Uint16 audio_format = AUDIO_S16SYS;
|
||||
diff --git a/desktop_version/src/SoundSystem.h b/desktop_version/src/SoundSystem.h
|
||||
index 0cf3b84..f88e15b 100644
|
||||
--- a/desktop_version/src/SoundSystem.h
|
||||
+++ b/desktop_version/src/SoundSystem.h
|
||||
@@ -23,6 +23,7 @@ class SoundSystem
|
||||
{
|
||||
public:
|
||||
SoundSystem(void);
|
||||
+ void initialize(void);
|
||||
};
|
||||
|
||||
#endif /* SOUNDSYSTEM_H */
|
||||
diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp
|
||||
index b97270f..49bd853 100644
|
||||
--- a/desktop_version/src/main.cpp
|
||||
+++ b/desktop_version/src/main.cpp
|
||||
@@ -341,6 +341,7 @@ static void cleanup(void);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
+ music.soundSystem.initialize();
|
||||
char* baseDir = NULL;
|
||||
char* assetsPath = NULL;
|
||||
|
32
Ports/VVVVVV/patches/ReadMe.md
Normal file
32
Ports/VVVVVV/patches/ReadMe.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Patches for VVVVVV on SerenityOS
|
||||
|
||||
## `0001-Change-C-standard-to-C99.patch`
|
||||
|
||||
Change C standard to C99
|
||||
|
||||
The originally-set C90 doesn't support the `inline` keyword, causing
|
||||
weird compile errors because isalnum() and other functions under
|
||||
ctype.h are actually #define'd as inline.
|
||||
|
||||
## `0002-Add-SerenityOS-in-platform-specific-defines.patch`
|
||||
|
||||
Add SerenityOS in platform-specific defines
|
||||
|
||||
|
||||
## `0003-Defer-sound-system-initialization-until-main.patch`
|
||||
|
||||
Defer sound system initialization until main()
|
||||
|
||||
The original VVVVVV source code initializes the sound subsystem
|
||||
during global variable initialization. Technically speaking, the
|
||||
order of initialization of global variables is unspecified. This
|
||||
results in SerenityOS's dynamic linker to call Mix_OpenAudio()
|
||||
(which uses EventLoop under the hood) before all global variable
|
||||
initializers finish executing, resulting in an inconsistent state
|
||||
that causes assertion failure.
|
||||
|
||||
This patch moves initialization of the culprit sound system to
|
||||
a separate method, which is called first thing inside main(), thus
|
||||
preventing the setup from happening during musicclass's initialization
|
||||
in the global scope, which causes the aforementioned crash.
|
||||
|
Loading…
Reference in New Issue
Block a user