diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 31384ebd..3b30e109 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -51,18 +51,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - - name: Checkout xash-extras - uses: actions/checkout@v3 - with: - repository: FWGS/xash-extras - path: xash-extras - - name: Install dependencies run: bash scripts/gha/deps_${{ matrix.targetos }}.sh - - name: Build engine run: bash scripts/gha/build_${{ matrix.targetos }}.sh - - name: Upload engine (prereleases) run: bash scripts/continious_upload.sh artifacts/* - name: Upload engine (artifacts) @@ -70,3 +62,28 @@ jobs: with: name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }} path: artifacts/* + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + strategy: + matrix: + include: + - app: su.xash.Engine.Compat.i386 + container: + image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 + options: --privileged + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UPLOADTOOL_ISPRERELEASE: true + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Build flatpak (Compat.i386) + uses: FWGS/flatpak-github-actions/flatpak-builder@v5 + with: + bundle: ${{ matrix.app }}.flatpak + manifest-path: scripts/flatpak/${{ matrix.app }}.yml + - name: Upload engine (prereleases) + run: bash scripts/continious_upload.sh ${{ matrix.app }}.flatpak diff --git a/filesystem/wad.c b/filesystem/wad.c index adff3ad1..16153429 100644 --- a/filesystem/wad.c +++ b/filesystem/wad.c @@ -301,7 +301,7 @@ static wfile_t *W_Open( const char *filename, int *error ) if( wad->handle == NULL ) { - Con_Reportf( S_ERROR "W_Open: couldn't open %s\n", filename ); + Con_Reportf( S_ERROR "W_Open: couldn't open %s: %s\n", filename, strerror( errno )); if( error ) *error = WAD_LOAD_COULDNT_OPEN; FS_CloseWAD( wad ); return NULL; diff --git a/scripts/flatpak/run.sh b/scripts/flatpak/run.sh old mode 100644 new mode 100755 index 725161c5..7183cf94 --- a/scripts/flatpak/run.sh +++ b/scripts/flatpak/run.sh @@ -2,19 +2,23 @@ echo "Xash3D FWGS installed as Flatpak." -# TODO: detect by libraryfolders.vdf and installed apps -HALFLIFESTEAMDIR="$HOME/.steam/steam/steamapps/common/Half-Life" +export XASH3D_BASEDIR="$HOME/.xash/" +mkdir -p $XASH3D_BASEDIR +cd $XASH3D_BASEDIR +echo "Base directory is $XASH3D_BASEDIR" -if [ -d "$HALFLIFESTEAMDIR" ]; then - echo "Detected Half-Life installation in $HALFLIFESTEAMDIR, using as RoDir" - export XASH3D_RODIR=$HALFLIFESTEAMDIR -fi +# TODO: detect by libraryfolders.vdf and installed apps +HALFLIFESTEAMDIRS="../.local/share/Steam/steamapps/common/Half-Life ../.steam/steam/steamapps/common/Half-Life" -XASHDATADIR="$HOME/.xash/" +for i in $HALFLIFESTEAMDIRS; do +# echo $i + if [ -d "$i" ]; then + echo "Detected Half-Life installation in $i, using as RoDir" + export XASH3D_RODIR=$i + break + fi +done -mkdir -p $XASHDATADIR -export XASH3D_BASEDIR="$XASHDATADIR" -echo "Base directory is $XASH3D_BASEDIR" export XASH3D_EXTRAS_PAK1=/app/share/xash3d/valve/extras.pk3 -exec /app/lib32/xash3d/xash3d "$@" +exec $DEBUGGER /app/lib32/xash3d/xash3d "$@" diff --git a/scripts/flatpak/su.xash.Engine.Compat.i386.desktop b/scripts/flatpak/su.xash.Engine.Compat.i386.desktop new file mode 100644 index 00000000..cec00eca --- /dev/null +++ b/scripts/flatpak/su.xash.Engine.Compat.i386.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Categories=Game;Shooter; +Comment=Half-Life compatible game engine +Exec= +Icon=su.xash.Engine.Compat.i386 +Keywords=first;person;shooter;multiplayer;half-life;halflife;singleplayer; +Name=Xash3D FWGS +PrefersNonDefaultGPU=true +Terminal=false +Type=Application diff --git a/scripts/flatpak/su.xash.Engine.Compat.i386.yml b/scripts/flatpak/su.xash.Engine.Compat.i386.yml index a2ac1c75..02a02ad7 100644 --- a/scripts/flatpak/su.xash.Engine.Compat.i386.yml +++ b/scripts/flatpak/su.xash.Engine.Compat.i386.yml @@ -17,6 +17,7 @@ finish-args: - --socket=pulseaudio - --share=network - --filesystem=~/.steam:ro + - --filesystem=~/.local/share/Steam:ro - --filesystem=~/.xash:rw - --filesystem=xdg-run/app/com.discordapp.Discord:create - --device=all @@ -76,7 +77,12 @@ modules: python waf build python waf install --destdir=/ mkdir -p /app/bin + mkdir -p /app/share/icons/hicolor/256x256/apps/ + mkdir -p /app/share/applications + install -m 0755 3rdparty/vgui_support/vgui-dev/lib/vgui.so /app/lib32/xash3d/vgui.so install -m 0755 scripts/flatpak/run.sh /app/bin/run.sh + install -m 0644 game_launch/icon-xash-material.png /app/share/icons/hicolor/256x256/apps/su.xash.Engine.Compat.i386.png + install -m 0644 scripts/flatpak/su.xash.Engine.Compat.i386.desktop /app/share/applications/su.xash.Engine.Compat.i386.desktop sources: - type: dir path: ../../