mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-07 21:10:46 +08:00
ci: migrate to GitHub Actions
* travis: disable build, disable deploy, add free aarch64/ppc64le/s390x builds * scripts: cleanup of old CI scripts * scripts: now port to GitHub Actions * actions: fix extras checkout * github: remove codeql action, turned out not to be very useful * github: remove quiet flag on wget * github: are we allowed to use envvars? * github: add needed dependencies for linux * github: install wget for windows * scripts: convert our CPU architecture naming into what AppImage uses * github: run scripts with bash explicitly * github: first try to upload to GitHub Releases, enable amd64 win32 builds * Use our uploadtool fork * ci: include android, motomagx build for gha, refactor cirrus and travis ci scripts * gha: try to fix build * travis: try to fix build * gha: try to fix upload, fix win32 build * gha: use curl instead of wget, as it's preinstalled for windows. Fix Android build * gha: add llvm repository, install clang-12 for android * gha: motomagx: fail fast * gha: android: explicitly set clang-12 as compiler and llvm-strip-12 as strip * waifulib: xcompile: respect environment variables when using host compiler for Android * waifulib: xcompile: use correct environ dict * gha: try to fix -fuse-ld=lld with clang-12 * waifulib: xcompile: fix typo * scripts: xcompile: fix motomagx build * mainui: upgrade * gha: fix android build, last time * engine: wscript: disable crashhandler for magx
This commit is contained in:
committed by
GitHub
parent
9287a0f5c5
commit
21a31ec81d
103
scripts/travis/build_linux.sh
Executable file
103
scripts/travis/build_linux.sh
Executable file
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
|
||||
. scripts/lib.sh
|
||||
|
||||
APP=xash3d-fwgs
|
||||
APPDIR=$APP
|
||||
APPIMAGE=$APP-$ARCH.tar.xz
|
||||
|
||||
build_sdl2()
|
||||
{
|
||||
cd "$BUILDDIR"/SDL2_src || die
|
||||
if [ "$ARCH" = "i386" ]; then
|
||||
export CFLAGS="-msse2 -march=i686 -m32 -ggdb -O2"
|
||||
export LDFLAGS="-m32"
|
||||
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 "$BUILDDIR"/SDL2_linux
|
||||
make install DESTDIR="$BUILDDIR"/SDL2_linux || die
|
||||
export CFLAGS=""
|
||||
export LDFLAGS=""
|
||||
}
|
||||
|
||||
build_engine()
|
||||
{
|
||||
# Build engine
|
||||
cd "$BUILDDIR" || die
|
||||
|
||||
if [ "$ARCH" = "amd64" ]; then # we need enabling 64-bit target only on Intel-compatible CPUs
|
||||
AMD64="-8"
|
||||
fi
|
||||
|
||||
if [ "$1" = "dedicated" ]; then
|
||||
./waf configure -T release -d -W $AMD64 || die
|
||||
elif [ "$1" = "full" ]; then
|
||||
./waf configure --sdl2=SDL2_linux -T release --enable-stb --prefix="$APPDIR" -W $AMD64 --enable-utils || die
|
||||
else
|
||||
die
|
||||
fi
|
||||
|
||||
./waf build || die
|
||||
}
|
||||
|
||||
build_archive()
|
||||
{
|
||||
cd "$BUILDDIR" || die
|
||||
|
||||
./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" = "i386" ]; then
|
||||
cp vgui-dev/lib/vgui.so "$APPDIR/"
|
||||
fi
|
||||
|
||||
cat > "$APPDIR"/run.sh << 'EOF'
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$XASH3D_BASEDIR" = "" ]; then
|
||||
export XASH3D_BASEDIR=$PWD
|
||||
fi
|
||||
echo "Xash3D FWGS installed as tarball."
|
||||
echo "Base directory is $XASH3D_BASEDIR. Set XASH3D_BASEDIR environment variable to override this"
|
||||
|
||||
export XASH3D_EXTRAS_PAK1="${XASH3D_BASEDIR}"/extras.pak
|
||||
export LD_LIBRARY_PATH="${XASH3D_BASEDIR}":$LD_LIBRARY_PATH
|
||||
${DEBUGGER} "${XASH3D_BASEDIR}"/xash3d "$@"
|
||||
exit $?
|
||||
EOF
|
||||
|
||||
chmod +x "$APPDIR"/xash3d "$APPDIR"/run.sh # Engine launcher & engine launcher script
|
||||
|
||||
echo "Contents of tarball: "
|
||||
ls -R "$APPDIR"
|
||||
|
||||
tar -cJvf $APPIMAGE $APPDIR/*
|
||||
}
|
||||
|
||||
rm -rf build # clean-up build directory
|
||||
build_engine dedicated
|
||||
mv build/engine/xash xashds-linux-$ARCH
|
||||
|
||||
rm -rf build
|
||||
build_sdl2
|
||||
build_engine full
|
||||
build_archive
|
||||
1
scripts/travis/deps_common.sh
Executable file
1
scripts/travis/deps_common.sh
Executable file
@@ -0,0 +1 @@
|
||||
git clone --depth 1 https://github.com/FWGS/xash-extras
|
||||
4
scripts/travis/deps_linux.sh
Executable file
4
scripts/travis/deps_linux.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
# SDL2 sources. We will build our own version
|
||||
curl http://libsdl.org/release/SDL2-$SDL_VERSION.zip -o SDL2.zip
|
||||
unzip -q SDL2.zip
|
||||
mv SDL2-$SDL_VERSION SDL2_src
|
||||
Reference in New Issue
Block a user