forked from wine-mirror/wine
-
Notifications
You must be signed in to change notification settings - Fork 13
391 lines (341 loc) · 11.8 KB
/
build.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
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
name: Build Wine
on:
pull_request:
push:
workflow_dispatch:
env:
CC: clang
CXX: clang++
CPATH: /usr/local/include
LIBRARY_PATH: /usr/local/lib
CFLAGS: -O3 -Wno-deprecated-declarations -Wno-format -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Wno-int-conversion
CROSSCFLAGS: -O3 -Wno-deprecated-declarations -Wno-format -Wno-incompatible-pointer-types -Wno-implicit-function-declaration -Wno-int-conversion
LDFLAGS: -Wl,-ld_classic -Wl,-headerpad_max_install_names -Wl,-rpath,@loader_path/../../ -Wl,-rpath,/usr/local/lib
MACOSX_DEPLOYMENT_TARGET: 10.14
WINE_CONFIGURE: $GITHUB_WORKSPACE/configure
BUILDROOT: $GITHUB_WORKSPACE/build
WINE_INSTALLROOT: install
WINE_MONO: https://github.com/madewokherd/wine-mono/releases/download/wine-mono-7.4.1/wine-mono-7.4.1-x86.tar.xz
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Use Xcode 15
run: sudo xcode-select -switch /Applications/Xcode_15.2.app/Contents/Developer
- name: Install Homebrew Packages
continue-on-error: true
run: |
REQUIRED_PACKAGES=(
# Build Dependencies
"bison"
"pkg-config"
"mingw-w64"
"gcenx/wine/cx-llvm"
# Utilities (DXVK)
"jq"
# Dependencies
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
"winetricks"
)
brew install "${REQUIRED_PACKAGES[@]}"
- name: Add bison & cx-llvm to $PATH
run: |
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix cx-llvm)/bin" >> $GITHUB_PATH
- name: Configure wine64
run: |
set -x
export ac_cv_lib_soname_MoltenVK="libMoltenVK.dylib"
export ac_cv_lib_soname_vulkan=""
mkdir -p ${{ env.BUILDROOT }}/wine64
pushd ${{ env.BUILDROOT }}/wine64
${{ env.WINE_CONFIGURE }} \
--prefix= \
--disable-tests \
--disable-winedbg \
--enable-win64 \
--without-alsa \
--without-capi \
--with-coreaudio \
--with-cups \
--without-dbus \
--without-fontconfig \
--with-freetype \
--with-gettext \
--without-gettextpo \
--without-gphoto \
--with-gnutls \
--without-gssapi \
--with-gstreamer \
--without-krb5 \
--with-mingw \
--without-netapi \
--with-opencl \
--with-opengl \
--without-oss \
--with-pcap \
--with-pthread \
--without-pulse \
--without-sane \
--with-sdl \
--without-udev \
--with-unwind \
--without-usb \
--without-v4l2 \
--with-vulkan \
--without-x
popd
- name: Build wine64
run: |
pushd ${{ env.BUILDROOT }}/wine64
make -j$(sysctl -n hw.ncpu 2>/dev/null)
popd
- name: Install wine64
run: |
pushd ${{ env.BUILDROOT }}/wine64
make install-lib DESTDIR="$GITHUB_WORKSPACE/${{ env.WINE_INSTALLROOT }}"
popd
- name: Configure wine32on64
run: |
set -x
export ac_cv_lib_soname_MoltenVK="libMoltenVK.dylib"
export ac_cv_lib_soname_vulkan=""
mkdir -p ${{ env.BUILDROOT }}/wine32on64
pushd ${{ env.BUILDROOT }}/wine32on64
${{ env.WINE_CONFIGURE }} \
--prefix= \
--disable-loader \
--disable-tests \
--disable-winedbg \
--enable-win32on64 \
--without-alsa \
--without-capi \
--with-coreaudio \
--with-cups \
--without-dbus \
--without-fontconfig \
--with-freetype \
--with-gettext \
--without-gettextpo \
--without-gphoto \
--with-gnutls \
--without-gssapi \
--without-gstreamer \
--without-inotify \
--without-krb5 \
--with-mingw \
--without-netapi \
--without-openal \
--with-opencl \
--with-opengl \
--without-oss \
--with-pcap \
--with-pthread \
--without-pulse \
--without-sane \
--with-sdl \
--without-udev \
--with-unwind \
--without-usb \
--without-v4l2 \
--with-vulkan \
--with-wine64=${{ env.BUILDROOT }}/wine64 \
--without-x
popd
- name: Build wine32on64
run: |
pushd ${{ env.BUILDROOT }}/wine32on64
make -j$(sysctl -n hw.ncpu 2>/dev/null)
popd
- name: Install wine32on64
run: |
pushd ${{ env.BUILDROOT }}/wine32on64
make install-lib DESTDIR="$GITHUB_WORKSPACE/${{ env.WINE_INSTALLROOT }}"
popd
- name: Grab Verbs From Winetricks
run: |
curl -L -o verbs.txt https://raw.githubusercontent.com/Winetricks/winetricks/master/files/verbs/all.txt
- name: Create Final Package
run: |
mkdir -p Libraries/DXVK
mkdir -p Libraries/Wine
cp -a ${{ env.WINE_INSTALLROOT }}/. Libraries/Wine/
rm -rf Libraries/Wine/share/man
cp -a $(brew --prefix winetricks)/bin/winetricks Libraries
cp -a verbs.txt Libraries
cp -a DXVK Libraries
- name: Copy External Libs
run: |
LIBS=(
"libfreetype"
"libfreetype.6"
"libgio-2.0.0"
"libglib-2.0.0"
"libgmodule-2.0.0"
"libgmp.10"
"libgnutls.30"
"libgobject-2.0.0"
"libgraphene-1.0.0"
"libgstallocators-1.0.0"
"libgstapp-1.0.0"
"libgstaudio-1.0.0"
"libgstbase-1.0.0"
"libgstcodecparsers-1.0.0"
"libgstcodecs-1.0.0"
"libgstcontroller-1.0.0"
"libgstgl-1.0.0"
"libgstpbutils-1.0.0"
"libgstreamer-1.0.0"
"libgstriff-1.0.0"
"libgstrtp-1.0.0"
"libgstrtsp-1.0.0"
"libgstsdp-1.0.0"
"libgsttag-1.0.0"
"libgsttranscoder-1.0.0"
"libgstvideo-1.0.0"
"libgthread-2.0.0"
"libhogweed.6"
"libidn2.0"
"libintl.8"
"libjpeg.8"
"libMoltenVK"
"libnettle.8"
"liborc-0.4.0"
"libp11-kit.0"
"libpcre2-8.0"
"libpng16.16"
"libSDL2-2.0.0"
"libtasn1.6"
"libunistring.5"
"libXau.6"
"libXdmcp.6"
"libX11.6"
"libX11-xcb.1"
"libxcb.1"
)
FFMPEG_LIBS=(
"libavfilter.9"
"libavformat.60"
"libavcodec.60"
"libavutil.58"
)
GSTREAMER_LIBS=(
"libgstapplemedia"
"libgstasf"
"libgstaudioconvert"
"libgstaudioparsers"
"libgstaudioresample"
"libgstavi"
"libgstcoreelements"
"libgstdebug"
"libgstdeinterlace"
"libgstid3demux"
"libgstisomp4"
"libgstlibav"
"libgstopengl"
"libgstplayback"
"libgsttypefindfunctions"
"libgstvideoconvertscale"
"libgstvideofilter"
"libgstvideoparsersbad"
"libgstwavparse"
)
for i in "${LIBS[@]}"
do
cp -Lr $(brew --prefix)/lib/"$i".dylib Libraries/Wine/lib
done
for i in "${FFMPEG_LIBS[@]}"
do
cp -Lr $(brew --prefix ffmpeg@6)/lib/"$i".dylib Libraries/Wine/lib
done
mkdir Libraries/Wine/lib/gstreamer-1.0
for i in "${GSTREAMER_LIBS[@]}"
do
cp -Lr $(brew --prefix gstreamer)/lib/gstreamer-1.0/"$i".dylib Libraries/Wine/lib/gstreamer-1.0
done
cp -a $(brew --prefix gstreamer)/lib/gstreamer-1.0/include Libraries/Wine/lib/gstreamer-1.0
# Fixup brew dylib LCs
update_dylib_paths() {
local dylib_file="$1"
local path_prefix="$2"
echo "Processing $dylib_file..."
# Extract LC_LOAD_DYLIB paths using otool
local load_dylibs=$(otool -L "$dylib_file" | grep -v "$dylib_file" | awk '{print $1}')
for path in $load_dylibs; do
if [[ $path != /usr/lib* && $path != /System/* ]]; then
# For paths not excluded, replace the prefix with @loader_path/
local lib_name="${path##*/}"
local new_path="${path_prefix}${lib_name}"
echo "Updating $path to $new_path"
# Use install_name_tool to change the path
install_name_tool -change "$path" "$new_path" "$dylib_file"
codesign -fs- "$dylib_file"
fi
done
}
export -f update_dylib_paths
find Libraries/Wine/lib -maxdepth 1 -type f -name '*.dylib' -exec bash -c 'update_dylib_paths "$0" "@loader_path/"' {} \;
find Libraries/Wine/lib/gstreamer-1.0 -maxdepth 1 -type f -name '*.dylib' -exec bash -c 'update_dylib_paths "$0" "@loader_path/../"' {} \;
update_dylib_paths Libraries/Wine/lib/wine/x86_64-unix/winegstreamer.so "@rpath/"
- name: Install GPTK
run: |
ditto GPTK/redist/lib/ Libraries/Wine/lib/
- name: Copy Version .plist
run: |
cp -a WhiskyWineVersion.plist Libraries/
- name: Install WineMono
run: |
mkdir Libraries/Wine/share/wine/mono
curl -L -o mono.tar.xz ${{ env.WINE_MONO }}
tar -xzf mono.tar.xz -C Libraries/Wine/share/wine/mono
- name: Build Checksum
run: |
find ./Libraries -type f -exec shasum "{}" + > SUMS.sha
- name: Upload config64.log
if: failure()
uses: actions/upload-artifact@v4
with:
name: config64
path: build/wine64/config.log
- name: Upload config32.log
if: failure()
uses: actions/upload-artifact@v4
with:
name: config32
path: build/wine32on64/config.log
- name: Tar Libraries
if: success()
run: |
tar -zcf Libraries.tar.gz Libraries
- name: Upload Libraries
if: success()
uses: actions/upload-artifact@v4
with:
name: Libraries
path: Libraries.tar.gz
- name: Upload SUMS
if: success()
uses: actions/upload-artifact@v4
with:
name: SUMS
path: SUMS.sha
- name: Upload Libraries to WhiskyBucket
if: ${{ github.ref == 'refs/heads/7.7' }}
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ENV_AUTH: true
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_ENDPOINT }}
run: |
brew install rclone
rclone copy Libraries.tar.gz r2:whisky-bucket/Wine
rclone copy WhiskyWineVersion.plist r2:whisky-bucket/Wine
rclone copy SUMS.sha r2:whisky-bucket/Wine