From 83d3c02e53df47524bdc9557d0ffb004c4979760 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 16 Oct 2019 02:09:22 +0300 Subject: [PATCH] ci: add Cirrus CI support with FreeBSD --- .cirrus.yml | 29 +++++++++++++++++++++ scripts/build_freebsd_engine.sh | 45 +++++++++++++++++++++++++++++++++ scripts/travis_linux_deps.sh | 18 ------------- 3 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 .cirrus.yml create mode 100644 scripts/build_freebsd_engine.sh diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..839c6117 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,29 @@ +task: + name: freebsd-10-amd64 + freebsd_instance: + image: freebsd-10-4 + setup_script: + - ./scripts/travis_linux_deps.sh + test_script: + - ./scripts/build_freebsd_engine.sh dedicated + - ./scripts/build_freebsd_engine.sh + +task: + name: freebsd-11-amd64 + freebsd_instance: + image: freebsd-11-3 + setup_script: + - ./scripts/travis_linux_deps.sh + test_script: + - ./scripts/build_freebsd_engine.sh dedicated + - ./scripts/build_freebsd_engine.sh + +task: + name: freebsd-12-amd64 + freebsd_instance: + image: freebsd-12-0 + setup_script: + - ./scripts/travis_linux_deps.sh + test_script: + - ./scripts/build_freebsd_engine.sh dedicated + - ./scripts/build_freebsd_engine.sh diff --git a/scripts/build_freebsd_engine.sh b/scripts/build_freebsd_engine.sh new file mode 100644 index 00000000..1803bf0a --- /dev/null +++ b/scripts/build_freebsd_engine.sh @@ -0,0 +1,45 @@ +#!/bin/bash + + +if [ "$1" = "dedicated" ]; then + APP=xashds +else # elif [ "$1" = "full" ]; then + APP=xash3d-fwgs +fi + +build_sdl2() +{ + cd "$CIRRUS_WORKING_DIR"/SDL2_src || die + ./configure --disable-render --disable-haptic --disable-power --disable-filesystem \ + --disable-file --disable-libudev --disable-dbus --disable-ibus \ + --disable-ime --disable-fcitx \ + --enable-alsa-shared --enable-pulseaudio-shared \ + --enable-wayland-shared --enable-x11-shared \ + --prefix / || die # get rid of /usr/local stuff + make -j2 || die + mkdir -p "$CIRRUS_WORKING_DIR"/SDL2_bsd + make install DESTDIR="$CIRRUS_WORKING_DIR"/SDL2_bsd || die +} + +build_engine() +{ + # Build engine + cd "$CIRRUS_WORKING_DIR" || die + + if [ "$APP" = "xashds" ]; then + ./waf configure -T release --single-binary -d -W || die + elif [ "$APP" = "xash3d-fwgs" ]; then + ./waf configure --sdl2=SDL2_bsd -T release --enable-stb -W || die + else + die + fi + + ./waf build || die +} + +rm -rf build # clean-up build directory + +if [ $APP != "xashds" ]; then + build_sdl2 +fi +build_engine diff --git a/scripts/travis_linux_deps.sh b/scripts/travis_linux_deps.sh index 886597ba..6f8421f0 100755 --- a/scripts/travis_linux_deps.sh +++ b/scripts/travis_linux_deps.sh @@ -1,21 +1,3 @@ # SDL2 sources. We will build our own version curl -s http://libsdl.org/release/SDL2-$SDL_VERSION.tar.gz | tar xzf - mv SDL2-$SDL_VERSION SDL2_src - -# Android build deps -# curl -s http://dl.google.com/android/android-sdk_r22.0.4-linux.tgz | tar xzf - -# export ANDROID_HOME=$PWD/android-sdk-linux -# export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk -# sleep 3s; echo y | android update sdk -u --filter platform-tools,build-tools-19.0.0,android-19 --force --all > /dev/null -# wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin >/dev/null 2>/dev/null -# 7z x ./android-ndk-r10e-linux-x86_64.bin > /dev/null -# mv android-ndk-r10e android-ndk - -# git clone --depth 1 https://github.com/FWGS/xash3d-android-project -# cd $TRAVIS_BUILD_DIR/xash3d-android-project -# cp debug.keystore ~/.android/debug.keystore -# git submodule update --init jni/src/NanoGL/nanogl xash-extras -# git clone --depth 1 https://github.com/FWGS/hlsdk-xash3d jni/src/hlsdk-xash3d -# rm -r jni/src/Xash3D/xash3d -# ln -s $TRAVIS_BUILD_DIR jni/src/Xash3D/xash3d -cd $TRAVIS_BUILD_DIR