Skip to content

Instantly share code, notes, and snippets.

@badock
Created March 11, 2017 20:44
Show Gist options
  • Save badock/aa61bb8e0cde5447c93240638b5f92c7 to your computer and use it in GitHub Desktop.
Save badock/aa61bb8e0cde5447c93240638b5f92c7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -u
set -e
set -x
# Check if the GameData folder has been provided
if [ "$1" == "" ]; then
echo "Provide the path to the Gamedata folder as first parameter"
exit 1
fi
if [ ! -d "$1" ]; then
echo "The provided path to the GameData ($1) folder is invalid"
exit 1
fi
GAMEDATA_FOLDER_PATH="$1"
# Installing dependencies
brew install zlib libjpeg libpng sdl2 --universal
# Cloning OpenJK
git clone https://github.com/JACoders/OpenJK.git
pushd OpenJK
# Create a build folder and init the project
mkdir build
pushd build
# Configure the project using CMAKE
cmake -D CMAKE_INSTALL_PREFIX=$GAMEDATA_FOLDER_PATH ..
# Compile the project
make
# Build the project
make install
popd # Leave OpenJK/build
popd # Leave OpenJK
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment