2014-02-06 07:28:29 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# This should be run inside a folder that contains sourcemod, otherwise, it will checkout things into "sm-dependencies".
|
|
|
|
|
|
|
|
trap "exit" INT
|
|
|
|
|
|
|
|
ismac=0
|
2014-02-07 02:45:35 +01:00
|
|
|
iswin=0
|
|
|
|
|
|
|
|
archive_ext=tar.gz
|
2014-12-20 11:32:15 +01:00
|
|
|
decomp="tar zxf"
|
2014-02-07 02:45:35 +01:00
|
|
|
|
2014-02-06 07:28:29 +01:00
|
|
|
if [ `uname` = "Darwin" ]; then
|
|
|
|
ismac=1
|
2014-02-07 02:45:35 +01:00
|
|
|
elif [ `uname` != "Linux" ] && [ -n "${COMSPEC:+1}" ]; then
|
|
|
|
iswin=1
|
|
|
|
archive_ext=zip
|
|
|
|
decomp=unzip
|
2014-02-06 07:28:29 +01:00
|
|
|
fi
|
|
|
|
|
2014-05-25 10:53:58 +02:00
|
|
|
if [ ! -d "sourcemod" ]; then
|
2014-02-06 07:28:29 +01:00
|
|
|
if [ ! -d "sourcemod-1.5" ]; then
|
2014-02-16 02:13:13 +01:00
|
|
|
echo "Could not find a SourceMod repository; make sure you aren't running this script inside it."
|
|
|
|
exit 1
|
2014-02-06 07:28:29 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ismac -eq 1 ]; then
|
|
|
|
mysqlver=mysql-5.5.28-osx10.5-x86
|
2014-02-07 02:45:35 +01:00
|
|
|
mysqlurl=http://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext
|
|
|
|
elif [ $iswin -eq 1 ]; then
|
|
|
|
mysqlver=mysql-noinstall-5.0.24a-win32
|
|
|
|
mysqlurl=http://cdn.mysql.com/archives/mysql-5.0/$mysqlver.$archive_ext
|
|
|
|
# The folder in the zip archive does not contain the substring "-noinstall", so strip it
|
|
|
|
mysqlver=${mysqlver/-noinstall}
|
2014-02-06 07:28:29 +01:00
|
|
|
else
|
|
|
|
mysqlver=mysql-5.6.15-linux-glibc2.5-i686
|
2014-02-07 02:45:35 +01:00
|
|
|
mysqlurl=http://cdn.mysql.com/archives/mysql-5.6/$mysqlver.$archive_ext
|
2014-02-06 07:28:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "mysql-5.0" ]; then
|
|
|
|
if [ `command -v wget` ]; then
|
2014-02-07 02:45:35 +01:00
|
|
|
wget $mysqlurl -O mysql.$archive_ext
|
2014-02-06 07:28:29 +01:00
|
|
|
elif [ `command -v curl` ]; then
|
2014-02-07 02:45:35 +01:00
|
|
|
curl -o mysql.$archive_ext $mysqlurl
|
2014-02-06 07:28:29 +01:00
|
|
|
else
|
|
|
|
echo "Failed to locate wget or curl. Install one of these programs to download MySQL."
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-02-07 02:45:35 +01:00
|
|
|
$decomp mysql.$archive_ext
|
2014-02-06 07:28:29 +01:00
|
|
|
mv $mysqlver mysql-5.0
|
2014-02-07 02:45:35 +01:00
|
|
|
rm mysql.$archive_ext
|
2014-02-06 07:28:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
checkout ()
|
|
|
|
{
|
|
|
|
if [ ! -d "$name" ]; then
|
2014-05-25 10:53:58 +02:00
|
|
|
git clone $repo -b $branch $name
|
|
|
|
if [ -n "$origin" ]; then
|
|
|
|
cd $name
|
|
|
|
git remote rm origin
|
|
|
|
git remote add origin $origin
|
|
|
|
cd ..
|
|
|
|
fi
|
2014-02-06 07:28:29 +01:00
|
|
|
else
|
|
|
|
cd $name
|
2014-05-25 10:53:58 +02:00
|
|
|
git checkout $branch
|
|
|
|
git pull origin $branch
|
2014-02-06 07:28:29 +01:00
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
name=mmsource-1.10
|
2014-05-25 10:53:58 +02:00
|
|
|
branch=1.10-dev
|
|
|
|
repo="https://github.com/alliedmodders/metamod-source"
|
|
|
|
origin=
|
2014-02-06 07:28:29 +01:00
|
|
|
checkout
|
|
|
|
|
2014-05-25 10:53:58 +02:00
|
|
|
sdks=( csgo hl2dm nucleardawn l4d2 dods l4d css tf2 insurgency sdk2013 dota )
|
2014-02-06 07:28:29 +01:00
|
|
|
|
|
|
|
if [ $ismac -eq 0 ]; then
|
2014-02-07 02:45:35 +01:00
|
|
|
# Add these SDKs for Windows or Linux
|
2015-05-07 03:12:13 +02:00
|
|
|
sdks+=( orangebox blade episode1 bms )
|
2014-02-07 02:45:35 +01:00
|
|
|
|
|
|
|
# Add more SDKs for Windows only
|
|
|
|
if [ $iswin -eq 1 ]; then
|
2014-04-20 07:37:20 +02:00
|
|
|
sdks+=( darkm swarm bgt eye contagion )
|
2014-02-07 02:45:35 +01:00
|
|
|
fi
|
2014-02-06 07:28:29 +01:00
|
|
|
fi
|
|
|
|
|
2014-05-25 10:53:58 +02:00
|
|
|
# Check out a local copy as a proxy.
|
|
|
|
if [ ! -d "hl2sdk-proxy-repo" ]; then
|
|
|
|
git clone --mirror https://github.com/alliedmodders/hl2sdk hl2sdk-proxy-repo
|
|
|
|
else
|
|
|
|
cd hl2sdk-proxy-repo
|
|
|
|
git fetch
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2014-02-06 07:28:29 +01:00
|
|
|
for sdk in "${sdks[@]}"
|
|
|
|
do
|
2014-05-25 10:53:58 +02:00
|
|
|
repo=hl2sdk-proxy-repo
|
|
|
|
origin="https://github.com/alliedmodders/hl2sdk"
|
2014-02-06 07:28:29 +01:00
|
|
|
name=hl2sdk-$sdk
|
2014-05-25 10:53:58 +02:00
|
|
|
branch=$sdk
|
2014-02-06 07:28:29 +01:00
|
|
|
checkout
|
|
|
|
done
|
|
|
|
|
2014-02-16 02:13:13 +01:00
|
|
|
`python -c "import ambuild2"`
|
|
|
|
if [ $? -eq 1 ]; then
|
2014-05-25 10:53:58 +02:00
|
|
|
repo="https://github.com/alliedmodders/ambuild"
|
|
|
|
origin=
|
|
|
|
branch=master
|
|
|
|
name=ambuild
|
2014-02-16 02:13:13 +01:00
|
|
|
checkout
|
|
|
|
|
|
|
|
cd ambuild
|
|
|
|
if [ $iswin -eq 1 ]; then
|
|
|
|
python setup.py install
|
|
|
|
else
|
|
|
|
python setup.py build
|
2015-04-02 08:51:18 +02:00
|
|
|
echo "Installing AMBuild at the user level. Location can be: ~/.local/bin"
|
|
|
|
python setup.py install --user
|
2014-02-16 02:13:13 +01:00
|
|
|
fi
|
|
|
|
fi
|