From 9d439f091a71df4899458355a44a5b84146a9ff5 Mon Sep 17 00:00:00 2001 From: Carles Pastor Date: Wed, 11 Sep 2024 19:22:36 +0200 Subject: [PATCH 1/3] Add manifest for building as a flatpak includes the following: - org.DolphinEmu.dolphin-emu.metainfo.xml.in this file contains general information and metadata that is used by most linux based app stores (kde discover, gnome software, flathub.org, etc) to showcase dolphin. - fill_release_node.sh a script to automatically fill in the release information in the metainfo file when building the flatpak. - SDL2.json manifest to build the vendored version of SDL from the Exports directory, it's only temporarily needed until the kde runtime is updated with the current SDL2 version and should be deleted after. - org.DolphinEmu.dolphin-emu.yml the manifest itself. --- Flatpak/SDL2/SDL2.json | 22 +++++ Flatpak/fill_release_node.sh | 8 ++ ...org.DolphinEmu.dolphin-emu.metainfo.xml.in | 49 +++++++++++ Flatpak/org.DolphinEmu.dolphin-emu.yml | 83 +++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 Flatpak/SDL2/SDL2.json create mode 100755 Flatpak/fill_release_node.sh create mode 100644 Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in create mode 100644 Flatpak/org.DolphinEmu.dolphin-emu.yml diff --git a/Flatpak/SDL2/SDL2.json b/Flatpak/SDL2/SDL2.json new file mode 100644 index 0000000000..1a8be19260 --- /dev/null +++ b/Flatpak/SDL2/SDL2.json @@ -0,0 +1,22 @@ +{ + "name": "SDL2", + "buildsystem": "autotools", + "config-opts": ["--disable-static"], + "sources": [ + { + "type": "dir", + "path": "../../Externals/SDL/SDL" + } + ], + "cleanup": [ "/bin/sdl2-config", + "/include", + "/lib/libSDL2.la", + "/lib/libSDL2main.a", + "/lib/libSDL2main.la", + "/lib/libSDL2_test.a", + "/lib/libSDL2_test.la", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig"] +} + diff --git a/Flatpak/fill_release_node.sh b/Flatpak/fill_release_node.sh new file mode 100755 index 0000000000..f211769a7c --- /dev/null +++ b/Flatpak/fill_release_node.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +DATE=$(git log -1 --pretty=%cd --date=iso8601 --date=format:'%Y-%m-%d') +sed -i -e "s/@DATE_PLACEHOLDER/${DATE}/" org.DolphinEmu.dolphin-emu.metainfo.xml +VERSION=$(git describe --tags) +sed -i -e "s/@VERSION_PLACEHOLDER/${VERSION}/" org.DolphinEmu.dolphin-emu.metainfo.xml + + diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in new file mode 100644 index 0000000000..e4e8c891a3 --- /dev/null +++ b/Flatpak/org.DolphinEmu.dolphin-emu.metainfo.xml.in @@ -0,0 +1,49 @@ + + + + org.DolphinEmu.dolphin-emu + Dolphin Emulator + + Dolphin Emulator Project + + GameCube / Wii + CC-BY-SA-3.0 + GPL-2.0+ + + +

Dolphin is an emulator for two recent Nintendo video game consoles: the GameCube and the Wii. It allows PC gamers to enjoy games for these two consoles in full HD (1080p) with several enhancements: compatibility with all PC controllers, turbo speed, networked multiplayer, and even more!

+ + + Dolphin's main window + http://dolphin-emu.org/m/user/flatpak/screenshot_1.png + + + In-game + http://dolphin-emu.org/m/user/flatpak/screenshot_2.png + + + Graphics configuration + http://dolphin-emu.org/m/user/flatpak/screenshot_3.png + + + Controller configuration + http://dolphin-emu.org/m/user/flatpak/screenshot_4.png + + + dolphin-emu.desktop + + dolphin-emu + dolphin-emu.desktop + + + + + https://dolphin-emu.org + https://bugs.dolphin-emu.org/projects/emulator/issues + https://dolphin-emu.org/docs/faq/ + https://dolphin-emu.org/docs/guides/ + https://www.transifex.com/projects/p/dolphin-emu + https://dolphin-emu.org/docs/faq/#ive-got-idea-make-dolphin-better-how-should-i-tell + https://github.com/dolphin-emu/dolphin + https://github.com/dolphin-emu/dolphin/blob/master/Contributing.md +
diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.yml b/Flatpak/org.DolphinEmu.dolphin-emu.yml new file mode 100644 index 0000000000..f19f9f8bc4 --- /dev/null +++ b/Flatpak/org.DolphinEmu.dolphin-emu.yml @@ -0,0 +1,83 @@ +app-id: org.DolphinEmu.dolphin-emu +runtime: org.kde.Platform +runtime-version: '6.7' +sdk: org.kde.Sdk +command: dolphin-emu-wrapper +rename-desktop-file: dolphin-emu.desktop +rename-icon: dolphin-emu +finish-args: + - --device=all + - --socket=pulseaudio + # dolphin doesn't work on wayland (only the ui does), if a user were to set + # this env variable globally to wayland then games wouldn't work. + # we overwrite the setting and force xcb to prevent this from happening. + - --env=QT_QPA_PLATFORM=xcb + - --socket=x11 + - --share=network + - --share=ipc + # required for the emulated bluetooth adapter feature to work. + - --allow=bluetooth + - --filesystem=xdg-run/app/com.discordapp.Discord:create + - --talk-name=org.freedesktop.ScreenSaver + # required for Gamescope on Steam Deck + - --filesystem=xdg-run/gamescope-0:ro +modules: + # enables motion controls on non-wii controllers (switch, ps4, etc) + # requires a udev rule enabling Motion Sensors access + - name: libevdev + buildsystem: meson + config-opts: + - -Dtests=disabled + - -Ddocumentation=disabled + sources: + - type: archive + url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.2.tar.xz + sha256: 3eca86a6ce55b81d5bce910637fc451c8bbe373b1f9698f375c7f1ad0de3ac48 + x-checker-data: + type: anitya + project-id: 20540 + stable-only: true + url-template: https://www.freedesktop.org/software/libevdev/libevdev-$version.tar.xz + + # needed for screensaver inhibition + - name: xdg-screensaver-shim + buildsystem: meson + sources: + - type: archive + url: https://github.com/Unrud/xdg-screensaver-shim/archive/0.0.2.tar.gz + sha256: 0ed2a69fe6ee6cbffd2fe16f85116db737f17fb1e79bfb812d893cf15c728399 + + # build the vendored SDL2 from Externals until the runtime gets 2.30.6 + - SDL2/SDL2.json + + - name: dolphin-emu + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DENABLE_ALSA=OFF + - -DENABLE_SDL=ON + - -DENABLE_EVDEV=ON + - -DDISTRIBUTOR=dolphin-emu.org + cleanup: + - /share/man + post-install: + - install -D -t ${FLATPAK_DEST}/bin/ dolphin-emu-wrapper + - "${FLATPAK_BUILDER_BUILDDIR}/Flatpak/fill_release_node.sh" + - install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ org.DolphinEmu.dolphin-emu.metainfo.xml + - desktop-file-edit --set-key=Exec --set-value='/app/bin/dolphin-emu-wrapper' + /app/share/applications/dolphin-emu.desktop + sources: + - type: dir + path: .. + - type: file + path: org.DolphinEmu.dolphin-emu.metainfo.xml.in + dest-filename: org.DolphinEmu.dolphin-emu.metainfo.xml + - 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 + dolphin-emu "$@" + dest-filename: dolphin-emu-wrapper From ef512aae6d25ffda1eec93586ce31fc6012d7101 Mon Sep 17 00:00:00 2001 From: Carles Pastor Date: Thu, 12 Sep 2024 19:39:56 +0200 Subject: [PATCH 2/3] Flatpak -- bump libevdev to 1.13.3 this matches the version currently being served on flathub --- Flatpak/org.DolphinEmu.dolphin-emu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flatpak/org.DolphinEmu.dolphin-emu.yml b/Flatpak/org.DolphinEmu.dolphin-emu.yml index f19f9f8bc4..1a059de6e0 100644 --- a/Flatpak/org.DolphinEmu.dolphin-emu.yml +++ b/Flatpak/org.DolphinEmu.dolphin-emu.yml @@ -31,8 +31,8 @@ modules: - -Ddocumentation=disabled sources: - type: archive - url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.2.tar.xz - sha256: 3eca86a6ce55b81d5bce910637fc451c8bbe373b1f9698f375c7f1ad0de3ac48 + url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.3.tar.xz + sha256: abf1aace86208eebdd5d3550ffded4c8d73bb405b796d51c389c9d0604cbcfbf x-checker-data: type: anitya project-id: 20540 From ce010a656022f4403dcbc3553d82f9bf641c9948 Mon Sep 17 00:00:00 2001 From: Carles Pastor Date: Thu, 12 Sep 2024 20:51:31 +0200 Subject: [PATCH 3/3] Metainfo -- remove hash from version string git describe --tags appends the short hash, this cleans up the output so that we only print the actual version string. --- Flatpak/fill_release_node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flatpak/fill_release_node.sh b/Flatpak/fill_release_node.sh index f211769a7c..43597fa920 100755 --- a/Flatpak/fill_release_node.sh +++ b/Flatpak/fill_release_node.sh @@ -2,7 +2,7 @@ DATE=$(git log -1 --pretty=%cd --date=iso8601 --date=format:'%Y-%m-%d') sed -i -e "s/@DATE_PLACEHOLDER/${DATE}/" org.DolphinEmu.dolphin-emu.metainfo.xml -VERSION=$(git describe --tags) +VERSION=$(git describe --tags | sed -E 's/^([0-9]+-[0-9]+).*/\1/') sed -i -e "s/@VERSION_PLACEHOLDER/${VERSION}/" org.DolphinEmu.dolphin-emu.metainfo.xml