OpenRCT2/build.sh

78 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
2015-07-05 23:39:35 +02:00
cachedir=.cache
mkdir -p $cachedir
if [[ ! -d build ]]; then
mkdir -p build
fi
2015-07-27 21:46:47 +02:00
libversion=2
2015-07-05 23:39:35 +02:00
libVFile="./libversion"
libdir="./lib"
currentversion=0
needsdownload="true"
if [ -f $libVFile ]; then
while read line; do
currentversion=$line
continue
done < $libVFile
fi
if [ $currentversion -ge $libversion ]; then
needsdownload="false"
fi
if [ ! -d $libdir ]; then
needsdownload="true"
fi
if [[ "$needsdownload" = "true" ]]; then
echo "New libraries need to be downloaded, the script might ask you for sudo access password"
rm -rf ./lib
if [[ -f $cachedir/orctlibs.zip ]]; then
rm -rf $cachedir/orctlibs.zip
fi
if [[ -d /usr/local/cross-tools/orctlibs ]]; then
sudo rm -rf /usr/local/cross-tools/orctlibs
fi
if [[ -d $cachedir/orctlibs ]]; then
rm -rf $cachedir/orctlibs
fi
curl https://download.openrct2.website/dev/lib/mingw -o $cachedir/orctlibs.zip
mkdir -p $cachedir/orctlibs
pushd $cachedir/orctlibs
unzip -uaq ../orctlibs.zip
popd
2015-07-05 23:39:35 +02:00
sudo mkdir -p /usr/local/cross-tools/orctlibs
mkdir -p lib
sudo cp -rf $cachedir/orctlibs/glob/* /usr/local/cross-tools/orctlibs/.
cp -rf $cachedir/orctlibs/local/* ./lib/.
echo $libversion > $libVFile
fi
pushd build
echo OPENRCT2_CMAKE_OPTS = $OPENRCT_CMAKE_OPTS
2015-09-18 13:51:46 +02:00
cmake -DCMAKE_BUILD_TYPE=Debug $OPENRCT2_CMAKE_OPTS ..
make
popd
if [[ ! -h openrct2.dll ]]; then
ln -s build/openrct2.dll openrct2.dll
fi
2015-06-04 23:02:38 +02:00
if [[ -z "$DISABLE_G2_BUILD" ]]; then
echo Building: data/g2.dat
./build_g2.sh > /dev/null 2>&1
fi
2015-06-03 04:13:35 +02:00
if [[ -t 1 ]]; then
2014-05-27 13:24:25 +02:00
echo -e "\nDone! Run OpenRCT2 by typing:\n\n\033[95mwine openrct2.exe\n\033[0m"
else
2014-05-27 13:24:25 +02:00
echo -e "\nDone! Run OpenRCT2 by typing:\n\nwine openrct2.exe\n"
fi