Skip to content

Commit

Permalink
Merge pull request #51 from Lonsfor/gamescope
Browse files Browse the repository at this point in the history
Gamescope
  • Loading branch information
ghisvail authored Apr 2, 2023
2 parents b4fa757 + 21c45ce commit 98f102c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
8 changes: 4 additions & 4 deletions org.srb2.SRB2Kart.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ Version=1.0
Type=Application
Name=Sonic Robo Blast 2 Kart
Comment=A kart racing mod based on the 3D Sonic the Hedgehog fangame Sonic Robo Blast 2
TryExec=srb2kart
Exec=srb2kart
TryExec=srb2kart.sh
Exec=srb2kart.sh
Icon=org.srb2.SRB2Kart
Terminal=false
Categories=Game;
Actions=OpenGL;Software;

[Desktop Action OpenGL]
Name=OpenGL
Exec=srb2kart -opengl
Exec=srb2kart.sh -opengl

[Desktop Action Software]
Name=Software
Exec=srb2kart -software
Exec=srb2kart.sh -software
34 changes: 20 additions & 14 deletions org.srb2.SRB2Kart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
app-id: org.srb2.SRB2Kart
runtime: org.freedesktop.Platform
runtime-version: '21.08'
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: srb2kart
command: srb2kart.sh
finish-args:
- --share=ipc
- --share=network
Expand All @@ -13,6 +13,18 @@ finish-args:
- --persist=.srb2kart
- --filesystem=xdg-run/app/com.discordapp.Discord:create
- --filesystem=xdg-run/discord-ipc-0

add-extensions:
com.valvesoftware.Steam.Utility.gamescope:
version: stable
add-ld-path: lib
no-autodownload: true
autodelete: true
directory: utils/gamescope

cleanup-commands:
- mkdir -p /app/utils/gamescope

modules:
- shared-modules/glu/glu-9.json

Expand Down Expand Up @@ -56,8 +68,8 @@ modules:
- /lib/pkgconfig
sources:
- type: archive
url: https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-2.0.4.tar.gz
sha256: 5605b6f230717acf6d09549671f7fe03f006700c61a61b86042888f81792e2b3
url: https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-2.6.3.tar.gz
sha256: 91dd065e9e63f499e5317350b110184b0ba96bc5f63c39b3a9939a136c40c035

- name: rapidjson
buildsystem: cmake-ninja
Expand Down Expand Up @@ -108,9 +120,9 @@ modules:
ARCH_MAKE_ARGS: LINUX64=1 X86_64=1
build-commands:
- make -C src -j $FLATPAK_BUILDER_N_JOBS NOUPX=1 SDL=1 HAVE_DISCORDRPC=1 $ARCH_MAKE_ARGS
- install -D -m 755 -t $FLATPAK_DEST/bin bin/Linux*/Release/lsdl2srb2kart
- install -D -m 755 bin/Linux*/Release/lsdl2srb2kart $FLATPAK_DEST/bin/srb2kart
- install -D -m 644 srb2.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png
- install -D -m 755 srb2kart.sh $FLATPAK_DEST/bin/srb2kart
- install -D -m 755 srb2kart.sh $FLATPAK_DEST/bin/srb2kart.sh
- install -D -m 644 -t $FLATPAK_DEST/share/applications $FLATPAK_ID.desktop
- install -D -m 644 -t $FLATPAK_DEST/share/metainfo $FLATPAK_ID.metainfo.xml
sources:
Expand All @@ -122,14 +134,8 @@ modules:
project-id: 18640
stable-only: true
url-template: https://github.com/STJr/Kart-Public/archive/refs/tags/v$version.tar.gz
- type: script
commands:
- for i in {0..9}; do
- test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;
- done
- export SRB2WADDIR=/app/extra
- lsdl2srb2kart "$@"
dest-filename: srb2kart.sh
- type: file
path: srb2kart.sh
- type: file
path: org.srb2.SRB2Kart.desktop
- type: file
Expand Down
18 changes: 18 additions & 0 deletions srb2kart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

for i in {0..9}; do
test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;
done

export PATH="/app/utils/gamescope/bin:$PATH"
export SRB2WADDIR=/app/extra

if [ -z "$GAMESCOPE_ARGS" ]; then
GAMESCOPE_ARGS="-h 1080 -C 1000 -i"
fi

if [[ -n $(command -v gamescope) && -n "$GAMESCOPE_ENABLE" ]]; then
echo "$GAMESCOPE_ARGS" -- srb2kart "$@" | xargs gamescope
else
srb2kart "$@"
fi

0 comments on commit 98f102c

Please sign in to comment.