summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-16 11:23:34 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-16 20:08:13 +0200
commit8ba05331387773571cc6d92bd080012c73516550 (patch)
tree02cbc53689b65e999a24f802d42f3702b27a6c35
parent8393e737b7a246daa4db3bbc4260293e10584bd2 (diff)
downloadserenity-8ba05331387773571cc6d92bd080012c73516550.zip
Ports: Add port for DungeonRush
-rwxr-xr-xPorts/.port_include.sh6
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/dungeonrush/package.sh21
-rw-r--r--Ports/dungeonrush/patches/cwd.patch12
-rw-r--r--Ports/dungeonrush/patches/sw-renderer.patch12
5 files changed, 51 insertions, 1 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh
index 102c549134..08a6bcc41c 100755
--- a/Ports/.port_include.sh
+++ b/Ports/.port_include.sh
@@ -119,7 +119,11 @@ install_icon() {
if [ "$convert_exists" == "0" ] && [ "$identify_exists" == "0" ]; then
for icon_size in "16x16" "32x32"; do
index=$(run identify "$icon" | grep "$icon_size" | grep -oE "\[[0-9]+\]" | tr -d "[]" | head -n1)
- run convert "${icon}[${index}]" "app-${icon_size}.png"
+ if [ -n "$index" ]; then
+ run convert "${icon}[${index}]" "app-${icon_size}.png"
+ else
+ run convert "$icon" -resize $icon_size "app-${icon_size}.png"
+ fi
done
run objcopy --add-section serenity_icon_s="app-16x16.png" "${DESTDIR}${launcher}"
run objcopy --add-section serenity_icon_m="app-32x32.png" "${DESTDIR}${launcher}"
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 6941ed93c8..297b8a6877 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -26,6 +26,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`dmidecode`](dmidecode/) | dmidecode | 3.3 | https://github.com/mirror/dmidecode |
| [`doom`](doom/) | DOOM | | https://github.com/SerenityOS/SerenityDOOM |
| [`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/ |
| [`emu2`](emu2/) | emu2 DOS emulator | 2021.01 | https://github.com/dmsc/emu2 |
| [`figlet`](figlet/) | FIGlet | 2.2.5 | http://www.figlet.org/ |
diff --git a/Ports/dungeonrush/package.sh b/Ports/dungeonrush/package.sh
new file mode 100755
index 0000000000..7e9cd5a835
--- /dev/null
+++ b/Ports/dungeonrush/package.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=DungeonRush
+version=1.1-beta
+useconfigure=true
+files="https://github.com/Rapiz1/DungeonRush/archive/refs/tags/v${version}.tar.gz v${version}.tar.gz 295b83cb023bf5d21318992daee125399892bdf16a87c835dfc90b841c929eda"
+auth_type=sha256
+configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
+depends="SDL2 SDL2_image SDL2_mixer SDL2_ttf SDL2_net"
+launcher_name="DungeonRush"
+launcher_category=Games
+launcher_command=/opt/DungeonRush/dungeon_rush
+icon_file=dungeonrush.png
+
+configure() {
+ run cmake $configopts
+}
+
+install() {
+ run mkdir -p "${SERENITY_INSTALL_ROOT}/opt/DungeonRush"
+ run cp -r bin/dungeon_rush res "${SERENITY_INSTALL_ROOT}/opt/DungeonRush"
+}
diff --git a/Ports/dungeonrush/patches/cwd.patch b/Ports/dungeonrush/patches/cwd.patch
new file mode 100644
index 0000000000..22559b533b
--- /dev/null
+++ b/Ports/dungeonrush/patches/cwd.patch
@@ -0,0 +1,12 @@
+diff -Naur DungeonRush-1.1-beta/src/main.c DungeonRush-1.1-beta.serenity/src/main.c
+--- DungeonRush-1.1-beta/src/main.c 2020-11-21 14:22:39.000000000 +0100
++++ DungeonRush-1.1-beta.serenity/src/main.c 2021-06-16 11:02:22.409585466 +0200
+@@ -12,6 +12,8 @@
+ #endif
+
+ int main(int argc, char** args) {
++ // The game tries to open its resource files using relative paths
++ chdir("/opt/DungeonRush");
+ prngSrand(time(NULL));
+ // Start up SDL and create window
+ if (!init()) {
diff --git a/Ports/dungeonrush/patches/sw-renderer.patch b/Ports/dungeonrush/patches/sw-renderer.patch
new file mode 100644
index 0000000000..530654b0d3
--- /dev/null
+++ b/Ports/dungeonrush/patches/sw-renderer.patch
@@ -0,0 +1,12 @@
+diff -Naur DungeonRush-1.1-beta/src/res.c DungeonRush-1.1-beta.serenity/src/res.c
+--- DungeonRush-1.1-beta/src/res.c 2020-11-21 14:22:39.000000000 +0100
++++ DungeonRush-1.1-beta.serenity/src/res.c 2021-06-16 11:00:12.654195338 +0200
+@@ -89,6 +89,8 @@
+ int soundsCount;
+ Mix_Chunk *sounds[AUDIO_SOUND_SIZE];
+
++#define SOFTWARE_ACC
++
+ bool init() {
+ // Initialization flag
+ bool success = true;