diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bbe8dee --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: cpp +compiler: + - clang +before_script: + - sudo apt-get update -qq + - sudo apt-get install -y python-software-properties + - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/ppa + - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + - sudo apt-get update -qq + - sudo apt-get install -qq g++-4.8 + - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 + - echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" | sudo tee --append /etc/apt/sources.list + - echo "deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" | sudo tee --append /etc/apt/sources.list + - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - + - sudo apt-get update -qq + - sudo apt-get install -y g++-multilib libc6-dev-i386 lib32stdc++6 lib32z1-dev clang-3.5 + - CHECKOUT_DIR=$PWD && cd .. && $CHECKOUT_DIR/support/checkout-deps.sh && cd $CHECKOUT_DIR +script: + - mkdir build && cd build + - CC=clang-3.5 CXX=clang-3.5 python ../configure.py --enable-optimize + - ambuild \ No newline at end of file diff --git a/support/checkout-deps.sh b/support/checkout-deps.sh new file mode 100755 index 0000000..8fea789 --- /dev/null +++ b/support/checkout-deps.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# This should be run inside a folder that contains MM:S, otherwise, it will checkout things into "mms-dependencies". + +trap "exit" INT + +ismac=0 +iswin=0 + +archive_ext=tar.gz +decomp="tar zxf" + +if [ `uname` = "Darwin" ]; then + ismac=1 +elif [ `uname` != "Linux" ] && [ -n "${COMSPEC:+1}" ]; then + iswin=1 + archive_ext=zip + decomp=unzip +fi + +if [ ! -d "metamod-source" ]; then + echo "Could not find a Metamod:Source repository; make sure you aren't running this script inside it." + exit 1 +fi + +checkout () +{ + if [ ! -d "$name" ]; then + git clone $repo -b $branch $name + if [ -n "$origin" ]; then + cd $name + git remote rm origin + git remote add origin $origin + cd .. + fi + else + cd $name + git checkout $branch + git pull origin $branch + cd .. + fi +} + +sdks=( csgo hl2dm nucleardawn l4d2 dods l4d css tf2 insurgency sdk2013 dota ) + +if [ $ismac -eq 0 ]; then + # Add these SDKs for Windows or Linux + sdks+=( orangebox blade episode1 ) + + # Add more SDKs for Windows only + if [ $iswin -eq 1 ]; then + sdks+=( darkm swarm bgt eye contagion ) + fi +fi + +# 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 + +for sdk in "${sdks[@]}" +do + repo=hl2sdk-proxy-repo + origin="https://github.com/alliedmodders/hl2sdk" + name=hl2sdk-$sdk + branch=$sdk + checkout +done + +`python -c "import ambuild2"` +if [ $? -eq 1 ]; then + repo="https://github.com/alliedmodders/ambuild" + origin= + branch=master + name=ambuild + checkout + + cd ambuild + if [ $iswin -eq 1 ]; then + python setup.py install + else + python setup.py build + echo "About to install AMBuild - press Ctrl+C to abort, otherwise enter your password for sudo." + sudo python setup.py install + fi +fi