Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 21 additions & 66 deletions com.jagexlauncher.JagexLauncher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,15 @@ runtime-version: *runtime-version
sdk: org.freedesktop.Sdk
command: jagex-run
finish-args:
# pressure vessel
- --device=all
- --env=PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin:/usr/lib/extensions/vulkan/gamescope/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin:/app/bin/heroic/resources/app.asar.unpacked/build/bin/linux
- --env=LD_LIBRARY_PATH=/usr/lib/extensions/vulkan/gamescope/lib
- --persist=Games
- --persist=.local
- --filesystem=xdg-run/gamescope-0:rw
# See: https://github.com/flathub/com.valvesoftware.Steam/commit/0538256facdb0837c33232bc65a9195a8a5bc750
- --env=XDG_DATA_DIRS=/app/share:/usr/lib/extensions/vulkan/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/share:/usr/lib/pressure-vessel/overrides/share
- --allow=per-app-dev-shm
# umu
- --device=dri
- --share=ipc
- --socket=x11
- --socket=wayland
- --socket=pulseaudio
- --share=network
- --allow=devel
- --allow=multiarch
- --env=JAVA_HOME=/app/jre
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.Flatpak
- --filesystem=xdg-data/icons:create
- --filesystem=xdg-run/app/com.discordapp.Discord
- --filesystem=xdg-run/discord-ipc-0
Expand All @@ -41,11 +30,6 @@ add-extensions:
directory: lib/i386-linux-gnu
version: *runtime-version

org.freedesktop.Platform.Compat.i386.Debug:
directory: lib/debug/lib/i386-linux-gnu
version: *runtime-version
no-autodownload: true

org.freedesktop.Platform.GL32:
directory: lib/i386-linux-gnu/GL
version: *gl-version
Expand All @@ -69,46 +53,7 @@ add-extensions:
enable-if: active-gl-driver
autoprune-unless: active-gl-driver

org.freedesktop.Platform.VAAPI.Intel.i386:
directory: lib/i386-linux-gnu/dri/intel-vaapi-driver
version: *runtime-version
versions: *runtime-version
autodelete: false
no-autodownload: true
add-ld-path: lib
download-if: have-intel-gpu
autoprune-unless: have-intel-gpu

modules:
- name: platform-bootstrap
buildsystem: simple
build-commands:
- |
set -e
mkdir -p /app/bin
mkdir -p /app/lib/i386-linux-gnu
mkdir -p /app/lib/i386-linux-gnu/GL
mkdir -p /app/lib/i386-linux-gnu/dri/intel-vaapi-driver
mkdir -p /app/lib/debug/lib/i386-linux-gnu
mkdir -p /app/lib/debug/lib/i386-linux-gnu/GL
install -Dm644 -t /app/etc ld.so.conf
mkdir -p /app/lib{,32}/ffmpeg
mkdir -p /app/share/steam/compatibilitytools.d
mkdir -p /app/utils /app/share/vulkan
ln -srv /app/{utils/,}share/vulkan/explicit_layer.d
ln -srv /app/{utils/,}share/vulkan/implicit_layer.d
mkdir -p /app/links/lib
ln -srv /app/lib /app/links/lib/x86_64-linux-gnu
ln -srv /app/lib32 /app/links/lib/i386-linux-gnu
sources:
- type: inline
dest-filename: ld.so.conf
contents: |
# We just make any GL32 extension have higher priority
include /run/flatpak/ld.so.conf.d/app-*-org.freedesktop.Platform.GL32.*.conf
/app/lib32
/app/lib/i386-linux-gnu
/lib64
- name: libnotify
buildsystem: meson
config-opts:
Expand Down Expand Up @@ -141,7 +86,7 @@ modules:
commands:
-
#!/bin/bash
- /run/parent/app/jre/bin/java.bk $(echo "$@" | sed 's|--add-opens java.desktop/java.awt=ALL-UNNAMED||g')
- /app/jre/bin/java.bk $(echo "$@" | sed 's|--add-opens java.desktop/java.awt=ALL-UNNAMED||g')
- name: proton-ge
buildsystem: simple
build-commands:
Expand All @@ -155,15 +100,25 @@ modules:
dest-filename: protonge.tar.xz
url: https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton10-27/GE-Proton10-27.tar.gz
sha512: 7bc683b62a9cdf027089af501c93cf78c7aaef30c70010c54389d199894a679870becfda417ad1761c4d8faa17ac3d2da805d4c4efce8992197eaff74fcb5fea
- name: umu-run
- name: wine-staging
buildsystem: simple
build-commands:
- |
install umu-run /app/bin/umu-run
- mkdir -p wine-staging
- tar xf wine-staging.tar.xz -C wine-staging --strip-components=1
- cp -r wine-staging/bin/* /app/bin/
- cp -r wine-staging/lib/* /app/lib/
- cp -r wine-staging/share/* /app/share/
sources:
- type: archive
url: https://github.com/Open-Wine-Components/umu-launcher/releases/download/1.3.0/umu-launcher-1.3.0-zipapp.tar
sha256: 36502de766f3cc549ff85196a04fb5afdb4eb2a72c023f22fd25895df91fda2f
- type: file
url: https://github.com/Kron4ek/Wine-Builds/releases/download/10.18/wine-10.18-staging-amd64.tar.xz
dest-filename: wine-staging.tar.xz
sha256: 466d24aa919892186fa40c374452dad549092a023fd9ab2efe0c7bfea4b23713
x-checker-data:
type: json
url: https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest
version-query: .tag_name
url-query: .assets[] | select(.name=="wine-" + $version + "-staging-amd64.tar.xz")
| .browser_download_url
- name: runelite-jar
buildsystem: simple
build-commands:
Expand All @@ -187,7 +142,7 @@ modules:
-
#!/bin/bash
- set -x
- /run/parent/app/jre/bin/java.bk -Duser.home="$XDG_DATA_HOME/user_home" -jar /run/parent/app/RuneLite.jar
- /app/jre/bin/java.bk -Duser.home="$XDG_DATA_HOME/user_home" -jar /app/RuneLite.jar
-J-Duser.home="$XDG_DATA_HOME/user_home"
- name: hdos-jar
buildsystem: simple
Expand All @@ -209,7 +164,7 @@ modules:
commands:
-
#!/bin/bash
- /run/parent/app/jre/bin/java -jar /run/parent/app/hdos-launcher.jar
- /app/jre/bin/java -jar /app/hdos-launcher.jar
- name: jagex-launcher
buildsystem: simple
build-commands:
Expand Down
49 changes: 5 additions & 44 deletions scripts/jagex-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
set -euo pipefail

winebin="/app/opt/wine/bin"
wineprefix="$XDG_DATA_HOME"/umu_prefix
wineprefix="$XDG_DATA_HOME"/staging_prefix
JAGEX_LAUNCHER_EXE_PATH="$wineprefix/drive_c/Program Files (x86)/Jagex Launcher/JagexLauncher.exe"
JAGEX_LAUNCHER_GAMES_PATH="$(dirname "$JAGEX_LAUNCHER_EXE_PATH")/Games"
# The umu_proton_dir and protonpath need to be different because umu_proton_dir is from the flatpak sandbox perspective, while protonpath is from the steam runtime perspective.
export UMU_PROTON_DIR="$HOME/.var/app/com.jagexlauncher.JagexLauncher/.local/share/umu/proton-bundled/proton"
export PROTONPATH="$HOME/.local/share/umu/proton-bundled"
export WINEPREFIX="$wineprefix"

function ensure_latest_file () {
Expand Down Expand Up @@ -35,42 +31,10 @@ function ensure_latest_file () {
fi
}

function ensure_latest_dir () {
SOURCE_FILE_PATH="$1"
DEST_FILE_PATH="$2"

echo "ensuring $SOURCE_FILE_PATH matches $DEST_FILE_PATH"
if [[ -f "$DEST_FILE_PATH" ]]; then
SOURCE_SHA256="$(sha256sum "$SOURCE_FILE_PATH" | awk '{ print $1 }')"
DEST_SHA256="$(sha256sum "$DEST_FILE_PATH" | awk '{ print $1 }')"

if [[ "$SOURCE_SHA256" != "$DEST_SHA256" ]]; then
echo "$SOURCE_SHA256 does not match $DEST_SHA256. Updating $DEST_FILE_PATH..."

mkdir -p "$(dirname "$DEST_FILE_PATH")"
rm -r "$(dirname "$DEST_FILE_PATH")"
cp -r "$(dirname "$SOURCE_FILE_PATH")" "$(dirname "$DEST_FILE_PATH")"
else
echo "$SOURCE_SHA256 DOES match $DEST_SHA256. No update needed."
fi

else
echo "$DEST_FILE_PATH does not exist. Copying..."
mkdir -p "$(dirname "$DEST_FILE_PATH")"
rm -r "$(dirname "$DEST_FILE_PATH")"
cp -r "$(dirname "$SOURCE_FILE_PATH")" "$(dirname "$DEST_FILE_PATH")"
fi
}

ensure_latest_dir "/app/opt/proton/proton" "$UMU_PROTON_DIR"

# If we are still using wine-ge, migrate to umu proton
if [[ -z "$XDG_DATA_HOME/prefix" ]]; then
if [[ -d "$XDG_DATA_HOME/prefix" ]]; then

echo "We are still on wine-ge. Migrating to proton..."
umu-run wineboot -u
mkdir -p "$WINEPREFIX/umu_prefix/drive_c/Program Files (x86)/Jagex Launcher"
cp -r "$XDG_DATA_HOME/prefix/drive_c/Program Files (x86)/Jagex Launcher" "$WINEPREFIX/drive_c/Program Files (x86)/Jagex Launcher" || exit 1
mv "$XDG_DATA_HOME/prefix" "$XDG_DATA_HOME/prefix.bk"

fi
Expand All @@ -87,13 +51,10 @@ if ! [ -f "$JAGEX_LAUNCHER_EXE_PATH" ]; then
cp /app/steamdeck-settings.properties "$XDG_DATA_HOME/steamdeck-settings.properties"
fi

ensure_latest_file "/app/RuneLite.exe" "$JAGEX_LAUNCHER_GAMES_PATH/RuneLite.exe"
ensure_latest_file "/app/HDOS.exe" "$JAGEX_LAUNCHER_GAMES_PATH/HDOS.exe"

# Make sure the registry has the installation location for runelite.
WINEDEBUG="-all" umu-run reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\RuneLite Launcher_is1" /v "InstallLocation" /t REG_SZ /d "C:\Program Files (x86)\Jagex Launcher\Games" /f
WINEDEBUG="-all" wine reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\RuneLite Launcher_is1" /v "InstallLocation" /t REG_SZ /d "Z:\app" /f

# Make sure the registry has the installation location for hdos
WINEDEBUG="-all" umu-run reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\HDOS Launcher_is1" /v "InstallLocation" /t REG_SZ /d "C:\Program Files (x86)\Jagex Launcher\Games" /f
WINEDEBUG="-all" wine reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\HDOS Launcher_is1" /v "InstallLocation" /t REG_SZ /d "Z:\app" /f

umu-run "$JAGEX_LAUNCHER_EXE_PATH"
wine "$JAGEX_LAUNCHER_EXE_PATH"
Loading