Wargus / stratagus

The Stratagus strategy game engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppImage for Stratagus and Stargus on Linux!

ShadowWarfare opened this issue · comments

It would be useful if an .AppImage were to be created for Stratagus and Stargus for the Linux version. Could this be considered?

I considered it, but don't have time to work on it, since I have no experience with AppImage

AppImage creation should now work, but someone needs to spend the time to create a github action for that. This is the script I used, inside a docker image centos:centos-7

yum install -yy centos-release-scl && yum install -yy git devtoolset-7-toolchain
yum install -yy zlib-devel file
scl enable devtoolset-7 bash
yum install -yy libX11-devel libXext-devel libXrandr-devel libXi-devel libXfixes-devel libXcursor-devel
yum install -yy pulseaudio-libs-devel
yum install -yy mesa-libGL-devel
yum install -yy wayland-devel

# cmake
curl -L -O https://cmake.org/files/v3.20/cmake-3.20.0.tar.gz
tar zxf cmake-3.*
pushd cmake-3.*
    sed -i 's/cmake_options="-DCMAKE_BOOTSTRAP=1"/cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=OFF"/' bootstrap
    ./bootstrap --prefix=/usr/local
    make -j
    make install
    popd

# build the game
export GAME_ID=wargus
export GAME_NAME=Wargus
export GAME_VERSION=3.3.0
export GAME_ARCH=$(uname -m)

git clone --depth 1 https://github.com/Wargus/stratagus
git clone --depth 1 https://github.com/Wargus/${GAME_ID}

pushd strategus
    git submodule update --init --recursive
    mkdir build
    pushd build
        cmake ..                                                        \
            -DBUILD_VENDORED_LUA=ON                                     \
            -DBUILD_VENDORED_SDL=ON                                     \
            -DBUILD_VENDORED_MEDIA_LIBS=ON                              \
            -DCMAKE_BUILD_TYPE=Release                                  \
            -DCMAKE_INSTALL_PREFIX=/usr                                 \
            -DGAMEDIR=/usr/bin
        make -j install DESTDIR=../../AppDir
        popd
    popd
pushd ${GAME_ID}
    git submodule update --init --recursive
    mkdir build
    pushd build
        cmake ..                                                        \
            -DENABLE_VENDORED_LIBS=ON                                   \
            -DCMAKE_BUILD_TYPE=Release                                  \
            -DSTRATAGUS_INCLUDE_DIR=$PWD/../../stratagus/gameheaders    \
            -DSTRATAGUS=stratagus                                       \
            -DCMAKE_INSTALL_PREFIX=/usr                                 \
            -DDATA_PATH=../../share/games/stratagus/${GAME_ID}/         \
            -DGAMEDIR=/usr/bin                                          \
            -DICONDIR=/usr/share/icons/default/64x64/                   \
            -DGAMEDIRABS=""
        make -j install DESTDIR=../../AppDir
        popd
    popd

# using linuxdeploy
echo '#!/bin/sh' > AppDir/AppRun
echo -n 'exec $APPDIR/usr/bin/' >> AppDir/AppRun
echo -n "${GAME_ID}" >> AppDir/AppRun
echo -n ' --argv0=$APPDIR/usr/bin/' >> AppDir/AppRun
echo -n "${GAME_ID}" >> AppDir/AppRun
echo ' $@' >> AppDir/AppRun
chmod +x AppDir/AppRun
cat AppDir/AppRun
curl -L -O "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir AppDir --output appimage

I have a PR open to build appimages from master. I need to get some people to try them to see if they work, then I can merge that: https://github.com/Wargus/stratagus/releases/tag/continuous

Hello, I just tried Wargus-3.3.3-x86_64.AppImage

  • first time I launched it it fails because xterm was not installed. Xterm is not installed by default on Manjaro.
    So I installed it.
  • If I launch the command manually from a terminal:
$ xterm -e bash -c    /tmp/.mount_Wargusf1faZ8/usr/bin/wartool  -v -r  /home/romain/Games/gog/warcraft-ii-tides-of-darkness/drive_c/GOG Games/Warcraft II BNE   /home/romain/.local/share/stratagus/data.Wargus ; echo  Press RETURN to continue... ; read 
xterm: cannot load font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1"
Press RETURN to continue...

Wargus-3.3.3-x86_64.AppImage finally works and launch if I execute it from a terminal (not xterm) and use GOG setup file.
It will be better if Wargus extract GOG setup file in a folder and not in current folder.

Another thing: in terminal I can read:
Can't open file 'videos/gameintro.ogv' SetShader: none

Last thing: do you plan to make appimage for War1gus and Stargus too?

@legluondunet thanks for testing! I have added war1gus to the build and hopefully fixed xterm and innoextract issues.

Appimages for master builds are merged, but need more testing. If there's ever another release, I guess someone should do that

we'll see and test at next release, thanks.