Browse Source

travis: enable building and publishing for AMD64. Use at your own risk!

pull/2/head
Alibek Omarov 5 years ago
parent
commit
827105405f
  1. 50
      .travis.yml
  2. 50
      scripts/build_appimage.sh
  3. 116
      scripts/build_linux_engine.sh
  4. 2
      scripts/travis_common_deps.sh

50
.travis.yml

@ -14,14 +14,15 @@ jdk: @@ -14,14 +14,15 @@ jdk:
jobs:
include:
- stage: build
name: "Build for Linux & Android"
name: "Build for Linux i686"
cache: ccache
os: linux
dist: xenial
env:
- ARCH=i686
addons:
apt:
packages:
- p7zip-full
- gcc-multilib
- g++-multilib
- libx11-dev:i386
@ -29,19 +30,56 @@ jobs: @@ -29,19 +30,56 @@ jobs:
- x11-utils
- libgl1-mesa-dev
- libasound-dev
- zlib1g:i386
- libstdc++6:i386
- libfuse2:i386
before_script:
- sh scripts/travis_common_deps.sh
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk
script:
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
after_script:
- ccache --show-stats
- sh scripts/continious_upload.sh Xash3DFWGS-i386.AppImage
- sh scripts/continious_upload.sh Xash3DFWGS-${ARCH}.AppImage
- # ...
name: "Build for Linux amd64"
cache: ccache
os: linux
dist: xenial
env:
- ARCH=amd64
addons:
apt:
packages:
- libx11-dev
- libxext-dev
- x11-utils
- libgl1-mesa-dev
- libasound-dev
- libstdc++6
- libfuse2
before_script:
- sh scripts/travis_common_deps.sh
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
script:
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
after_script:
- ccache --show-stats
- sh scripts/continious_upload.sh Xash3DFWGS-${ARCH}.AppImage
# - # ...
# name: "Build for Android"
# cache: ccache
# os: linux
# dist: xenial
# before_script:
# - sh scripts/travis_common_deps.sh
# - sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
# - export ANDROID_HOME=$PWD/android-sdk-linux
# - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk
# script:
# - sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
# after_script:
# - ccache --show-stats
# - sh scripts/continious_upload.sh xash3d-fwgs.apk
# - # ...
# name: "Build for Windows MinGW"
# cache: ccache

50
scripts/build_appimage.sh

@ -1,50 +0,0 @@ @@ -1,50 +0,0 @@
#!/bin/sh
APP=Xash3DFWGS
ARCH=i686
APPDIR=$APP-i386.AppDir
# Copy all needed files
./waf install
mv appimage $APPDIR
# Generate extras.pak
python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak
cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/
cp vgui-dev/lib/vgui.so $APPDIR/
cat > $APPDIR/AppRun << 'EOF'
#!/bin/sh
echo "Xash3D FWGS installed as AppImage."
if [ "$XASH3D_BASEDIR" = "" ]; then
export XASH3D_BASEDIR=$PWD
fi
export XASH3D_EXTRAS_PAK1="${APPDIR}"/extras.pak
export LD_LIBRARY_PATH="${APPDIR}":$LD_LIBRARY_PATH
${DEBUGGER} "${APPDIR}"/xash3d "$@"
exit $?
EOF
chmod +x $APPDIR/xash3d # Engine launcher
chmod +x $APPDIR/AppRun # Engine launcher script
echo "Contents of AppImage: "
ls $APPDIR
wget "https://raw.githubusercontent.com/FWGS/fwgs-artwork/master/xash3d/icon_512.png" -O $APPDIR/$APP.png
cat > $APPDIR/$APP.desktop <<EOF
[Desktop Entry]
Name=$APP
Icon=$APP
Type=Application
Exec=AppRun
Categories=Game;
EOF
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage"
chmod +x appimagetool-$ARCH.AppImage
./appimagetool-$ARCH.AppImage $APPDIR

116
scripts/build_linux_engine.sh

@ -1,38 +1,100 @@ @@ -1,38 +1,100 @@
#!/bin/bash
# Build custom SDL2
. scripts/lib.sh
if [ ! $ARCH ]; then
ARCH=i686
fi
# set up ccache
export CC="ccache gcc"
export CXX="ccache g++"
# AppImage settings
APP=Xash3DFWGS
APPDIR=$APP-$ARCH.AppDir
build_sdl2()
{
cd $TRAVIS_BUILD_DIR/SDL2_src
export CC="ccache gcc -msse2 -march=i686 -m32 -ggdb -O2"
./configure \
--disable-dependency-tracking \
--disable-render \
--disable-haptic \
--disable-power \
--disable-filesystem \
--disable-file \
--enable-alsa-shared \
--enable-pulseaudio-shared \
--enable-wayland-shared \
--enable-x11-shared \
--disable-libudev \
--disable-dbus \
--disable-ibus \
--disable-ime \
--disable-fcitx \
--prefix / # get rid of /usr/local stuff
make -j2
if [ $ARCH == "i686" ]; then # yes, it isn't good to pass flags as CC, but I don't want to clear CFLAGS after building SDL2
export CFLAGS="-msse2 -march=i686 -m32 -ggdb -O2"
fi
./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 $TRAVIS_BUILD_DIR/SDL2_linux
make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux
make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux || die
export CFLAGS=""
}
build_engine()
{
# Build engine
cd $TRAVIS_BUILD_DIR
export CC="ccache gcc"
export CXX="ccache g++"
./waf configure -s SDL2_linux -T debug --enable-stb --prefix="appimage" --win-style-install || die
WAF_CONFIGURE_FLAGS="-s SDL2_linux -T release --enable-stb --prefix=$APPDIR --win-style-install"
if [ $ARCH == "amd64" ]; then # we need enabling 64-bit target only on Intel-compatible CPUs
WAF_CONFIGURE_FLAGS="$WAF_CONFIGURE_FLAGS -8"
fi
./waf configure $WAF_CONFIGURE_FLAGS || die
./waf build || die
}
build_appimage()
{
cd $TRAVIS_BUILD_DIR
./waf install || die
# Generate extras.pak
python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak
cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/
if [ $ARCH == "i686" ]; then
cp vgui-dev/lib/vgui.so $APPDIR/
fi
cat > $APPDIR/AppRun << 'EOF'
#!/bin/sh
if [ "$XASH3D_BASEDIR" = "" ]; then
export XASH3D_BASEDIR=$PWD
fi
echo "Xash3D FWGS installed as AppImage."
echo "Base directory is $XASH3D_BASEDIR. Set XASH3D_BASEDIR environment variable to override this"
export XASH3D_EXTRAS_PAK1="${APPDIR}"/extras.pak
export LD_LIBRARY_PATH="${APPDIR}":$LD_LIBRARY_PATH
${DEBUGGER} "${APPDIR}"/xash3d "$@"
exit $?
EOF
chmod +x $APPDIR/xash3d $APPDIR/AppRun # Engine launcher & engine launcher script
echo "Contents of AppImage: "
ls -R $APPDIR
wget "https://raw.githubusercontent.com/FWGS/fwgs-artwork/master/xash3d/icon_512.png" -O $APPDIR/$APP.png
cat > $APPDIR/$APP.desktop <<EOF
[Desktop Entry]
Name=$APP
Icon=$APP
Type=Application
Exec=AppRun
Categories=Game;
EOF
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage"
chmod +x appimagetool-$ARCH.AppImage
./appimagetool-$ARCH.AppImage $APPDIR
}
# Build AppImage
scripts/build_appimage.sh
build_sdl2
build_engine
build_appimage

2
scripts/travis_common_deps.sh

@ -1,3 +1 @@ @@ -1,3 +1 @@
git clone --depth 1 https://github.com/FWGS/vgui-dev
git clone --depth 1 https://github.com/FWGS/vgui_support_bin
git clone --depth 1 https://github.com/FWGS/xash-extras

Loading…
Cancel
Save