From 041315da44cb9ea4d75c3156afb51838ccd26978 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 8 Apr 2019 16:54:13 +0300 Subject: [PATCH] scripts: use waf install to generate packages --- scripts/build_appimage.sh | 8 +++----- scripts/build_linux_engine.sh | 2 +- scripts/build_mingw_engine.sh | 11 +++++------ scripts/build_osx_engine.sh | 5 ++--- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh index 4b57b000..06c69ebf 100755 --- a/scripts/build_appimage.sh +++ b/scripts/build_appimage.sh @@ -9,12 +9,10 @@ mkdir -p $APPDIR python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak # Copy all needed files +./waf install +mv appimage $APPDIR cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/ cp vgui-dev/lib/vgui.so $APPDIR/ -cp build/engine/libxash.so \ - build/mainui/libmenu.so \ - build/vgui_support/libvgui_support.so \ - build/game_launch/xash3d $APPDIR cat > $APPDIR/AppRun << 'EOF' #!/bin/sh @@ -22,7 +20,7 @@ cat > $APPDIR/AppRun << 'EOF' echo "Xash3D FWGS installed as AppImage." ENGINEROOT=$(dirname -- "$(readlink -f -- "$0")") -if [ -z "$XASH3D_BASEDIR" ]; then +if [ "$XASH3D_BASEDIR" == "" ]; then export XASH3D_BASEDIR=$PWD fi export XASH3D_EXTRAS_PAK1="${ENGINEROOT}"/extras.pak diff --git a/scripts/build_linux_engine.sh b/scripts/build_linux_engine.sh index db7796e5..452e5469 100755 --- a/scripts/build_linux_engine.sh +++ b/scripts/build_linux_engine.sh @@ -31,7 +31,7 @@ make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux cd $TRAVIS_BUILD_DIR export CC="ccache gcc" export CXX="ccache g++" -./waf configure --sdl2=$TRAVIS_BUILD_DIR/SDL2_linux --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug --enable-stb || die +./waf configure -s SDL2_linux -T debug --enable-stb --prefix="appimage" --win-style-install || die ./waf build || die # Build AppImage diff --git a/scripts/build_mingw_engine.sh b/scripts/build_mingw_engine.sh index 925f4036..9f5ff5b3 100755 --- a/scripts/build_mingw_engine.sh +++ b/scripts/build_mingw_engine.sh @@ -6,16 +6,15 @@ cd $TRAVIS_BUILD_DIR export CC="ccache i686-w64-mingw32-gcc" export CXX="ccache i686-w64-mingw32-g++" -export CFLAGS="-static-libgcc -no-pthread -msse2" # add sse2 to workaround mingw multiple definition of MemoryBarrier bug +export CFLAGS="-static-libgcc -no-pthread -msse2 -msse -mmmx -march=pentium4m -mtune=pentium4m -Ofast -ffast-math -funsafe-math-optimizations -funsafe-loop-optimizations -g -gdwarf-2 -fomit-frame-pointer" # add sse2 to workaround mingw multiple definition of MemoryBarrier bug export CXXFLAGS="-static-libgcc -static-libstdc++ -no-pthread -msse2" export LDFLAGS="-static-libgcc -static-libstdc++ -no-pthread -Wl,--allow-multiple-definition" # workaround some other mingw bugs export WINRC="i686-w64-mingw32-windres" rm -rf build # clean build directory -./waf configure --sdl2=$TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32/ --disable-vgui --build-type=debug --verbose || die # can't compile VGUI support on MinGW, due to differnet C++ ABI -./waf build --verbose || die +./waf configure -s "SDL2_mingw/i686-w64-mingw32/" --build-type=none --prefix="." --win-style-install -v || die # can't compile VGUI support on MinGW, due to differnet C++ ABI +./waf build -v || die cp $TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32//bin/SDL2.dll . # Install SDL2 cp vgui_support_bin/vgui_support.dll . -cp build/engine/xash.dll . -cp build/mainui/menu.dll . -cp build/game_launch/xash3d.exe . +./waf install || die + 7z a -t7z $TRAVIS_BUILD_DIR/xash3d-mingw.7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on *.dll *.exe diff --git a/scripts/build_osx_engine.sh b/scripts/build_osx_engine.sh index f05df114..c3d6a0da 100755 --- a/scripts/build_osx_engine.sh +++ b/scripts/build_osx_engine.sh @@ -5,9 +5,8 @@ # Build engine cd $TRAVIS_BUILD_DIR -python waf configure --sdl2=$HOME/Library/Frameworks/SDL2.framework/ --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug || die +python waf configure -s "$HOME/Library/Frameworks/SDL2.framework/" -T debug --prefix="pkg/" --win-style-install || die python waf build || die -mkdir -p pkg/ -cp build/engine/libxash.dylib build/game_launch/xash3d build/mainui/libmenu.dylib build/vgui_support/libvgui_support.dylib vgui-dev/lib/vgui.dylib pkg/ +python waf install || die cp ~/Library/Frameworks/SDL2.framework/SDL2 pkg/libSDL2.dylib tar -cjf $TRAVIS_BUILD_DIR/xash3d-osx.tar.bz2 pkg/*