diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index b0bfd49a28..a65510846a 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -64,6 +64,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`grep`](grep/) | GNU Grep | 2.5.4 | https://www.gnu.org/software/grep/ | | [`griffon`](griffon/) | The Griffon Legend | 1.0 | https://www.scummvm.org/games/#games-griffon | | [`gsl`](gsl/) | GNU Scientific Library | 2.7 | https://www.gnu.org/software/gsl/ | +| [`halflife`](halflife/) | Half-Life | 1.0.0 | https://github.com/SerenityPorts/xash3d-fwgs | | [`harfbuzz`](harfbuzz/) | HarfBuzz | 2.8.1 | https://github.com/harfbuzz/harfbuzz | | [`hatari`](hatari/) | Atari ST/STE/TT/Falcon emulator | 2.4.0-devel | https://hatari.tuxfamily.org/ | | [`imgcat`](imgcat/) | imgcat | 2.5.0 | https://github.com/eddieantonio/imgcat | diff --git a/Ports/halflife/package.sh b/Ports/halflife/package.sh new file mode 100755 index 0000000000..7ffb602485 --- /dev/null +++ b/Ports/halflife/package.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port="halflife" +version="1.0.0" +useconfigure="true" +depends=("SDL2") +workdir="xash3d-fwgs-master" +files="https://github.com/SerenityPorts/xash3d-fwgs/archive/master.tar.gz xash3d_engine.tar.gz +https://github.com/SerenityPorts/hlsdk-xash3d/archive/master.tar.gz xash3d_hldll.tar.gz" +launcher_name="Half-Life" +launcher_category="Games" +launcher_command="sh /home/anon/Games/halflife/hl.sh" + +# This one is a bit tricky to build, so I'm going a little bit off the script.... +configure() { + # Configure the shared object projects (client and game) + cd ./hlsdk-xash3d-master + ./waf configure -T release + cd ../ + + # Configure the engine itself... + cd ./xash3d-fwgs-master + ./waf configure --sdl2=${SERENITY_INSTALL_ROOT}/usr/local -T release +} + +build() { + # Build the game and client + cd ../hlsdk-xash3d-master + ./waf build + cd ../ + + # Build the engine + cd ./xash3d-fwgs-master + ./waf build + cd ../ +} + +install() { + cd ./hlsdk-xash3d-master + ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife + cd ../ + + cd ./xash3d-fwgs-master + ./waf install --destdir=${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/ + cd ../ +} + +post_install() { + # Delete the OpenGL renderer (ref_gl.so) so we don't crash on launch... + rm ${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/libref_gl.so + + # Strip the output libraries of their "lib" prefix + pushd ${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/valve/cl_dlls/ + rename 's/^...//' lib* + popd + pushd ${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/valve/dlls/ + rename 's/^...//' lib* + popd + + # Create a launch script + cat <<- 'EOF' > ${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/hl.sh +#!/bin/sh +export LD_LIBRARY_PATH=/home/anon/Games/halflife/ +scriptdir=$(dirname "$0") +cd $scriptdir +./xash3d +EOF + chmod +x ${SERENITY_INSTALL_ROOT}/home/anon/Games/halflife/hl.sh +}