forked from wine-mirror/wine
-
Notifications
You must be signed in to change notification settings - Fork 13
200 lines (169 loc) · 6.22 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
name: Build Wine
on:
push:
branches:
- '7.7'
workflow_dispatch:
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install Homebrew Packages
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: Build Environment Varrables
run: |
HOMEBREW_PATH=$(brew --prefix)
PACKAGES=(
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
)
LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS"
# Create environment
for PACKAGE in ${PACKAGES[@]}; do
LDFLAGS="-L$HOMEBREW_PATH/opt/$PACKAGE/lib $LDFLAGS"
CFLAGS="-I$HOMEBREW_PATH/opt/$PACKAGE/include $CPPFLAGS"
done
# Additional flags
LDFLAGS="-Wl,-rpath,$HOMEBREW_PATH/lib $LDFLAGS"
LDFLAGS="-Wl,-rpath,@executable_path/../lib/external $LDFLAGS"
CFLAGS="-O3 -Wno-deprecated-declarations -Wno-incompatible-pointer-types $CFLAGS"
# Return the environment
echo "LDFLAGS="$LDFLAGS" >> $GITHUB_ENV
echo "CPPFLAGS="$CPPFLAGS" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV
- name: Create the Build Directory
run: |
BUILD_DIR="$GITHUB_WORKSPACE/build"
WINE_FINAL_DIR="$BUILD_DIR/wine"
WINE64_BUILD_DIR="$BUILD_DIR/wine64"
DXVK_BUILD_DIR="$BUILD_DIR/dxvk"
WINETRICKS_DATA_DIR="$BUILD_DIR/winetricks"
FINAL_DIR="$BUILD_DIR/Libraries"
OUTPUT_DIR="$BUILD_DIR/Output"
mkdir -p $WINE_FINAL_DIR
mkdir -p $WINE64_BUILD_DIR
mkdir -p $DXVK_BUILD_DIR
mkdir -p $WINETRICKS_DATA_DIR
mkdir -p $FINAL_DIR
echo "BUILD_DIR="$BUILD_DIR" >> $GITHUB_ENV
echo "WINE_FINAL_DIR="$WINE_FINAL_DIR" >> $GITHUB_ENV
echo "WINE64_BUILD_DIR="$WINE64_BUILD_DIR" >> $GITHUB_ENV
echo "DXVK_BUILD_DIR="$DXVK_BUILD_DIR" >> $GITHUB_ENV
echo "FINAL_DIR="$FINAL_DIR" >> $GITHUB_ENV
- name: Set Variables
run: |
WINE_CONFIGURE_FLAGS=(
"--disable-option-checking"
"--disable-tests"
"--enable-win64"
"--prefix=$WINE_FINAL_DIR"
"--without-alsa"
"--without-capi"
"--with-coreaudio" # Required Package: NONE - Built-in
"--with-cups" # Required Package: NONE - Built-in
"--without-dbus"
"--without-fontconfig"
"--with-freetype" # Required Package: freetype - Homebrew
"--with-gettext" # Required Package: gettext - Homebrew
"--without-gettextpo"
"--without-gphoto"
"--with-gnutls" # Required Package: gnutls - Homebrew
"--without-gssapi"
"--with-gstreamer" # Required Package: gstreamer - Homebrew
"--without-krb5"
"--with-mingw" # Required Package: mingw-w64 - Homebrew
"--without-netapi"
"--with-opencl" # Required Package: none - Built-in
"--with-opengl" # Required Package: none - Built-in
"--without-oss"
"--with-pcap" # Required Package: none - Built-in
"--with-pthread" # Required Package: none - Built-in
"--without-pulse"
"--without-sane"
"--with-sdl" # Required Package: sdl2 - Homebrew
"--without-udev"
"--with-unwind" # Required Package: None - Built-in
"--without-usb"
"--without-v4l2"
"--with-vulkan" # Required Package: molten-vk - Homebrew
"--without-x"
)
echo "WINE_CONFIGURE_FLAGS=${WINE_CONFIGURE_FLAGS[@]}" >> $GITHUB_ENV
- name: Build Wine64
run: |
cd $WINE64_BUILD_DIR
$GITHUB_WORKSPACE/configure ${WINE_CONFIGURE_FLAGS[@]}
make -j$(sysctl -n hw.logicalcpu)
if [ $? -ne 0 ]; then
echo "Failed to build Wine64... Exiting."
exit 1
fi
make install-lib
- name: Install DXVK
run: |
cd $DXVK_BUILD_DIR
DXVK_URL=$(curl -s https://api.github.com/repos/Gcenx/DXVK-MacOS/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("dxvk-macOS")) | .browser_download_url')
curl -L -o dxvk.tar.gz $DXVK_URL
tar -xzf dxvk.tar.gz --strip-components=1 -C $DXVK_BUILD_DIR
rm dxvk.tar.gz
- name: Grab Verbs From Winetricks
run: |
cd $WINETRICKS_DATA_DIR
curl -L -o verbs.txt https://raw.githubusercontent.com/Winetricks/winetricks/master/files/verbs/all.txt
- name: Copy Files
run: |
cd $FINAL_DIR
mkdir -p wine
cp -r $WINE_FINAL_DIR/* wine
mkdir -p dxvk
cp -r $DXVK_BUILD_DIR/dxvk DXVK
cp -a $(brew --prefix winetricks)/bin/winetricks /
cp $WINETRICKS_DATA_DIR/verbs.txt verbs.txt
- name: Homebrew Libs [DEBUG]
run: |
ls $(brew --prefix)/lib
- name: Zip Everything [DEBUG]
run: |
zip -r -j Everything.zip $GITHUB_WORKSPACE/*
- name: Create Archive
run: |
cd $OUTPUT_DIR
tar -zcf Libraries.tar.gz $FINAL_DIR
- name: Upload Everything
uses: actions/upload-artifact@v4
with:
name: Everything
path: Everything.zip
- name: Upload Libraries [DEBUG]
uses: actions/upload-artifact@v4
with:
name: Libraries
path: $OUTPUT_DIR/Libraries.tar.gz