Skip to content

Commit

Permalink
Flatpak: fix extention points, Java auto-detect and openjdk21
Browse files Browse the repository at this point in the history
ported over from fn2006/PollyMC#131
  • Loading branch information
zocker-160 committed May 17, 2024
1 parent 59c0625 commit 72a2ea8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
11 changes: 0 additions & 11 deletions flatpak/fjordlauncher

This file was deleted.

8 changes: 8 additions & 0 deletions flatpak/fjordrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /usr/bin/env bash

# discord RPC
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

exec /app/bin/fjordlauncher "$@"
55 changes: 32 additions & 23 deletions flatpak/org.unmojang.FjordLauncher.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
id: org.unmojang.FjordLauncher
runtime: org.kde.Platform
runtime-version: 5.15-23.08
runtime-version: "5.15-23.08"
sdk: org.kde.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17
- org.freedesktop.Sdk.Extension.openjdk8
- org.freedesktop.Sdk.Extension.openjdk17
- org.freedesktop.Sdk.Extension.openjdk21
add-extensions:
com.valvesoftware.Steam.Utility.gamescope:
version: stable
add-ld-path: lib
org.freedesktop.Platform.VulkanLayer.gamescope:
version: "23.08"
no-autodownload: true
autodelete: false
add-ld-path: lib
directory: utils/gamescope

command: fjordlauncher
org.freedesktop.Platform.VulkanLayer.MangoHud:
version: "23.08"
no-autodownload: true
autodelete: false
add-ld-path: lib
directory: utils/mangohud

command: fjordrun
finish-args:
- --share=ipc
- --socket=x11
- --socket=wayland
- --socket=fallback-x11
- --device=all
- --share=network
- --socket=pulseaudio
# for Discord RPC mods
- --filesystem=xdg-run/app/com.discordapp.Discord:create
# Mod drag&drop
- --filesystem=xdg-download:ro
- --env=PATH=/app/bin:/usr/bin:/app/utils/gamescope/bin:/app/utils/mangohud/bin
- --env=VK_LAYER_PATH=/usr/lib/extensions/vulkan/share/vulkan/implicit_layer.d

cleanup:
- /lib/libGLU*
Expand Down Expand Up @@ -55,12 +65,13 @@ modules:
buildsystem: simple
build-commands:
- mkdir -p /app/jdk/
- /usr/lib/sdk/openjdk21/install.sh
- mv /app/jre /app/jdk/21
- /usr/lib/sdk/openjdk17/install.sh
- mv /app/jre /app/jdk/17
- /usr/lib/sdk/openjdk8/install.sh
- mv /app/jre /app/jdk/8
cleanup:
- /jre
- rm -rf /app/jdk/8/bin

- name: glfw
buildsystem: cmake-ninja
Expand Down Expand Up @@ -108,16 +119,10 @@ modules:
# post-install is running inside the build dir, we need it from the source though
- install -Dm755 ../data/gamemoderun -t /app/bin
sources:
- type: archive
dest-filename: gamemode.tar.gz
url: https://api.github.com/repos/FeralInteractive/gamemode/tarball/1.8.1
sha256: 969cf85b5ca3944f3e315cd73a0ee9bea4f9c968cd7d485e9f4745bc1e679c4e
x-checker-data:
type: json
url: https://api.github.com/repos/FeralInteractive/gamemode/releases/latest
version-query: .tag_name
url-query: .tarball_url
timestamp-query: .published_at
- type: git
url: https://github.com/FeralInteractive/gamemode.git
tag: 1.8.1
commit: 5180d89e66830d87f69687b95fb86f622552b94b
cleanup:
- /include
- /lib/pkgconfig
Expand Down Expand Up @@ -153,11 +158,15 @@ modules:
- name: enhance
buildsystem: simple
build-commands:
- install -Dm755 prime-run /app/bin/prime-run
- mv /app/bin/fjordlauncher /app/bin/fjordrun
- install -Dm755 fjordlauncher /app/bin/fjordlauncher
- install -Dm755 prime-run -t /app/bin
- install -Dm755 fjordrun -t /app/bin
sources:
- type: file
path: prime-run
- type: file
path: fjordlauncher
path: fjordrun

- name: extensions
buildsystem: simple
build-commands:
- mkdir -p ${FLATPAK_DEST}/utils/{gamescope,mangohud}

0 comments on commit 72a2ea8

Please sign in to comment.