-
-
Notifications
You must be signed in to change notification settings - Fork 595
281 lines (264 loc) · 12.3 KB
/
mac_deps.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
name: MacOS build dependencies
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 0' # run at 3 AM UTC every Sunday
repository_dispatch:
types: [mac_deps]
jobs:
build:
runs-on: ${{ matrix.runner || 'macos-12' }}
strategy:
fail-fast: false
matrix:
binary_compatibility:
- "darwin_16.x86_64" # macOS 10.12, the earliest version supported by QT 5.13
- "darwin_17.x86_64" # macOS 10.13, the earliest version supported by QT 5.15
- "darwin_18.x86_64" # macOS 10.14, the earliest version supported by QT 6.4
#- "darwin_20.arm64" # macOS 11, the earliest ARM64 version; temporarily no upstream binary packages
- "darwin_21.arm64" # macOS 12, the earliest ARM64 version we have MacPorts binary packages for
include:
# this list is meant to be synchronized with mac_release.yml
- common_pkgs:
- brotli 1.1.0_0
- dbus 1.14.10_1
- double-conversion 3.3.0_0
- freetype 2.13.2_0
- gettext-runtime 0.22.5_0
- giflib 4.2.3_1
- glib2 2.78.4_1+x11
- graphite2 1.3.14_0
- harfbuzz 8.5.0_0
- icu 74.2_0
- jasper 4.2.4_0
- lcms2 2.16_0
- lerc 4.0.0_1
- lz4 1.10.0_0
- libdeflate 1.20_0
- libedit 20240517-3.1_0
- libffi 3.4.6_1
- libiconv 1.17_0
- libjpeg-turbo 3.0.3_0
- libmng 2.0.3_1
- libpng 1.6.43_0
- ncurses 6.5_0
- openssl3 3.3.1_1
- pcre 8.45_0
- pcre2 10.44_0
- python39 3.9.19_0+lto+optimizations
- tcl 8.6.14_0+corefoundation+threads
- tiff 4.6.0_0
- webp 1.4.0_0
- xz 5.4.7_0
- zlib 1.3.1_0
- zstd 1.5.6_0
host_pkgs:
- ccache 4.10.2_0+doc
- hiredis 1.2.0_0
- binary_compatibility: darwin_21.arm64
pkgs:
- qt5-qtbase 5.15.12_1+openssl
- qt5-qtdeclarative 5.15.12_0
- qt5-qtimageformats 5.15.12_0
- qt5-qtscript 5.15.12_0
- qt5-qtsvg 5.15.12_0
- qt5-qttools 5.15.12_0
- libb2 0.98.1_1
- md4c 0.4.8_0
- qt6-qtbase 6.4.3_6+openssl
- qt6-qtdeclarative 6.4.3_0
- qt6-qtimageformats 6.4.3_0
- qt6-qtsvg 6.4.3_1
- qt6-qttools 6.4.3_1
- qt6-qt5compat 6.4.3_2
runner: macos-14
runner_binary_compatibility: darwin_23.arm64
- binary_compatibility: darwin_18.x86_64
pkgs:
- libb2 0.98.1_1
- md4c 0.4.8_0
- qt6-qtbase 6.4.3_6+openssl
- qt6-qtdeclarative 6.4.3_0
- qt6-qtimageformats 6.4.3_0
- qt6-qtsvg 6.4.3_1
- qt6-qttools 6.4.3_1
- qt6-qt5compat 6.4.3_2
qmake_flags: ""
runner_binary_compatibility: darwin_21.x86_64
- binary_compatibility: darwin_17.x86_64
pkgs:
- qt5-qtbase 5.15.12_1+openssl
- qt5-qtdeclarative 5.15.12_0
- qt5-qtimageformats 5.15.12_0
- qt5-qtscript 5.15.12_0
- qt5-qtsvg 5.15.12_0
- qt5-qttools 5.15.12_0
qmake_flags: ""
runner_binary_compatibility: darwin_21.x86_64
- binary_compatibility: darwin_16.x86_64
cflags: -arch x86_64
add_variants: ""
dmg_postfix: "-macos10.12"
pkgs:
- legacy-support 1.2.4_0
- qt513-qtbase 5.13.2_10+openssl
- qt513-qtdeclarative 5.13.2_0
- qt513-qtimageformats 5.13.2_3
- qt513-qtscript 5.13.2_0
- qt513-qtsvg 5.13.2_0
- qt513-qttools 5.13.2_0
qmake_flags: ""
runner_binary_compatibility: darwin_21.x86_64
steps:
- name: Restore distfiles packages cache
id: cache-distfiles
uses: actions/cache/restore@v4
with:
path: distfiles
key: distfiles-${{ matrix.binary_compatibility }}--${{ github.sha }}
restore-keys: distfiles-${{ matrix.binary_compatibility }}--
- name: Fetch distfiles
run: |
mkdir -p distfiles
fetch_binpkg() {
local _compat="$1"; shift
while [ -n "$1" ]; do
local _name="$1"
local _postfix="$2"
local _url="https://packages.macports.org/$_name/$_name-$_postfix.$_compat.tbz2"
shift 2
case " $*" in *" $_name "*_) echo "$_name: Skipping as an override follows" 1>&2; continue ;; esac
_file="distfiles/$(basename "$_url")"
if [ ! -e "$_file" ]; then
echo "Fetching $_url" 1>&2
if ! curl -fsL -o "$_file" "$_url"; then
echo "Fetching $_url failed, skipping" 1>&2
rm -f "$_file"
printf '%s @%s\n' "$_name" "$_postfix"
fi
fi
done
}
_distfiles_count="$(ls distfiles | wc -l)"
_any="no"
fetch_all() {
fetch_binpkg ${{ matrix.runner_binary_compatibility }} ${{ join(matrix.host_pkgs, ' ') }}
fetch_binpkg ${{ matrix.binary_compatibility }} ${{ join(matrix.common_pkgs, ' ') }} ${{ join(matrix.pkgs, ' ') }}
}
_missing="$(fetch_all)"
[ "$(ls distfiles | wc -l)" -eq "$_distfiles_count" ] || _any=yes
tee -a $GITHUB_ENV <<EOF_ENV
UPDATE_DISTFILES_CACHE=$_any
MISSING_PACKAGES<<EOF_VAR
${_missing}
EOF_VAR
EOF_ENV
- name: Install MacPorts
if: env.MISSING_PACKAGES != ''
run: |
wget https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
source ./macports-ci install
case ${{ matrix.binary_compatibility }} in
darwin_16.*) echo "macosx_deployment_target 10.12" ;;
darwin_17.*) echo "macosx_deployment_target 10.13" ;;
darwin_18.*) echo "macosx_deployment_target 10.14" ;;
darwin_19.*) echo "macosx_deployment_target 10.15" ;;
darwin_20.*) echo "macosx_deployment_target 11.0" ;;
darwin_21.*) echo "macosx_deployment_target 11.0" ;;
esac | sudo tee -a /opt/local/etc/macports/macports.conf
- name: Install missing packages except Qt
if: env.MISSING_PACKAGES != ''
run: |
set -x
prettify() { sed 's/^---> /::group::&/'; }
case "$MISSING_PACKAGES" in *ccache*)
sudo port -Nkv install ccache | prettify
esac
# Try to install what's possible to install from binary packages
OUR_PYTHON="$(echo "${{join(matrix.common_pkgs, fromJSON('"\n"')) }}" | awk '/^python3/ { print $1 }')"
case "$MISSING_PACKAGES" in *"$OUR_PYTHON"*)
echo "::group::Installing $OUR_PYTHON"
sudo port -Nkv install "$OUR_PYTHON" | prettify
sudo port -Nkv install python_select python3_select | prettify
sudo port select --set python "$OUR_PYTHON"
sudo port select --set python3 "$OUR_PYTHON"
echo "::endgroup::"
;;
esac
case "$MISSING_PACKAGES" in *gettext-runtime*)
echo "::group::Installing gettext-runtime"
sudo port -Nkv install gettext-runtime | prettify
echo "::endgroup::"
;;
esac
case "$MISSING_PACKAGES" in *glib2*)
echo "::group::Installing glib2"
sudo port -Nkv install glib2 | prettify # our and cairo's dependency, +x11 is the default
echo "::endgroup::"
;;
esac
case "$MISSING_PACKAGES" in *harfbuzz*)
echo "::group::Installing harfbuzz dependencies"
sudo port -Nk install python310 | prettify # fontconfig seems to need it badly
sudo port -Nkv install cairo -x11 | prettify # skip x11 dependencies
echo "::endgroup::"
;;
esac
_the_rest="$(echo "$MISSING_PACKAGES" | grep -v '^qt5-')"
[ -z "$_the_rest" ] || {
echo "::group::Installing $_the_rest"
sudo port -Nkv install $_the_rest | prettify
echo "::endgroup::"
}
- name: Install missing Qt packages except qt5-qttools
if: env.MISSING_PACKAGES != ''
run: |
set -x
prettify() { sed 's/^---> /::group::&/'; }
_the_rest="$(echo "$MISSING_PACKAGES" | grep '^qt5-' | grep -v '^qt5-qttools' || true)"
[ -z "$_the_rest" ] || sudo port -Nkv install $_the_rest | prettify
- name: Install missing qt5-qttools
if: env.MISSING_PACKAGES != ''
run: |
set -x
prettify() { sed 's/^---> /::group::&/'; }
case "$MISSING_PACKAGES" in *qt5-qttools*)
sudo port -Nkv install qt5-qttools | prettify
;;
esac
- name: Prepare distfiles cache
if: always() && env.MISSING_PACKAGES != ''
run: |
set -x
# Save any new wanted distfiles
_any=""
while read -r _package _version; do
_package_path="/opt/local/var/macports/software/$_package/$_package-${_version#@}"
ls -l "${_package_path%/*}/" || true
for _fullname in $(ls $_package_path.*.tbz2 2>/dev/null || true); do
_any=1
if ! echo '${{ matrix.host_pkgs }}' | grep -q "$_package"; then
if [ ${{ matrix.binary_compatibility }} != ${{ matrix.runner_binary_compatibility }} ]; then
case "$_fullname" in *.${{ matrix.runner_binary_compatibility }}*)
_newname="${_fullname%.${{ matrix.runner_binary_compatibility }}.tbz2}.${{ matrix.binary_compatibility }}.tbz2"
if [ ! -f "$_newname" ]; then
echo "::warning::Package $_fullname is named after runner architecture, renaming to ${_newname##*/}"
cp "$_fullname" distfiles/"${_newname##*/}"
continue
fi
;;
esac
fi
fi
cp "$_fullname" distfiles/
done
done <<EOF
$MISSING_PACKAGES
EOF
[ -z "$_any" ] || echo "UPDATE_DISTFILES_CACHE=yes" >> $GITHUB_ENV
- name: Save distfiles cache
if: always() && env.UPDATE_DISTFILES_CACHE == 'yes'
uses: actions/cache/save@v4
with:
path: distfiles
key: ${{ steps.cache-distfiles.outputs.cache-primary-key }}-${{ env.CACHE_TIMESTAMP }}