Skip to content

Instantly share code, notes, and snippets.

@drushadrusha
Last active March 3, 2023 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drushadrusha/a197afc27793e2f4c3c7e7656fe43a24 to your computer and use it in GitHub Desktop.
Save drushadrusha/a197afc27793e2f4c3c7e7656fe43a24 to your computer and use it in GitHub Desktop.
How to build and run Half-Life 1 on M1 natively.
##
## Guide to build and run half-life 1 on M1 processor
##
##
## This is not a script.
## This may be not be accurate.
## Execute all commands by yourself and only if you are understand their meaning.
##
## Put your home folder(or any other) to variable
BASEFOLDER=$PWD
## Install LLVM via brew
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
## Rename llvm-objcopy to objcopy.
## This step is required because some of the build scripts for the xash3d engine assume that objcopy is available.
cd /opt/homebrew/opt/llvm/bin
cp llvm-objcopy objcopy
## Go back, clone xash3d engine and build it to game folder
cd "$BASEFOLDER" || exit
mkdir game
git clone --recursive https://github.com/FWGS/xash3d-fwgs
cd xash3d-fwgs
./waf configure -T release
./waf build
./waf install --destdir="$BASEFOLDER"/game
## Go back to your folder
cd "$BASEFOLDER" || exit
## Build hlsdk
git clone --recursive https://github.com/FWGS/hlsdk-portable
cd hlsdk-portable
./waf configure -T release
./waf build
./waf install --destdir="$BASEFOLDER"/game
## Clone xash-extras repo and put all contents in your game folder
cd "$BASEFOLDER" || exit
git clone --recursive https://github.com/FWGS/xash-extras.git
cp -r xash-extras/* game/
cd "$BASEFOLDER" || exit
## Here move your Half-Life copy inside your game folder
cd game
./xash3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment