Browse Source

scripts: use waf install to generate packages

pull/2/head
Alibek Omarov 6 years ago
parent
commit
041315da44
  1. 8
      scripts/build_appimage.sh
  2. 2
      scripts/build_linux_engine.sh
  3. 11
      scripts/build_mingw_engine.sh
  4. 5
      scripts/build_osx_engine.sh

8
scripts/build_appimage.sh

@ -9,12 +9,10 @@ mkdir -p $APPDIR
python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak python3 scripts/makepak.py xash-extras/ $APPDIR/extras.pak
# Copy all needed files # Copy all needed files
./waf install
mv appimage $APPDIR
cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/ cp SDL2_linux/lib/libSDL2-2.0.so.0 $APPDIR/
cp vgui-dev/lib/vgui.so $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' cat > $APPDIR/AppRun << 'EOF'
#!/bin/sh #!/bin/sh
@ -22,7 +20,7 @@ cat > $APPDIR/AppRun << 'EOF'
echo "Xash3D FWGS installed as AppImage." echo "Xash3D FWGS installed as AppImage."
ENGINEROOT=$(dirname -- "$(readlink -f -- "$0")") ENGINEROOT=$(dirname -- "$(readlink -f -- "$0")")
if [ -z "$XASH3D_BASEDIR" ]; then if [ "$XASH3D_BASEDIR" == "" ]; then
export XASH3D_BASEDIR=$PWD export XASH3D_BASEDIR=$PWD
fi fi
export XASH3D_EXTRAS_PAK1="${ENGINEROOT}"/extras.pak export XASH3D_EXTRAS_PAK1="${ENGINEROOT}"/extras.pak

2
scripts/build_linux_engine.sh

@ -31,7 +31,7 @@ make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux
cd $TRAVIS_BUILD_DIR cd $TRAVIS_BUILD_DIR
export CC="ccache gcc" export CC="ccache gcc"
export CXX="ccache g++" 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 ./waf build || die
# Build AppImage # Build AppImage

11
scripts/build_mingw_engine.sh

@ -6,16 +6,15 @@
cd $TRAVIS_BUILD_DIR cd $TRAVIS_BUILD_DIR
export CC="ccache i686-w64-mingw32-gcc" export CC="ccache i686-w64-mingw32-gcc"
export CXX="ccache i686-w64-mingw32-g++" 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 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 LDFLAGS="-static-libgcc -static-libstdc++ -no-pthread -Wl,--allow-multiple-definition" # workaround some other mingw bugs
export WINRC="i686-w64-mingw32-windres" export WINRC="i686-w64-mingw32-windres"
rm -rf build # clean build directory 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 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 --verbose || die ./waf build -v || die
cp $TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32//bin/SDL2.dll . # Install SDL2 cp $TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32//bin/SDL2.dll . # Install SDL2
cp vgui_support_bin/vgui_support.dll . cp vgui_support_bin/vgui_support.dll .
cp build/engine/xash.dll . ./waf install || die
cp build/mainui/menu.dll .
cp build/game_launch/xash3d.exe .
7z a -t7z $TRAVIS_BUILD_DIR/xash3d-mingw.7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on *.dll *.exe 7z a -t7z $TRAVIS_BUILD_DIR/xash3d-mingw.7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on *.dll *.exe

5
scripts/build_osx_engine.sh

@ -5,9 +5,8 @@
# Build engine # Build engine
cd $TRAVIS_BUILD_DIR 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 python waf build || die
mkdir -p pkg/ python waf install || die
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/
cp ~/Library/Frameworks/SDL2.framework/SDL2 pkg/libSDL2.dylib cp ~/Library/Frameworks/SDL2.framework/SDL2 pkg/libSDL2.dylib
tar -cjf $TRAVIS_BUILD_DIR/xash3d-osx.tar.bz2 pkg/* tar -cjf $TRAVIS_BUILD_DIR/xash3d-osx.tar.bz2 pkg/*

Loading…
Cancel
Save