forked from GloriousEggroll/proton-ge-custom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protonprep.sh
executable file
·364 lines (268 loc) · 14 KB
/
protonprep.sh
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#!/bin/bash
### (1) PREP SECTION ###
cd gst-plugins-base
git reset --hard HEAD
git clean -xdf
echo "add Guy's patch for gstreamer preroll buffer for media converter"
patch -Np1 < ../patches/gstreamer/mediaconvert-gstdecodebin2.patch
cd ..
cd gst-plugins-ugly
git reset --hard HEAD
git clean -xdf
echo "add Guy's patch to fix wmv playback in gst-plugins-ugly"
patch -Np1 < ../patches/gstreamer/asfdemux-Re-initialize_demux-adapter_in_gst_asf_demux_reset.patch
patch -Np1 < ../patches/gstreamer/asfdemux-gst_asf_demux_reset_GST_FORMAT_TIME_fix.patch
cd ..
cd vkd3d-proton
git reset --hard HEAD
git clean -xdf
echo "add pending resizable bar PR"
patch -Np1 < ../patches/vkd3d/741.patch
echo "diablo 2 dx12 hotfix"
patch -Np1 < ../patches/vkd3d/767.patch
cd ..
cd dxvk
git reset --hard HEAD
git clean -xdf
echo "add valve dxvk patches"
patch -Np1 < ../patches/dxvk/proton-dxvk_avoid_spamming_log_with_requests_for_IWineD3D11Texture2D.patch
patch -Np1 < ../patches/dxvk/proton-dxvk_add_new_dxvk_config_library.patch
echo "proton re8 fixups"
patch -Np1 < ../patches/dxvk/RE8_proton_fixups.patch
echo "ffxiv hotfix https://github.com/doitsujin/dxvk/issues/2210"
patch -Np1 < ../patches/dxvk/ffxiv-framelatency.patch
# this needs to be the last patch in the list.. because reasons?
echo "add dxvk async patch"
patch -Np1 < ../patches/dxvk/dxvk-async.patch
cd ..
#WINE STAGING
cd wine-staging
git reset --hard HEAD
git clean -xdf
# revert pending pulseaudio changes
git revert --no-commit 183fd3e089b170d5b7405a80a23e81dc7c4dd682
# reenable pulseaudio patches
patch -Np1 < ../patches/wine-hotfixes/staging/staging-reenable-pulse.patch
patch -RNp1 < ../patches/wine-hotfixes/staging/staging-pulseaudio-reverts.patch
# protonify syscall emulation
patch -Np1 < ../patches/wine-hotfixes/staging/protonify_stg_syscall_emu.patch
# partial revert to fix steamclient
patch -RNp1 < ../patches/wine-hotfixes/staging/staging-server-default-integrity.patch
cd ..
### END PREP SECTION ###
### (2) WINE PATCHING ###
cd wine
git reset --hard HEAD
git clean -xdf
### (2-1) PROBLEMATIC COMMIT REVERT SECTION ###
# https://bugs.winehq.org/show_bug.cgi?id=49990
echo "revert bd27af974a21085cd0dc78b37b715bbcc3cfab69 which breaks some game launchers and 3D Mark"
git revert --no-commit bd27af974a21085cd0dc78b37b715bbcc3cfab69
echo "this breaks hitman 2"
git revert --no-commit 8f37560faf130eecd137c14db39555952edf9aaa
echo "this breaks temtem"
git revert --no-commit 091c92521ee22558bbc2adcdd8b18b213d818180
git revert --no-commit fade7a5862a31d26c7368818824cce6c4988a1b3
git revert --no-commit 3bace8862f1b49e40574d1c9647e6984f10d026f
# https://github.com/ValveSoftware/Proton/issues/1295#issuecomment-859185208
echo "these break Tokyo Xanadu Xe+"
git revert --no-commit 2ad44002da683634de768dbe49a0ba09c5f26f08
git revert --no-commit dfa4c07941322dbcad54507cd0acf271a6c719ab
echo "temporary pulseaudio reverts"
git revert --no-commit e309bad98c736d3409b5ceaffa77486a73c1f80b
git revert --no-commit 7d60d0d7bbc0138133d1968dc3802e2e79ab5b32
git revert --no-commit 4303e753137d0b44cff4f9261d10ef86d57016f2
git revert --no-commit 2e64d91428757eaa88475b49bf50922cda603b59
git revert --no-commit f77af3dd6324fadaf153062d77b51f755f71faea
git revert --no-commit ce151dd681fe5ee80daba96dce12e37d6846e152
git revert --no-commit 77813eb7586779df0fb3b700000a17e339fd5ce3
git revert --no-commit d8e9621cfad50596378283704dfb1e6926d77ed8
git revert --no-commit a4149d53f734bf898087e22170eab5bed9a423d1
git revert --no-commit b4c7823bbb6a792098131f5572506784c8ed0f35
git revert --no-commit 70f59eb179d6a1c1b4dbc9e0a45b5731cd260793
git revert --no-commit e19d97ff4e2f5a7800d6df77b8acce95130b84c3
git revert --no-commit 4432b66e372caf0096df56f45502d7dea1f1800c
git revert --no-commit 6a6296562f536ed10d221f0df43ef30bbd674cb2
git revert --no-commit aba40bd50a065b3ac913dbc1263c38535fb5d9e7
git revert --no-commit bf74f36350c92daae84623dc0bd0530c212bb908
git revert --no-commit 1518e73b23211af738ae448a80466c0199f24419
git revert --no-commit 44e4132489c28b429737be022f6d4044c5beab3e
git revert --no-commit a6131544e87c554f70c21a04fb4697d8e1f508d5
git revert --no-commit 80b996c53c767fef4614f097f14c310285d9c081
git revert --no-commit 459e911b653c7519a335661a6c0b0894e86d2f1a
git revert --no-commit 42d826bc8c1d625ed2985ff06c2cd047209a1916
git revert --no-commit 30c17619e5401618122ca330cf0909f49b170a59
git revert --no-commit af84907ccad3e28f364ecfaa75ccb5fedf7f5a42
git revert --no-commit a5997bece730beb8ab72d66b824ed2a1cb92c254
git revert --no-commit 24a7c33fc1ad6dbab489284cfb6dba4130297ddb
git revert --no-commit 8cb88173d87efedce8c345beea05641f5617d857
git revert --no-commit 505d4b8b14913f3abd362bf27272e6b239cb6ce4
git revert --no-commit 638455136b4d30b853b02b77a2f33dc61c60b267
git revert --no-commit 13cac6287c454146eff73aabc4b92b5c8f76d4df
git revert --no-commit d7b957654d4739b8dd07c91f051b7940f416ef42
git revert --no-commit 8ea23d0d44ced0ce7dadc9b2546cbc56f6bce364
git revert --no-commit 0b0ae164f4ccebf4b5bc1bb1529a90786d2d5941
git revert --no-commit 131b7fd5e16a3da17aed28e86933074c5d663d9f
git revert --no-commit 8060e56b26add8eafffb211119798569ea3188ff
git revert --no-commit bca0706f3a93fa0a57f4dbdc6ae541e8f25afb34
git revert --no-commit b1ddfca16e4696a52adf2bdd8333eeffb3c6170c
git revert --no-commit a5d4079c8285c10ab2019c9fd9d19a6b22babb76
git revert --no-commit ebd344f2922f4044117904e024a0a87576a3eff1
git revert --no-commit 0eeefec6c56084a0677403aee46493e2c03a1dca
git revert --no-commit 5477f2b0156d16952a286dd0df148c2f60b71fe6
git revert --no-commit fa097243e06b3855a240c866a028add722025ead
git revert --no-commit 8df72bade54d1ef7a6d9e79f20ee0a2697019c13
git revert --no-commit e264ec9c718eb66038221f8b533fc099927ed966
git revert --no-commit d3673fcb034348b708a5d8b8c65a746faaeec19d
# restore e309bad98c736d3409b5ceaffa77486a73c1f80b and
# 7d60d0d7bbc0138133d1968dc3802e2e79ab5b32 without winepulse
# bits to prevent breakage elsewhere.
patch -Np1 < ../patches/wine-hotfixes/staging/wine-pulseaudio-fixup.patch
### END PROBLEMATIC COMMIT REVERT SECTION ###
### (2-2) WINE STAGING APPLY SECTION ###
# these cause window freezes/hangs with origin
# -W winex11-_NET_ACTIVE_WINDOW \
# -W winex11-WM_WINDOWPOSCHANGING \
# this needs to be disabled of disabling the winex11 patches above because staging has them set as a dependency.
# -W imm32-com-initialization
# instead, we apply it manually:
# patch -Np1 < ../patches/wine-hotfixes/imm32-com-initialization_no_net_active_window.patch
# This is currently disabled in favor of a rebased version of the patchset
# which includes fixes for red dead redemption 2
# -W bcrypt-ECDHSecretAgreement \
# This was found to cause hangs in various games
# Notably DOOM Eternal and Resident Evil Village
# -W ntdll-NtAlertThreadByThreadId
echo "applying staging patches"
../wine-staging/patches/patchinstall.sh DESTDIR="." --all \
-W winex11-_NET_ACTIVE_WINDOW \
-W winex11-WM_WINDOWPOSCHANGING \
-W imm32-com-initialization \
-W bcrypt-ECDHSecretAgreement \
-W ntdll-NtAlertThreadByThreadId \
-W dwrite-FontFallback
# apply this manually since imm32-com-initialization is disabled in staging.
patch -Np1 < ../patches/wine-hotfixes/staging/imm32-com-initialization_no_net_active_window.patch
patch -Np1 < ../patches/wine-hotfixes/staging/mfplat_dxgi_stub.patch
echo "applying staging Compiler_Warnings revert for steamclient compatibility"
# revert this, it breaks lsteamclient compilation
patch -RNp1 < ../wine-staging/patches/Compiler_Warnings/0031-include-Check-element-type-in-CONTAINING_RECORD-and-.patch
### END WINE STAGING APPLY SECTION ###
### (2-3) GAME PATCH SECTION ###
echo "mech warrior online"
patch -Np1 < ../patches/game-patches/mwo.patch
echo "ffxiv launcher"
patch -Np1 < ../patches/game-patches/ffxiv-launcher-workaround.patch
echo "assetto corsa"
patch -Np1 < ../patches/game-patches/assettocorsa-hud.patch
# TODO: Add game-specific check
echo "mk11 patch"
patch -Np1 < ../patches/game-patches/mk11.patch
# BLOPS2 uses CEG which does not work in proton. Disabled for now
# echo "blackops 2 fix"
# patch -Np1 < ../patches/game-patches/blackops_2_fix.patch
echo "killer instinct vulkan fix"
patch -Np1 < ../patches/game-patches/killer-instinct-winevulkan_fix.patch
### END GAME PATCH SECTION ###
### (2-4) PROTON PATCH SECTION ###
echo "applying __wine_make_process_system_restore revert for steamclient compatibility"
# revert this, it breaks lsteamclient compilation
patch -RNp1 < ../patches/wine-hotfixes/steamclient/__wine_make_process_system_restore.patch
echo "clock monotonic"
patch -Np1 < ../patches/proton/01-proton-use_clock_monotonic.patch
#WINE FSYNC
echo "applying fsync patches"
patch -Np1 < ../patches/proton/03-proton-fsync_staging.patch
echo "LAA"
patch -Np1 < ../patches/proton/04-proton-LAA_staging.patch
echo "steamclient swap"
patch -Np1 < ../patches/proton/08-proton-steamclient_swap.patch
echo "protonify"
patch -Np1 < ../patches/proton/10-proton-protonify_staging.patch
echo "protonify-audio"
patch -Np1 < ../patches/proton/11-proton-pa-staging.patch
echo "steam bits"
patch -Np1 < ../patches/proton/12-proton-steam-bits.patch
echo "proton SDL patches"
patch -Np1 < ../patches/proton/14-proton-sdl-joy.patch
echo "Valve VR patches"
patch -Np1 < ../patches/proton/16-proton-vrclient-wined3d.patch
echo "amd ags"
patch -Np1 < ../patches/proton/18-proton-amd_ags.patch
echo "msvcrt overrides"
patch -Np1 < ../patches/proton/19-proton-msvcrt_nativebuiltin.patch
echo "atiadlxx needed for cod games"
patch -Np1 < ../patches/proton/20-proton-atiadlxx.patch
echo "valve registry entries"
patch -Np1 < ../patches/proton/21-proton-01_wolfenstein2_registry.patch
patch -Np1 < ../patches/proton/22-proton-02_rdr2_registry.patch
patch -Np1 < ../patches/proton/23-proton-03_nier_sekiro_ds3_registry.patch
patch -Np1 < ../patches/proton/24-proton-04_cod_registry.patch
patch -Np1 < ../patches/proton/32-proton-05_spellforce_registry.patch
patch -Np1 < ../patches/proton/33-proton-06_shadow_of_war_registry.patch
patch -Np1 < ../patches/proton/41-proton-07_nfs_registry.patch
patch -Np1 < ../patches/proton/45-proton-08_FH4_registry.patch
patch -Np1 < ../patches/proton/46-proton-09_nvapi_registry.patch
patch -Np1 < ../patches/proton/47-proton-10_dirt_5_registry.patch
echo "valve rdr2 fixes"
patch -Np1 < ../patches/proton/25-proton-rdr2-fixes.patch
echo "apply staging bcrypt patches on top of rdr2 fixes"
patch -Np1 < ../patches/wine-hotfixes/staging/0001-bcrypt-Allow-multiple-backends-to-coexist.patch
patch -Np1 < ../patches/wine-hotfixes/staging/0002-bcrypt-Implement-BCryptSecretAgreement-with-libgcryp.patch
echo "set prefix win10"
patch -Np1 < ../patches/proton/28-proton-win10_default.patch
echo "dxvk_config"
patch -Np1 < ../patches/proton/29-proton-dxvk_config.patch
#this is needed specifically for proton, not needed for normal wine
echo "proton-specific manual mfplat dll register patch"
patch -Np1 < ../patches/proton/30-proton-mediafoundation_dllreg.patch
echo "proton-specific mfplat video conversion patches"
patch -Np1 < ../patches/proton/34-proton-winegstreamer_updates.patch
echo "mouse focus fixes"
patch -Np1 < ../patches/proton/38-proton-mouse-focus-fixes.patch
echo "CPU topology overrides"
patch -Np1 < ../patches/proton/39-proton-cpu-topology-overrides.patch
echo "proton futex2 patches"
patch -Np1 < ../patches/proton/40-proton-futex2.patch
echo "fullscreen hack"
patch -Np1 < ../patches/proton/41-valve_proton_fullscreen_hack-staging-tkg.patch
echo "fullscreen hack fsr patch"
patch -Np1 < ../patches/proton/48-proton-fshack_amd_fsr.patch
echo "proton QPC performance patch"
patch -Np1 < ../patches/proton/49-proton_QPC.patch
echo "proton LFH performance patch"
patch -Np1 < ../patches/proton/50-proton_LFH.patch
echo "proton font patches"
patch -Np1 < ../patches/proton/51-proton_fonts.patch
# disabled for now, needs rebase. only used for vr anyway
# echo "proton openxr patches"
# patch -Np1 < ../patches/proton/37-proton-OpenXR-patches.patch
### END PROTON PATCH SECTION ###
### (2-5) WINE HOTFIX SECTION ###
echo "mfplat additions"
patch -Np1 < ../patches/wine-hotfixes/mfplat/mfplat-godfall-hotfix.patch
# fixes witcher 3, borderlands 3, rockstar social club, and a few others
echo "heap allocation hotfix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-remi_heap_alloc.patch
echo "uplay broken rendering hotfix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-uplay_render_fix.patch
echo "msfs2020 hotfix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-msfs2020.patch
# disabled, still horribly broken
# patch -Np1 < ../patches/wine-hotfixes/testing/wine_wayland_driver.patch
### END WINE HOTFIX SECTION ###
### (2-6) WINE PENDING UPSTREAM SECTION ###
echo "BF4 ping fix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-bf4_ping.patch
echo "riftbreaker fix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-riftbreaker.patch
# https://bugs.winehq.org/show_bug.cgi?id=51596
echo "winelib fix"
patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-winelib.patch
# disabled, currently breaks more than one controller being able to be used.
# echo "winebus fix"
# patch -Np1 < ../patches/wine-hotfixes/pending/hotfix-winebus.patch
### END WINE PENDING UPSTREAM SECTION ###
### (2-7) WINE CUSTOM PATCHES ###
### END WINE CUSTOM PATCHES ###
### END WINE PATCHING ###