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
|
# Maintainer: Peter Jung ptr1337 <admin@ptr1337.dev>
# Maintainer: loathingkernel <loathingkernel _a_ gmail _d_ com>
pkgname=proton-cachyos
_srctag=9.0-20250307
_commit=
pkgver=${_srctag//-/.}
_geckover=2.47.4
_monover=9.3.1
_xaliaver=0.4.5
pkgrel=4
epoch=1
source=(
proton-cachyos::git+https://github.com/CachyOS/proton-cachyos.git#tag=cachyos-${_srctag}
https://dl.winehq.org/wine/wine-gecko/${_geckover}/wine-gecko-${_geckover}-x86{,_64}.tar.xz
https://github.com/madewokherd/wine-mono/releases/download/wine-mono-${_monover}/wine-mono-${_monover}-x86.tar.xz
https://github.com/madewokherd/xalia/releases/download/xalia-${_xaliaver}/xalia-${_xaliaver}-net48-mono.zip
0001-proton-fix-logic-error-that-caused-proton-to-hang-on.patch
0002-proton-replace-junk-wayland-enablement-code-with-ups.patch
0001-Revert-proton-wait-for-process-to-exit-when-run-thro.patch
0001-build-disable-wine-display-drivers-when-building.patch
0001-explorer-Enable-the-Wayland-driver.patch
0001-Revert-HACK-winegstreamer-Set-GST_GL_WINDOW-environm.patch
)
noextract=(
wine-gecko-${_geckover}-{x86,x86_64}.tar.xz
wine-mono-${_monover}-x86.tar.xz
xalia-${_xaliaver}-net48-mono.zip
)
pkgdesc="A compatibility tool for Steam Play based on Wine and additional components, experimental branch with extra CachyOS flavour"
url="https://github.com/cachyos/proton-cachyos"
arch=(x86_64 x86_64_v3)
options=(!staticlibs !lto !debug emptydirs)
license=('custom')
depends=(
attr lib32-attr
blas lib32-blas
cabextract
desktop-file-utils
fontconfig lib32-fontconfig
freetype2 lib32-freetype2
gcc-libs lib32-gcc-libs
gettext lib32-gettext
lapack lib32-lapack
libgudev lib32-libgudev
libpcap lib32-libpcap
libsoup lib32-libsoup
libvpx lib32-libvpx
libxcursor lib32-libxcursor
libxkbcommon lib32-libxkbcommon
libxi lib32-libxi
libxrandr lib32-libxrandr
lzo lib32-lzo
python
sdl2 lib32-sdl2
speex lib32-speex
steam-native-runtime
)
depends+=(
wayland lib32-wayland
)
makedepends=(autoconf bison perl flex mingw-w64-gcc
git
afdko
alsa-lib lib32-alsa-lib
clang
cmake
ffmpeg
fontforge
giflib lib32-giflib
glib2-devel
glslang
gnutls lib32-gnutls
gst-plugins-base-libs lib32-gst-plugins-base-libs
gtk3 lib32-gtk3
libgphoto2
libpulse lib32-libpulse
libva lib32-libva
libxcomposite lib32-libxcomposite
libxinerama lib32-libxinerama
libxxf86vm lib32-libxxf86vm
lld
mesa lib32-mesa
mesa-libgl lib32-mesa-libgl
meson
mingw-w64-tools
nasm
opencl-headers
opencl-icd-loader lib32-opencl-icd-loader
rsync
rust lib32-rust-libs
python
python-pefile
sdl2 lib32-sdl2
unzip
v4l-utils lib32-v4l-utils
vulkan-headers
vulkan-icd-loader lib32-vulkan-icd-loader
wget
)
makedepends+=(
wayland-protocols
)
optdepends=(
alsa-lib lib32-alsa-lib
alsa-plugins lib32-alsa-plugins
giflib lib32-giflib
gnutls lib32-gnutls
gst-plugins-base-libs lib32-gst-plugins-base-libs
gtk3 lib32-gtk3
libgphoto2
libpulse lib32-libpulse
libva lib32-libva
libxcomposite lib32-libxcomposite
libxinerama lib32-libxinerama
opencl-icd-loader lib32-opencl-icd-loader
sdl2 lib32-sdl2
v4l-utils lib32-v4l-utils
vulkan-icd-loader lib32-vulkan-icd-loader
)
provides=('proton')
install=${pkgname}.install
_make_wrappers () {
# _arch prefix gcc ld as strip
local _i686=( "i686" "-m32" "-melf_i386" "--32" "elf32-i386")
local _x86_64=("x86_64" "-m64" "-melf_x86_64" "--64" "elf64-x86-64")
local _opts=(_i686 _x86_64)
declare -n _opt
for _opt in "${_opts[@]}"; do
for l in ar ranlib nm; do
ln -s /usr/bin/gcc-$l wrappers/${_opt[0]}-pc-linux-gnu-$l
done
for t in gcc g++; do
install -Dm755 /dev/stdin wrappers/${_opt[0]}-pc-linux-gnu-$t <<EOF
#!/usr/bin/bash
$(which ccache 2> /dev/null) /usr/bin/$t ${_opt[1]} "\$@"
EOF
done
install -Dm755 /dev/stdin wrappers/${_opt[0]}-pc-linux-gnu-ld <<EOF
#!/usr/bin/bash
/usr/bin/ld ${_opt[2]} "\$@"
EOF
install -Dm755 /dev/stdin wrappers/${_opt[0]}-pc-linux-gnu-as <<EOF
#!/usr/bin/bash
/usr/bin/as ${_opt[3]} "\$@"
EOF
install -Dm755 /dev/stdin wrappers/${_opt[0]}-pc-linux-gnu-strip <<EOF
#!/usr/bin/bash
/usr/bin/strip -F ${_opt[4]} "\$@"
EOF
done
}
prepare() {
# Provide wrappers to compiler tools
rm -rf wrappers && mkdir wrappers
_make_wrappers
[ ! -d build ] && mkdir build
cd proton-cachyos
[ ! -d contrib ] && mkdir -p contrib
mv "$srcdir"/wine-gecko-${_geckover}-x86{,_64}.tar.xz contrib/
mv "$srcdir"/wine-mono-${_monover}-x86.tar.xz contrib/
mv "$srcdir"/xalia-${_xaliaver}-net48-mono.zip contrib/
# Explicitly set origin URL for submodules using relative paths
git remote set-url origin https://github.com/CachyOS/proton-cachyos.git
git submodule update --init --filter=tree:0 --recursive
./patches/apply.sh
patch -Np1 -i "$srcdir"/0001-proton-fix-logic-error-that-caused-proton-to-hang-on.patch
patch -Np1 -i "$srcdir"/0002-proton-replace-junk-wayland-enablement-code-with-ups.patch
patch -Np1 -i "$srcdir"/0001-Revert-proton-wait-for-process-to-exit-when-run-thro.patch
patch -Np1 -i "$srcdir"/0001-build-disable-wine-display-drivers-when-building.patch
pushd wine
patch -Np1 -i "$srcdir"/0001-explorer-Enable-the-Wayland-driver.patch
patch -Np1 -i "$srcdir"/0001-Revert-HACK-winegstreamer-Set-GST_GL_WINDOW-environm.patch
popd
for rustlib in gst-plugins-rs; do
pushd $rustlib
export RUSTUP_TOOLCHAIN=stable
export CARGO_HOME="${SRCDEST}"/proton-cargo
cargo update
cargo fetch --locked --target "i686-unknown-linux-gnu"
cargo fetch --locked --target "x86_64-unknown-linux-gnu"
popd
done
}
build() {
export PATH="$(pwd)/wrappers:$PATH"
cd build
ROOTLESS_CONTAINER="" \
../proton-cachyos/configure.sh \
--container-engine="none" \
--proton-sdk-image="" \
--build-name="${pkgname}"
local -a split=($CFLAGS)
local -A flags
for opt in "${split[@]}"; do flags["${opt%%=*}"]="${opt##*=}"; done
local march="${flags["-march"]:-nocona}"
local mtune="${flags["-mtune"]:-core-avx2}"
CFLAGS="-O2 -march=$march -mtune=$mtune -pipe -fno-semantic-interposition"
CXXFLAGS="-O2 -march=$march -mtune=$mtune -pipe -fno-semantic-interposition"
RUSTFLAGS="-C opt-level=2 -C target-cpu=$march"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
export CFLAGS CXXFLAGS RUSTFLAGS LDFLAGS
export RUSTUP_TOOLCHAIN=stable
export CARGO_HOME="${SRCDEST}"/proton-cargo
export WINEESYNC=0
export WINEFSYNC=0
export WINEDLLOVERRIDES="winex11.drv,winewayland.drv,winemenubuild=d;"
SUBJOBS=$([[ "$MAKEFLAGS" =~ -j\ *([1-9][0-9]*) ]] && echo "${BASH_REMATCH[1]}" || echo "$(nproc)") \
make -j1 dist
}
package() {
cd build
# Delete the intermediate build directories to free space (mostly for my github actions)
rm -rf dst-* obj-* src-* pfx-*
local _compatdir="$pkgdir/usr/share/steam/compatibilitytools.d"
mkdir -p "$_compatdir/${pkgname}"
rsync --delete -arx dist/* "$_compatdir/${pkgname}"
# For some unknown to me reason, 32bit vkd3d (not vkd3d-proton) always links
# to libgcc_s_dw2-1.dll no matter what linker options I tried.
# Copy the required dlls into the package, they will be copied later into the prefix
# by the patched proton script. Bundle them to not depend on mingw-w64-gcc being installed.
cp /usr/i686-w64-mingw32/bin/{libgcc_s_dw2-1.dll,libwinpthread-1.dll} \
"$_compatdir/${pkgname}"/files/lib/vkd3d/
cp /usr/x86_64-w64-mingw32/bin/{libgcc_s_seh-1.dll,libwinpthread-1.dll} \
"$_compatdir/${pkgname}"/files/lib64/vkd3d/
mkdir -p "$pkgdir/usr/share/licenses/${pkgname}"
mv "$_compatdir/${pkgname}"/LICENSE{,.OFL} \
"$pkgdir/usr/share/licenses/${pkgname}"
cd "$_compatdir/${pkgname}/files"
i686-w64-mingw32-strip --strip-unneeded \
$(find lib/wine \( -iname fakedlls -or -iname i386-windows \) -prune -false -or -iname "*.dll" -or -iname "*.exe")
x86_64-w64-mingw32-strip --strip-unneeded \
$(find lib64/wine \( -iname fakedlls -or -iname x86_64-windows \) -prune -false -or -iname "*.dll" -or -iname "*.exe")
local _geckodir="share/wine/gecko/wine-gecko-${_geckover}"
i686-w64-mingw32-strip --strip-unneeded \
$(find "$_geckodir"-x86 -iname "*.dll" -or -iname "*.exe")
x86_64-w64-mingw32-strip --strip-unneeded \
$(find "$_geckodir"-x86_64 -iname "*.dll" -or -iname "*.exe")
local _monodir="share/wine/mono/wine-mono-${_monover}"
i686-w64-mingw32-strip --strip-unneeded \
$(find "$_monodir"/lib/mono -iname "*.dll" -or -iname "*.exe")
i686-w64-mingw32-strip --strip-unneeded \
"$_monodir"/lib/x86/*.dll \
$(find "$_monodir" -iname "*x86.dll" -or -iname "*x86.exe")
x86_64-w64-mingw32-strip --strip-unneeded \
"$_monodir"/lib/x86_64/*.dll \
$(find "$_monodir" -iname "*x86_64.dll" -or -iname "*x86_64.exe")
}
b2sums=('18c40da4d5405b9d11ad0391e30b5395a83962e1aca5c2b4ed669de9453ae2119e3a120d6cadbed6ca2f408fc2e73429bad7d28ecb4564d77638d9308394b415'
'2a73c12585b502ae11188482cbc9fb1f45f95bfe4383a7615011104b132f4845f9813d01fb40277e1934fab5f1b35ab40b4f4a66a9967463dd1d666a666904e9'
'62856a88266b4757602c0646e024f832974a93f03b9df253fd4895d4f11a41b435840ad8f7003ec85a0d8087dec15f2e096dbfb4b01ebe4d365521e48fd0c5c0'
'5f4c2a07355a3d394086467f1b0c45698cd83731a4137b59975abdeda2d564f44922a67b1bec111e4209c4fe74247486076e95dffc84d88b5b7a02774efd070b'
'5c3985080995a62c1c765244d430cea86cca82d187874a95d89b3fd9303c89a6944613ae5de7d31354053e5c91d2fc39842e57ee7866a87c529e9becc458ec49'
'783cd2a1dd7ca96b431d084924a4a77579ab70731da1ad0cf32491158ee85ec78e43429b6334dd1976a511910e64fb28792e38166735e2b8a5fdebc5614c0cce'
'65c69c53a54794aa67e3c469710d8271114f250646fa580dbb3398b669b70b1bfe8ca33ecb5219e97a17449e4c10c19f61b39db453646ad52e822b162657c180'
'270c6fe54f3f988b7a5477bf2affb9364d3900eb50f58aea5c688f32c1a66b6c957c6f7578582c78afaa8ef74b92aa980ad1fcc67be6687c45d52ce6b2eaa69b'
'375bdb818649b5e8f5e35362419869710d74f371e76f70a972b6127104930ca05c0d9660bc423d722bdc3425594b25f78d0c2d7e475b554243e44dc0f9edc9a7'
'cf36bf091c607b8d08d89462bc5a4f10bd0293258ca4ebd15ecbb433df33e8bb787018a164dfaf52e20c64fb5e8a150343e789b566b40c1205f69652d27ee60d'
'094007808c97c97008b4be4d2e3c24afe636d4af189e22e3e4fbc86e06ef280d580d696940d9356f03c7813c9238e7ef70ee512b9c7df2a6dcaa29bc1f6c2ff3')
|