Browse Source

ci: add Cirrus CI support with FreeBSD

pull/2/head
Alibek Omarov 5 years ago
parent
commit
83d3c02e53
  1. 29
      .cirrus.yml
  2. 45
      scripts/build_freebsd_engine.sh
  3. 18
      scripts/travis_linux_deps.sh

29
.cirrus.yml

@ -0,0 +1,29 @@ @@ -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

45
scripts/build_freebsd_engine.sh

@ -0,0 +1,45 @@ @@ -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

18
scripts/travis_linux_deps.sh

@ -1,21 +1,3 @@ @@ -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

Loading…
Cancel
Save