-
Notifications
You must be signed in to change notification settings - Fork 0
/
com.projectplusgame.ProjectPlus.yml
221 lines (190 loc) · 11 KB
/
com.projectplusgame.ProjectPlus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
app-id: com.projectplusgame.ProjectPlus
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: ishiiruka-wrapper
rename-desktop-file: faster-project-plus.desktop
rename-icon: ishiiruka
finish-args:
- --device=all
- --filesystem=host:ro
- --socket=pulseaudio
- --env=QT_QPA_PLATFORM=xcb
- --socket=x11
- --share=network
- --share=ipc
- --allow=bluetooth # Required for the emulated bluetooth adapter feature to work
- --filesystem=xdg-run/gamescope-0:ro # Required for Gamescope on Steam Deck
- --filesystem=xdg-run/app/com.discordapp.Discord:create
- --talk-name=org.freedesktop.ScreenSaver
modules:
- shared-modules/gtk2/gtk2.json
- name: gtk2
- shared-modules/libusb/libusb.json
- name: libusb
# 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.1.tar.xz
sha256: 06a77bf2ac5c993305882bc1641017f5bec1592d6d1b64787bad492ab34f2f36
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
# The forked dolphin version Project Plus uses preloaded with the Project Plus sd.raw card and .dol Launcher files
- name: ishiiruka
buildsystem: cmake
config-opts:
# - -DLINUX_LOCAL_DEV=true # This flag makes Dolphin/Ishiiruka look for the Sys directory in the same directory as the binary and the repo we are pulling from places the Sys directory there by default (if this is turned off make sure the Sys directory is being moved to /app/share/ishiiruka/sys instead)
- -DINSTALL_ICONS=ON
- -DCMAKE_BUILD_TYPE=Release
- -DENABLE_SDL=ON
- -DENABLE_EVDEV=ON
- -DDISTRIBUTOR=Flathub
cleanup:
- /share/man
sources:
# Project Plus Ishiiruka/Dolphin emulator fork
- type: git
url: https://github.com/jlambert360/Ishiiruka.git
commit: 49ac69f750e0f1c6422da114d630a2532f290db2
# Move wx files into source
- type: shell
commands:
- |
echo "Moving wx files into source"
cp Externals/wxWidgets3/include/wx Source/Core/ -r
cp Externals/wxWidgets3/wx/* Source/Core/wx/
# Copy gdkconfig.h from previously installed gtk2 above to an included directory otherwise making will complain about not being able to find either gdkconfig.h or gtk/gtk.h
- type: shell
commands:
- |
echo "Copying /app/lib/gtk-2.0/include/gdkconfig.h to /app/include/gtk-2.0/gdkconfig.h"
cp /app/lib/gtk-2.0/include/gdkconfig.h /app/include/gtk-2.0/gdkconfig.h
# Patches Source/Core/UICommon/UICommon.cpp to check if in a Flatpak sandbox and set data, config, and cache paths correctly
- type: patch
path: detectflatpak.patch
# Patches Data/User/Config/Dolphin.ini to set proper paths, graphics backend, and audio backend
- type: patch
path: dolphinini.patch
# Patches Data/User/Config/GFX.ini to set FullAsyncShaderCompilation false (crashes on Linux), and Tessellation false (not supported Linux)
- type: patch
path: gfxini.patch
# Patches CMakeLists.txt to install the icon as 256x256 as well (flatpak-builder will give error if only installed as default 48x48)
- type: patch
path: iconinstall.patch
# Project Plus SD card
- type: file
url: https://github.com/jlambert360/FPM-AppImage/releases/download/v3.0.5/sd.tar.gz
sha256: e8ef3df5a2f4cdc59dec3d5c08b3e26e5156ce51fcddb16ac8bd839f4ef54089 # This is the hash of the tar.gz file not the uncompressed
# Project Plus .dol files and icon
- type: archive
url: https://github.com/jlambert360/FPM-AppImage/releases/download/v3.0.5/Launcher.tar.gz
sha256: 1b9dce2fb0eac3ad8cc809826b3b6bfd4ce30dbfc394eaa586e35dcd356fd189 # This is the hash of the tar.gz file not the uncompressed
dest: Launcher
# Project Plus ModPack that contains HD textures
- type: archive
url: https://github.com/jlambert360/PPlusReleases/releases/download/v3.0.5/Project+.v3.0.5.Modders.Pack.zip
sha256: 04b8902dcddd5cdbf14e1eca7ba552158a1853f6e1cfe4f8daf72b48a1d4eb51 # This is the hash of the zip file not the uncompressed
dest: ModPack
# Metadata file for Flatpak repos
- type: file
path: com.projectplusgame.ProjectPlus.metainfo.xml
# The script that is run when the Flatpak is started everytime
- type: script
commands:
- |
#!/bin/sh
# Setup Discord rich presence
echo "Setting up Discord rich presence"
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
# This is a bit of a hacky way to get the sd.raw, Launcher directory, and patched Dolphin.ini/GFX.ini into the Flatpak user var directory, because the installation directory for Flatpaks is not writable and so we cannot use portable.txt + the User directory beside the binary
echo "Make directory /var/data/FasterPPlus/Wii (~/.var/app/com.projectplusgame.ProjectPlus/data/FasterPPlus/Wii) if it doesn't exist"
mkdir -p /var/data/FasterPPlus/Wii
echo "Make directory /var/config/FasterPPlus/ (~/.var/app/com.projectplusgame.ProjectPlus/config/FasterPPlus) if it doesn't exist"
mkdir -p /var/config/FasterPPlus
# Create and set variables for the system and user SD card creation dates
SystemSDCardCreationDate=`stat --format="%W" /app/share/ishiiruka/sys/Wii/sd.raw`
UserSDCardCreationDate=`stat --format="%W" /var/data/FasterPPlus/Wii/sd.raw`
# Check if the system SD card creation date is newer than the user SD card creation date (There has been an update), or there is no user SD card
echo "Checking if there is a newer SD card version"
if [ $SystemSDCardCreationDate -gt ${UserSDCardCreationDate:=0} ];
then
# Copy newer SD card to user data directory
echo "Copying newer SD card to user data directory"
cp /app/share/ishiiruka/sys/Wii/sd.raw /var/data/FasterPPlus/Wii/sd.raw
else
echo "SD card is already at latest version"
fi
echo "Copy /app/share/ishiiruka/sys/Wii/Launcher (/var/lib/flatpak/app/com.projectplusgame.ProjectPlus/current/active/files/share/ishiiruka/sys/Wii/Launcher) to /var/data/FasterPPlus/Wii (~/.var/app/com.projectplusgame.ProjectPlus/data/FasterPPlus/Wii) if it doesn't already exist"
cp -nr /app/share/ishiiruka/sys/Wii/Launcher /var/data/FasterPPlus/Wii
echo "Copy user config /app/share/ishiiruka/user/Config/Dolphin.ini and GFX.ini (/var/lib/flatpak/app/com.projectplusgame.ProjectPlus/current/active/files/share/ishiiruka/user/Config/Dolphin.ini) to /var/config/FasterPPlus/Dolphin.ini and GFX.ini (~/.var/app/com.projectplusgame.ProjectPlus/config/FasterPPlus/Dolphin.ini and GFX.ini) if they don't already exist"
cp -n /app/share/ishiiruka/user/Config/Dolphin.ini /var/config/FasterPPlus/Dolphin.ini
cp -n /app/share/ishiiruka/user/Config/GFX.ini /var/config/FasterPPlus/GFX.ini
# Create and set variables for the system and user HD textures creation dates
SystemHDTexturesCreationDate=`stat --format="%W" /app/share/ishiiruka/user/Load/Textures/RSBE01`
UserHDTexturesCreationDate=`stat --format="%W" /var/data/FasterPPlus/Load/Textures/RSBE01`
# Check if the system HD textures creation date is newer than the user HD textures creation date (There has been an update), or there is no user HD textures
echo "Checking if there are newer HD textures"
if [ $SystemHDTexturesCreationDate -gt ${UserHDTexturesCreationDate:=0} ];
then
# Make /var/data/FasterPPlus/Load/Textures directory if it doesn't exist
echo "Make directory /var/data/FasterPPlus/Load/Textures (~/.var/app/com.projectplusgame.ProjectPlus/data/FasterPPlus/Load/Textures) if it doesn't exist"
mkdir -p /var/data/FasterPPlus/Load/Textures
# Copy newer HD textures to user data directory
echo "Copying newer HD textures to user data directory"
cp -r /app/share/ishiiruka/user/Load/Textures/RSBE01 /var/data/FasterPPlus/Load/Textures
else
echo "HD textures are already at latest version"
fi
# Launch ishiiruka binary
ishiiruka "$@"
dest-filename: ishiiruka-wrapper
post-install:
# Install ishiiruka-wrapper script
- |
echo "Installing ishiiruka-wrapper in /app/bin/"
install -D -t /app/bin/ ishiiruka-wrapper
# Change exec of desktop file to launch ishiiruka-wrapper instead of ishiiruka
- |
echo "Changing exec of /app/share/applications/faster-project-plus.desktop file to launch ishiiruka-wrapper instead of ishiiruka"
desktop-file-edit --set-key=Exec --set-value='/app/bin/ishiiruka-wrapper' /app/share/applications/faster-project-plus.desktop
# Install metainfo file in Flatpak
- |
echo "Installing com.projectplusgame.ProjectPlus.metainfo.xml in /app/share/metainfo/"
install -Dm644 -t /app/share/metainfo/ com.projectplusgame.ProjectPlus.metainfo.xml
# Move /app/bin/Sys to /app/share/ishiiruka/sys (only use this without the -DLINUX_LOCAL_DEV=true flag set in config-opts)
- |
echo "Moving /app/bin/Sys to /app/share/ishiiruka/sys"
mv /app/bin/Sys /app/share/ishiiruka/sys
# Extract and move sd.tar.gz to /app/share/ishiiruka/sys/Wii
- |
echo "Extracting and moving sd.tar.gz to /app/share/ishiiruka/sys/Wii"
tar -xf sd.tar.gz -C /app/share/ishiiruka/sys/Wii
# Move Launcher directory with .dol files and icon to /app/share/ishiiruka/sys/Wii
- |
echo "Moving Launcher directory to /app/share/ishiiruka/sys/Wii"
mv Launcher /app/share/ishiiruka/sys/Wii
# Create Textures directory, move and rename ModPack HD textures directory to /app/share/ishiiruka/user/Load/Textures/RSBE01
- |
echo "Creating /app/share/ishiiruka/user/Load/Textures"
mkdir /app/share/ishiiruka/user/Load/Textures
echo "Moving and renaming HD textures directory to /app/share/ishiiruka/user/Load/Textures/RSBE01"
mv 'ModPack/Full Quality HD Textures' /app/share/ishiiruka/user/Load/Textures/RSBE01