forked from libass/libass
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (201 loc) · 6.56 KB
/
meson.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
name: Meson CI
on:
push:
branches: [ master, ci ]
pull_request:
branches: [ master ]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: Windows MSVC Release,
os: windows-latest,
msvc: true,
msystem: MINGW64,
shell: 'powershell',
buildtype: release,
args: '-Ddefault_library=static'
}
- {
name: Windows MinGW Release,
os: windows-latest,
msvc: false,
pkgmanager: msys,
msystem: MINGW64,
shell: 'msys2 {0}',
buildtype: debugoptimized,
args: ''
}
- {
name: Ubuntu Debug,
os: ubuntu-latest,
buildtype: debugoptimized,
args: ''
}
- {
name: macOS Debug,
os: macos-latest,
buildtype: debugoptimized,
args: ''
}
defaults:
run:
shell: ${{ matrix.config.shell || 'bash' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Setup MSys2
if: startsWith(matrix.config.os, 'windows')
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: false
- name: Setup MSVC
if: matrix.config.os == 'windows-latest' && matrix.config.msvc == true
uses: ilammy/msvc-dev-cmd@v1
- name: Install MSVC dependecies with choco
if: matrix.config.msvc
run: |
# for whatever reason choco insist on a reboot if it installs meson
choco install ninja nasm python pkgconfiglite
python -m pip install --upgrade pip
pip install meson
- name: Install more MSVC dependecies with msys
if: matrix.config.msvc
shell: 'msys2 {0}'
run: |
pre="$MINGW_PACKAGE_PREFIX"
mkdir pacman-root
ln -s /var pacman-root/var
pacman -r ./pacman-root --noconfirm -S \
$pre-fribidi $pre-freetype $pre-harfbuzz \
$pre-fontconfig $pre-libpng
echo "PKG_CONFIG_PATH=$(cygpath -w "$PWD/pacman-root/mingw64/lib/pkgconfig")" >> "$GITHUB_ENV"
- name: Install dependencies (not MSVC)
if: ${{ !matrix.config.msvc }}
run: |
case "${{ matrix.config.pkgmanager || matrix.config.os }}" in
msys)
pre="$MINGW_PACKAGE_PREFIX"
pacman --noconfirm -S \
$pre-gcc $pre-meson $pre-ninja nasm \
$pre-fribidi $pre-freetype $pre-harfbuzz \
$pre-fontconfig $pre-libpng
;;
macos-*)
brew install nasm ninja pkg-config meson
;;
ubuntu-*)
sudo apt-get update
sudo apt-get install ninja-build build-essential pkg-config nasm \
libfreetype-dev libfontconfig-dev libharfbuzz-dev libfribidi-dev \
python3-pip
# Drop once 24.04 is available in GHA
pip3 install meson
;;
esac
- name: Set up WrapDB
if: matrix.config.pkgmanager == 'choco' || matrix.config.os == 'macos-latest'
run: |
meson wrap update-db
- name: Configure
run: meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}
- name: Build
run: meson compile -C build
- name: Dump Meson Debug Info
if: failure()
run: cat build/meson-logs/meson-log.txt
build-muon:
runs-on: ubuntu-latest
container:
image: alpine:edge
strategy:
fail-fast: false
matrix:
cc: [gcc]
steps:
- name: add testing repo
run: |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
apk update
- name: install deps
run: |
# muon's style lint uses git
apk add nasm ${{ matrix.cc }} musl-dev muon samurai \
freetype-dev fribidi-dev harfbuzz-dev \
fontconfig-dev libpng-dev git
- name: checkout code
uses: actions/checkout@v4
- name: configure
run: |
muon version
muon setup -Dtest=true build
- name: build
run: |
samu -C build
- name: check binary works
run: |
build/test/libass_test /tmp/out.png compare/test/sub1.ass 0.5
- name: lint style (informational)
run: |
# `muon fmt -q` already lets us check _if_ there’d be changes, but
# doesn’t show what would change. `git diff` doesn’t want to work
# (even with increased fetch-depth) either, possibly due to container env
LINT_FILES="$(find . -name "meson.build" | sort)"
for f in $LINT_FILES ; do
cp "$f" "${f}.org"
done
if muon fmt -q $LINT_FILES ; then
echo "ok"
else
muon fmt -i $LINT_FILES
for f in $LINT_FILES ; do
git diff --no-index "${f}.org" "$f" || :
done
# currently formatting rules are being tweaked;
# maybe reformat and fail here after muon 0.3.0 is released
exit 0
fi
- name: validate meson.build
run: |
# our test build above doesn't hit all conditional paths
# for now ignore warnings, only fail on errors
muon analyze
build-from-tarball:
runs-on: ubuntu-latest
container:
# currently GHA’s ubuntu-latest still has a too old meson
image: debian:stable
strategy:
fail-fast: false
matrix:
cc: [gcc]
steps:
- name: install dependencies
run: |
apt-get update #&& sudo apt-get upgrade
apt-get install -y --no-install-recommends \
autoconf automake make libtool \
libfontconfig1-dev libfreetype6-dev libfribidi-dev \
libharfbuzz-dev nasm ${{ matrix.cc }} \
libpng-dev meson ninja-build
- name: checkout code
uses: actions/checkout@v4
- name: setup distdir
run: |
autoreconf -ivf .
./configure
make distdir
ls -ld libass-*
- name: meson build in distdir
run: |
cd libass-*/
meson setup build
ninja -C build
DESTIDR="$PWD/TEST_INSTALL" ninja -C build install