mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
scripts: allow building dedicated, rename appimage to lower-case, fix warnings found by shellcheck
This commit is contained in:
parent
35ae421ac1
commit
7c8105247c
10
.travis.yml
10
.travis.yml
@ -36,10 +36,11 @@ jobs:
|
|||||||
- sh scripts/travis_common_deps.sh
|
- sh scripts/travis_common_deps.sh
|
||||||
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||||
script:
|
script:
|
||||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
|
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh full
|
||||||
|
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh dedicated
|
||||||
after_script:
|
after_script:
|
||||||
- ccache --show-stats
|
- ccache --show-stats
|
||||||
- sh scripts/continious_upload.sh Xash3DFWGS-${ARCH}.AppImage
|
- sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.AppImage xashds-linux-${ARCH}
|
||||||
- # ...
|
- # ...
|
||||||
name: "Build for Linux amd64"
|
name: "Build for Linux amd64"
|
||||||
cache: ccache
|
cache: ccache
|
||||||
@ -60,10 +61,11 @@ jobs:
|
|||||||
- sh scripts/travis_common_deps.sh
|
- sh scripts/travis_common_deps.sh
|
||||||
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
- sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh
|
||||||
script:
|
script:
|
||||||
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh
|
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh full
|
||||||
|
- sh scripts/build_${TRAVIS_OS_NAME}_engine.sh dedicated
|
||||||
after_script:
|
after_script:
|
||||||
- ccache --show-stats
|
- ccache --show-stats
|
||||||
- sh scripts/continious_upload.sh Xash3DFWGS-${ARCH}.AppImage
|
- sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.AppImage xashds-linux-${ARCH}
|
||||||
# - # ...
|
# - # ...
|
||||||
# name: "Build for Android"
|
# name: "Build for Android"
|
||||||
# cache: ccache
|
# cache: ccache
|
||||||
|
@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
. scripts/lib.sh
|
. scripts/lib.sh
|
||||||
|
|
||||||
if [ ! $ARCH ]; then
|
if [ "$1" = "dedicated" ]; then
|
||||||
|
APP=xashds
|
||||||
|
APPNAME=$APP-linux-$ARCH # since we have no extension, mark executable name that it for linux
|
||||||
|
else # elif [ "$1" = "full" ]; then
|
||||||
|
APP=xash3d-fwgs
|
||||||
|
APPNAME=$APP-$ARCH
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! "$ARCH" ]; then
|
||||||
ARCH=i686
|
ARCH=i686
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -10,14 +18,10 @@ fi
|
|||||||
export CC="ccache gcc"
|
export CC="ccache gcc"
|
||||||
export CXX="ccache g++"
|
export CXX="ccache g++"
|
||||||
|
|
||||||
# AppImage settings
|
|
||||||
APP=Xash3DFWGS
|
|
||||||
APPDIR=$APP-$ARCH.AppDir
|
|
||||||
APPIMAGE=$APP-$ARCH.AppImage
|
|
||||||
|
|
||||||
build_sdl2()
|
build_sdl2()
|
||||||
{
|
{
|
||||||
cd $TRAVIS_BUILD_DIR/SDL2_src
|
cd "$TRAVIS_BUILD_DIR"/SDL2_src || die
|
||||||
if [ "$ARCH" = "i686" ]; then
|
if [ "$ARCH" = "i686" ]; then
|
||||||
export CFLAGS="-msse2 -march=i686 -m32 -ggdb -O2"
|
export CFLAGS="-msse2 -march=i686 -m32 -ggdb -O2"
|
||||||
export LDFLAGS="-m32"
|
export LDFLAGS="-m32"
|
||||||
@ -29,8 +33,8 @@ build_sdl2()
|
|||||||
--enable-wayland-shared --enable-x11-shared \
|
--enable-wayland-shared --enable-x11-shared \
|
||||||
--prefix / || die # get rid of /usr/local stuff
|
--prefix / || die # get rid of /usr/local stuff
|
||||||
make -j2 || die
|
make -j2 || die
|
||||||
mkdir -p $TRAVIS_BUILD_DIR/SDL2_linux
|
mkdir -p "$TRAVIS_BUILD_DIR"/SDL2_linux
|
||||||
make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux || die
|
make install DESTDIR="$TRAVIS_BUILD_DIR"/SDL2_linux || die
|
||||||
export CFLAGS=""
|
export CFLAGS=""
|
||||||
export LDFLAGS=""
|
export LDFLAGS=""
|
||||||
}
|
}
|
||||||
@ -38,31 +42,42 @@ build_sdl2()
|
|||||||
build_engine()
|
build_engine()
|
||||||
{
|
{
|
||||||
# Build engine
|
# Build engine
|
||||||
cd $TRAVIS_BUILD_DIR
|
cd "$TRAVIS_BUILD_DIR" || die
|
||||||
|
|
||||||
WAF_CONFIGURE_FLAGS="--sdl2=$TRAVIS_BUILD_DIR/SDL2_linux -T release --enable-stb --prefix=$APPDIR --win-style-install"
|
|
||||||
if [ "$ARCH" = "x86_64" ]; then # we need enabling 64-bit target only on Intel-compatible CPUs
|
if [ "$ARCH" = "x86_64" ]; then # we need enabling 64-bit target only on Intel-compatible CPUs
|
||||||
WAF_CONFIGURE_FLAGS="$WAF_CONFIGURE_FLAGS -8"
|
AMD64="-8"
|
||||||
fi
|
fi
|
||||||
./waf configure $WAF_CONFIGURE_FLAGS || die
|
|
||||||
|
if [ "$APP" = "xashds" ]; then
|
||||||
|
./waf configure -T release --single-binary -d -W "$AMD64" || die
|
||||||
|
elif [ "$APP" = "xash3d-fwgs" ]; then
|
||||||
|
APPDIR=$APPNAME.AppDir
|
||||||
|
./waf configure --sdl2=SDL2_linux -T release --enable-stb --prefix="$APPDIR" -W "$AMD64" || die
|
||||||
|
else
|
||||||
|
die
|
||||||
|
fi
|
||||||
|
|
||||||
./waf build || die
|
./waf build || die
|
||||||
}
|
}
|
||||||
|
|
||||||
build_appimage()
|
build_appimage()
|
||||||
{
|
{
|
||||||
cd $TRAVIS_BUILD_DIR
|
APPDIR=$APPNAME.AppDir
|
||||||
|
APPIMAGE=$APPNAME.AppImage
|
||||||
|
|
||||||
|
cd "$TRAVIS_BUILD_DIR" || die
|
||||||
|
|
||||||
./waf install || die
|
./waf install || die
|
||||||
|
|
||||||
# Generate extras.pak
|
# Generate extras.pak
|
||||||
python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak
|
python3 scripts/makepak.py xash-extras/ "$APPDIR/extras.pak"
|
||||||
|
|
||||||
cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/
|
cp SDL2_linux/lib/libSDL2-2.0.so.0 "$APPDIR/"
|
||||||
if [ "$ARCH" = "i686" ]; then
|
if [ "$ARCH" = "i686" ]; then
|
||||||
cp vgui-dev/lib/vgui.so $APPDIR/
|
cp vgui-dev/lib/vgui.so "$APPDIR/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat > $APPDIR/AppRun << 'EOF'
|
cat > "$APPDIR"/AppRun << 'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$XASH3D_BASEDIR" = "" ]; then
|
if [ "$XASH3D_BASEDIR" = "" ]; then
|
||||||
@ -77,14 +92,14 @@ ${DEBUGGER} "${APPDIR}"/xash3d "$@"
|
|||||||
exit $?
|
exit $?
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x $APPDIR/xash3d $APPDIR/AppRun # Engine launcher & engine launcher script
|
chmod +x "$APPDIR"/xash3d "$APPDIR"/AppRun # Engine launcher & engine launcher script
|
||||||
|
|
||||||
echo "Contents of AppImage: "
|
echo "Contents of AppImage: "
|
||||||
ls -R $APPDIR
|
ls -R "$APPDIR"
|
||||||
|
|
||||||
wget "https://raw.githubusercontent.com/FWGS/fwgs-artwork/master/xash3d/icon_512.png" -O $APPDIR/$APP.png
|
wget "https://raw.githubusercontent.com/FWGS/fwgs-artwork/master/xash3d/icon_512.png" -O "$APPDIR/$APP.png"
|
||||||
|
|
||||||
cat > $APPDIR/$APP.desktop <<EOF
|
cat > "$APPDIR/$APP.desktop" <<EOF
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=$APP
|
Name=$APP
|
||||||
Icon=$APP
|
Icon=$APP
|
||||||
@ -94,10 +109,18 @@ Categories=Game;
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage"
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage"
|
||||||
chmod +x appimagetool-$ARCH.AppImage
|
chmod +x "appimagetool-$ARCH.AppImage"
|
||||||
./appimagetool-$ARCH.AppImage $APPDIR $APPIMAGE
|
./appimagetool-$ARCH.AppImage "$APPDIR" "$APPIMAGE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rm -rf build # clean-up build directory
|
||||||
|
|
||||||
|
if [ $APP != "xashds" ]; then
|
||||||
build_sdl2
|
build_sdl2
|
||||||
|
fi
|
||||||
build_engine
|
build_engine
|
||||||
|
if [ $APP != "xashds" ]; then
|
||||||
build_appimage
|
build_appimage
|
||||||
|
else
|
||||||
|
mv build/engine/xash $APPNAME
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user