summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-06-09 15:21:27 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-10 00:04:33 +0100
commit817c79431dcdb76df962d850894d1c09808ac4a3 (patch)
treec31e4c5ef5de75e82d57f26a87bd36260dd5b3a1
parent23fa6b1f7bcd823bab4640082d909370f73b0054 (diff)
downloadserenity-817c79431dcdb76df962d850894d1c09808ac4a3.zip
Ports: Split up the `halflife` port into engine and game
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/halflife/package.sh49
-rw-r--r--Ports/halflife/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch (renamed from Ports/halflife/patches/hlsdk-add-serenity.patch)22
-rw-r--r--Ports/halflife/patches/0002-Build-Add-__STRINGS_H_COMPAT_HACK-macro.patch (renamed from Ports/halflife/patches/hlsdk-strings-compat.patch)10
-rw-r--r--Ports/halflife/patches/ReadMe.md19
-rwxr-xr-xPorts/xash3d-fwgs/package.sh41
-rw-r--r--Ports/xash3d-fwgs/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch (renamed from Ports/halflife/patches/fwgs-add-serenity.patch)20
-rw-r--r--Ports/xash3d-fwgs/patches/0002-Engine-Keep-HTTP-from-endlessly-formatting-NaN-value.patch (renamed from Ports/halflife/patches/fwgs-dont-format-nan-loop.patch)11
-rw-r--r--Ports/xash3d-fwgs/patches/ReadMe.md17
9 files changed, 99 insertions, 91 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 6b26cd8032..e0940ceb65 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -233,6 +233,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| [`wireguard-tools`](wireguard-tools/) | WireGuard Tools | 1.0.20210914 | https://www.wireguard.com/ |
| [`x264`](x264/) | x264 | baee400 | https://www.videolan.org/developers/x264.html |
| [`x265`](x265/) | x265 | 3.5 | https://bitbucket.org/multicoreware/x265_git/wiki/Home |
+| [`xash3d-fwgs`](xash3d-fwgs/) | Xash3D FWGS game engine | 2022.05.01 | https://github.com/FWGS/xash3d-fwgs |
| [`xz`](xz/) | xz | 5.2.5 | https://tukaani.org/xz/ |
| [`yasm`](yasm/) | Yasm Modular Assembler | 1.3.0 | https://yasm.tortall.net/ |
| [`zlib`](zlib/) | zlib | 1.2.12 | https://www.zlib.net/ |
diff --git a/Ports/halflife/package.sh b/Ports/halflife/package.sh
index 0aff1baa97..fe6460a648 100755
--- a/Ports/halflife/package.sh
+++ b/Ports/halflife/package.sh
@@ -1,19 +1,11 @@
#!/usr/bin/env -S bash ../.port_include.sh
port="halflife"
version="2022.05.01" # Bogus version, this was the last time the commit hashes were updated.
-_fwgs_commit=5402e1a2597c40c603bd0f2b1a9cd6a16506ec84
_hlsdk_commit=808be9442f60b4388f68fcef8b2659d0cd6db17b
-_vgui_commit=93573075afe885618ea15831e72d44bdacd65bfb
-_mainui_commit=01e964fdc26f5dce1512c030d0dfd68e17be2858
-_miniutl_commit=67c8c226c451f32ee3c98b94e04f8966092b70d3
useconfigure="true"
-depends=("SDL2" "fontconfig" "freetype")
-workdir="."
-files="https://github.com/FWGS/xash3d-fwgs/archive/${_fwgs_commit}.tar.gz xash3d-fwgs-${_fwgs_commit}.tar.gz 1401f6c0cf619c48a8a40938b2acdffd327725ca0ab59804c518bddf821637f9
-https://github.com/FWGS/hlsdk-xash3d/archive/${_hlsdk_commit}.tar.gz hlsdk-xash3d-${_hlsdk_commit}.tar.gz fd17436571341bd5e50739f22d84f9857f492637479144d01b1ffc1ead9d776b
-https://github.com/FWGS/vgui-dev/archive/${_vgui_commit}.tar.gz vgui-dev-${_vgui_commit}.tar.gz eb9315fba8ae444fdae240c10afebaf7f3b157233bf1589f0af557b2286928fa
-https://github.com/FWGS/mainui_cpp/archive/${_mainui_commit}.tar.gz mainui_cpp-${_mainui_commit}.tar.gz c8f6ce81596d5690044542074ac9bc69bbd43b5e5766f71363a8b5d4d382ad71
-https://github.com/FWGS/MiniUTL/archive/${_miniutl_commit}.tar.gz MiniUTL-${_miniutl_commit}.tar.gz 7b7b26377854b3fc741c8d652d8b3c9c540512644943ca6efb63df941b2861e3"
+depends=("xash3d-fwgs")
+workdir="hlsdk-xash3d-${_hlsdk_commit}"
+files="https://github.com/FWGS/hlsdk-xash3d/archive/${_hlsdk_commit}.tar.gz hlsdk-xash3d-${_hlsdk_commit}.tar.gz fd17436571341bd5e50739f22d84f9857f492637479144d01b1ffc1ead9d776b"
auth_type=sha256
launcher_name="Half-Life"
launcher_category="Games"
@@ -21,45 +13,16 @@ launcher_command="sh /home/anon/Games/halflife/hl.sh"
export PKG_CONFIG_PATH="${SERENITY_INSTALL_ROOT}/usr/local/lib/pkgconfig"
-# This one is a bit tricky to build, so I'm going a little bit off the script....
configure() {
- # Initialize submodules from tarballs
- [ -e ./xash3d-fwgs-${_fwgs_commit}/mainui ] && rm -r ./xash3d-fwgs-${_fwgs_commit}/mainui
- cp -r mainui_cpp-${_mainui_commit}/ ./xash3d-fwgs-${_fwgs_commit}/mainui
- rmdir ./xash3d-fwgs-${_fwgs_commit}/mainui/miniutl
- cp -r MiniUTL-${_miniutl_commit}/ ./xash3d-fwgs-${_fwgs_commit}/mainui/miniutl
-
- # Configure the shared object projects (client and game)
- cd ./hlsdk-xash3d-${_hlsdk_commit}
- ./waf configure -T release
- cd ../
-
- # Configure the engine itself...
- cd ./xash3d-fwgs-${_fwgs_commit}
- ./waf configure --sdl2="${SERENITY_INSTALL_ROOT}/usr/local" --vgui=../vgui-dev-${_vgui_commit}/ -T release
- cd ../
+ run ./waf configure -T release
}
build() {
- # Build the game and client
- cd ./hlsdk-xash3d-${_hlsdk_commit}
- ./waf build
- cd ../
-
- # Build the engine
- cd ./xash3d-fwgs-${_fwgs_commit}
- ./waf build
- cd ../
+ run ./waf build
}
install() {
- cd ./hlsdk-xash3d-${_hlsdk_commit}
- ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife
- cd ../
-
- cd ./xash3d-fwgs-${_fwgs_commit}
- ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/
- cd ../
+ run ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife
}
post_install() {
diff --git a/Ports/halflife/patches/hlsdk-add-serenity.patch b/Ports/halflife/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch
index e40b56f5ea..2d33ffc573 100644
--- a/Ports/halflife/patches/hlsdk-add-serenity.patch
+++ b/Ports/halflife/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch
@@ -6,14 +6,14 @@ Subject: [PATCH] Build: Add SerenityOS to list of compatible systems
This is required by the build system to spit out a library with
the correct name/platform.
---
- hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/public/build.h | 4 ++++
- hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/scripts/waifulib/library_naming.py | 3 +++
+ public/build.h | 4 ++++
+ scripts/waifulib/library_naming.py | 3 +++
2 files changed, 7 insertions(+)
-diff --git a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/public/build.h b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/public/build.h
-index 3692cf175..5b6bcc362 100644
---- a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/public/build.h
-+++ b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/public/build.h
+diff --git a/public/build.h b/public/build.h
+index 3692cf1..5b6bcc3 100644
+--- a/public/build.h
++++ b/public/build.h
@@ -75,6 +75,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_RISCV_DOUBLEFP
#undef XASH_RISCV_SINGLEFP
@@ -32,11 +32,11 @@ index 3692cf175..5b6bcc362 100644
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif
-diff --git a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/scripts/waifulib/library_naming.py b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/scripts/waifulib/library_naming.py
-index a3929067f..44ade2fd2 100644
---- a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/scripts/waifulib/library_naming.py
-+++ b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/scripts/waifulib/library_naming.py
-@@ -57,6 +57,7 @@
+diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py
+index a392906..44ade2f 100644
+--- a/scripts/waifulib/library_naming.py
++++ b/scripts/waifulib/library_naming.py
+@@ -57,6 +57,7 @@ DEFINES = [
'XASH_RISCV_DOUBLEFP',
'XASH_RISCV_SINGLEFP',
'XASH_RISCV_SOFTFP',
diff --git a/Ports/halflife/patches/hlsdk-strings-compat.patch b/Ports/halflife/patches/0002-Build-Add-__STRINGS_H_COMPAT_HACK-macro.patch
index 016f1c2b4d..4cd8c7a2f2 100644
--- a/Ports/halflife/patches/hlsdk-strings-compat.patch
+++ b/Ports/halflife/patches/0002-Build-Add-__STRINGS_H_COMPAT_HACK-macro.patch
@@ -6,13 +6,13 @@ Subject: [PATCH] Build: Add `__STRINGS_H_COMPAT_HACK` macro
This bypasses a bunch of `str[n]cmpcase` errors that occur due to weird
LibC compatibility problems.
---
- hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/wscript | 2 +-
+ wscript | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/wscript b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/wscript
-index 336e8d34f..684c575a5 100644
---- a/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/wscript
-+++ b/hlsdk-xash3d-808be9442f60b4388f68fcef8b2659d0cd6db17b/wscript
+diff --git a/wscript b/wscript
+index 336e8d3..684c575 100644
+--- a/wscript
++++ b/wscript
@@ -171,7 +171,7 @@ def configure(conf):
elif conf.env.COMPILER_CC == 'owcc':
pass
diff --git a/Ports/halflife/patches/ReadMe.md b/Ports/halflife/patches/ReadMe.md
index bc3810de20..6dc2453924 100644
--- a/Ports/halflife/patches/ReadMe.md
+++ b/Ports/halflife/patches/ReadMe.md
@@ -1,28 +1,13 @@
# Patches for halflife on SerenityOS
-## `fwgs-add-serenity.patch`
+## `0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch`
Build: Add SerenityOS to list of compatible systems
This is required by the build system to spit out a library with
the correct name/platform.
-## `fwgs-dont-format-nan-loop.patch`
-
-Engine: Keep HTTP from endlessly formatting NaN values
-
-For whatever reason, our progress count for HTTP downloads stays at 0.
-This results in the engine calculating a NaN progress value many times
-each frame, which results in a significant performance hit.
-
-## `hlsdk-add-serenity.patch`
-
-Build: Add SerenityOS to list of compatible systems
-
-This is required by the build system to spit out a library with
-the correct name/platform.
-
-## `hlsdk-strings-compat.patch`
+## `0002-Build-Add-__STRINGS_H_COMPAT_HACK-macro.patch`
Build: Add `__STRINGS_H_COMPAT_HACK` macro
diff --git a/Ports/xash3d-fwgs/package.sh b/Ports/xash3d-fwgs/package.sh
new file mode 100755
index 0000000000..ba3f554e84
--- /dev/null
+++ b/Ports/xash3d-fwgs/package.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port="xash3d-fwgs"
+version="2022.05.01" # Bogus version, this was the last time the commit hashes were updated.
+_fwgs_commit=5402e1a2597c40c603bd0f2b1a9cd6a16506ec84
+_vgui_commit=93573075afe885618ea15831e72d44bdacd65bfb
+_mainui_commit=01e964fdc26f5dce1512c030d0dfd68e17be2858
+_miniutl_commit=67c8c226c451f32ee3c98b94e04f8966092b70d3
+useconfigure="true"
+depends=("SDL2" "fontconfig" "freetype")
+workdir="xash3d-fwgs-${_fwgs_commit}"
+files="https://github.com/FWGS/xash3d-fwgs/archive/${_fwgs_commit}.tar.gz xash3d-fwgs-${_fwgs_commit}.tar.gz 1401f6c0cf619c48a8a40938b2acdffd327725ca0ab59804c518bddf821637f9
+https://github.com/FWGS/vgui-dev/archive/${_vgui_commit}.tar.gz vgui-dev-${_vgui_commit}.tar.gz eb9315fba8ae444fdae240c10afebaf7f3b157233bf1589f0af557b2286928fa
+https://github.com/FWGS/mainui_cpp/archive/${_mainui_commit}.tar.gz mainui_cpp-${_mainui_commit}.tar.gz c8f6ce81596d5690044542074ac9bc69bbd43b5e5766f71363a8b5d4d382ad71
+https://github.com/FWGS/MiniUTL/archive/${_miniutl_commit}.tar.gz MiniUTL-${_miniutl_commit}.tar.gz 7b7b26377854b3fc741c8d652d8b3c9c540512644943ca6efb63df941b2861e3"
+auth_type=sha256
+
+export PKG_CONFIG_PATH="${SERENITY_INSTALL_ROOT}/usr/local/lib/pkgconfig"
+
+pre_patch() {
+ pushd "${workdir}"
+
+ # Initialize submodules from tarballs
+ [ -e mainui ] && rm -r mainui
+ cp -r ../mainui_cpp-${_mainui_commit}/ mainui
+ rmdir mainui/miniutl
+ cp -r ../MiniUTL-${_miniutl_commit}/ mainui/miniutl
+
+ popd
+}
+
+configure() {
+ run ./waf configure --sdl2="${SERENITY_INSTALL_ROOT}/usr/local" --vgui=../vgui-dev-${_vgui_commit}/ -T release
+}
+
+build() {
+ run ./waf build
+}
+
+install() {
+ run ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/
+}
diff --git a/Ports/halflife/patches/fwgs-add-serenity.patch b/Ports/xash3d-fwgs/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch
index 02ae176393..363fe8fd36 100644
--- a/Ports/halflife/patches/fwgs-add-serenity.patch
+++ b/Ports/xash3d-fwgs/patches/0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch
@@ -6,14 +6,14 @@ Subject: [PATCH] Build: Add SerenityOS to list of compatible systems
This is required by the build system to spit out a library with
the correct name/platform.
---
- xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/build.c | 2 ++
- xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/public/build.h | 4 ++++
+ engine/common/build.c | 2 ++
+ public/build.h | 4 ++++
2 files changed, 6 insertions(+)
-diff --git a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/build.c b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/build.c
-index c4ddaeeb2..42ba572c4 100644
---- a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/build.c
-+++ b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/build.c
+diff --git a/engine/common/build.c b/engine/common/build.c
+index c4ddaee..42ba572 100644
+--- a/engine/common/build.c
++++ b/engine/common/build.c
@@ -95,6 +95,8 @@ const char *Q_buildos( void )
osname = "DOS4GW";
#elif XASH_HAIKU
@@ -23,10 +23,10 @@ index c4ddaeeb2..42ba572c4 100644
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif
-diff --git a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/public/build.h b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/public/build.h
-index 6e1f326d6..57a7735f4 100644
---- a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/public/build.h
-+++ b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/public/build.h
+diff --git a/public/build.h b/public/build.h
+index 6e1f326..57a7735 100644
+--- a/public/build.h
++++ b/public/build.h
@@ -74,6 +74,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_RISCV_DOUBLEFP
#undef XASH_RISCV_SINGLEFP
diff --git a/Ports/halflife/patches/fwgs-dont-format-nan-loop.patch b/Ports/xash3d-fwgs/patches/0002-Engine-Keep-HTTP-from-endlessly-formatting-NaN-value.patch
index 897c41297c..c3bfa0b592 100644
--- a/Ports/halflife/patches/fwgs-dont-format-nan-loop.patch
+++ b/Ports/xash3d-fwgs/patches/0002-Engine-Keep-HTTP-from-endlessly-formatting-NaN-value.patch
@@ -7,13 +7,14 @@ For whatever reason, our progress count for HTTP downloads stays at 0.
This results in the engine calculating a NaN progress value many times
each frame, which results in a significant performance hit.
---
- xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c | 2 +-
+ engine/common/net_ws.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c
---- a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c
-+++ b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c
-@@ -2280,7 +2280,7 @@
+diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c
+index ef403b3..8b491ba 100644
+--- a/engine/common/net_ws.c
++++ b/engine/common/net_ws.c
+@@ -2280,7 +2280,7 @@ void HTTP_Run( void )
}
// update progress
diff --git a/Ports/xash3d-fwgs/patches/ReadMe.md b/Ports/xash3d-fwgs/patches/ReadMe.md
new file mode 100644
index 0000000000..13c96130cb
--- /dev/null
+++ b/Ports/xash3d-fwgs/patches/ReadMe.md
@@ -0,0 +1,17 @@
+# Patches for xash3d-fwgs on SerenityOS
+
+## `0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch`
+
+Build: Add SerenityOS to list of compatible systems
+
+This is required by the build system to spit out a library with
+the correct name/platform.
+
+## `0002-Engine-Keep-HTTP-from-endlessly-formatting-NaN-value.patch`
+
+Engine: Keep HTTP from endlessly formatting NaN values
+
+For whatever reason, our progress count for HTTP downloads stays at 0.
+This results in the engine calculating a NaN progress value many times
+each frame, which results in a significant performance hit.
+