.gitlab-ci.yml 6.86 KB
Newer Older
1
2
# CI setup for FreeType.

3
4
5
6
7
stages:
 - build

# FIXME: Use --werror once warnings are fixed.
variables:
8
  MESON_ARGS: --fatal-meson-warnings --default-library=both
9
10
  MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib

11
.build windows common:
12
13
14
  # TODO: should probably get its own image at some point instead of reusing the GStreamer one
  # See https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry/18035 for latest
  image: "registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2022-07-29.3-main"
15
16
17
18
  stage: 'build'
  tags:
    - 'docker'
    - 'windows'
19
    - '2022'
20
    - 'gstreamer-windows'
21
22
23
24
25
26
27

.build linux common:
  # See
  # https://gitlab.freedesktop.org/freetype/docker-images/container_registry/20896
  image: 'registry.freedesktop.org/freetype/docker-images/debian:latest'
  stage: 'build'

28
29
30
31
32
.build macos common:
  stage: 'build'
  tags:
    - 'gst-macos-11.1'

33
34
.build windows meson:
  extends: '.build windows common'
35
36
37
38
  variables:
    # Make sure any failure in PowerShell scripts is fatal.
    ErrorActionPreference: 'Stop'
    WarningPreference: 'Stop'
39
40
    # Uncomment the following key if you need to pass custom args, as well
    # with the `$env:MESON_ARGS` line in the `script:` blocks.
41
42
43
44
    # MESON_ARGS: >-
    #   -Dfoo=enabled
    #   -Dbar=disabled
  before_script:
45
46
47
    # Update RootCAs in order to access to some sites.
    - certutil -generateSSTFromWU "C:\roots.sst"
    - Import-Certificate -CertStoreLocation "Cert:\LocalMachine\Root" "C:\roots.sst"
48
    # Make sure meson is up to date so we don't need to rebuild the image
49
    # with each release.
50
    - pip3 install -U 'meson==0.59.*'
51
    - pip3 install --upgrade certifi
52
    - pip3 install -U ninja
53
54
55
56
57
58
59
60
61

    # Generate a UWP cross-file in case it's used
    - $PSDefaultParameterValues['Out-File:Encoding'] = 'ASCII'
    - echo "[binaries]" > uwp-crossfile.meson
    - echo "c = 'cl'" >> uwp-crossfile.meson
    - echo "strip = ['true']" >> uwp-crossfile.meson
    - echo "[built-in options]" >> uwp-crossfile.meson
    - echo "c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP', '-DUNICODE', '-D_WIN32_WINNT=0x0A00', '-we4013']" >> uwp-crossfile.meson
    - echo "c_winlibs = ['windowsapp.lib']" >> uwp-crossfile.meson
62
63
64
  script:
    # For some reason, options are separated by newlines instead of spaces,
    # so we have to replace them first.
65
66
67
    #
    # - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
    #
68
69
70
71
    # Gitlab executes PowerShell in docker, but `VsDevCmd.bat` is a batch
    # script.  Environment variables substitutions is done by PowerShell
    # before calling `cmd.exe`, that's why we use `$env:FOO` instead of
    # `%FOO%`.
72
73
74
75
    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH $env:VS_UWP &&
        meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
        meson compile --verbose -C build
        $env:MESON_WINDOWS_TESTS"
76

77
78
79
80
81

# Format of job names:
# <OS> <Build-Tool> <Build-Params> <Architecture> 


82
83
# Windows jobs.

84
windows meson vs2019 amd64:
85
  extends: '.build windows meson'
86
87
  variables:
    ARCH: 'amd64'
88
    MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
89

90
windows meson vs2019 x86:
91
  extends: '.build windows meson'
92
93
  variables:
    ARCH: 'x86'
94
    MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
95

96
windows meson vs2019 amd64 uwp:
97
98
99
100
101
  extends: '.build windows meson'
  variables:
    ARCH: 'amd64'
    VS_UWP: '-app_platform=UWP'
    MESON_ARGS_UWP: '--cross-file uwp-crossfile.meson -Dc_winlibs="windowsapp.lib"'
102

103
104
105
106
107
# Linux Jobs.
#
# Jobs with "libs" in the name force-enable libraries.
# They are disabled for the remaining jobs.

108
109
110
111
112
113
114
115
linux autotools:
  extends: '.build linux common'
  script: |
    ./autogen.sh
    ./configure --with-brotli=no \
                --with-bzip2=no \
                --with-harfbuzz=no \
                --with-png=no \
Anurag Thakur's avatar
Anurag Thakur committed
116
117
                --with-zlib=no \
                CC=gcc
118
119
120
121
122
123
124
125
126
127
128

    make -j$(nproc) && make install

linux autotools libs:
  extends: '.build linux common'
  script: |
    ./autogen.sh
    ./configure --with-brotli=yes \
                --with-bzip2=yes \
                --with-harfbuzz=yes \
                --with-png=yes \
Anurag Thakur's avatar
Anurag Thakur committed
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
                --with-zlib=yes \
                CC=gcc

    make -j$(nproc) && make install

linux autotools libs clang:
  extends: '.build linux common'
  script: |
    ./autogen.sh
    ./configure --with-brotli=yes \
                --with-bzip2=yes \
                --with-harfbuzz=yes \
                --with-png=yes \
                --with-zlib=yes \
                CC=clang
144
145
146
147
148
149

    make -j$(nproc) && make install

linux meson:
  extends: '.build linux common'
  script: |
150
151
    meson setup build ${MESON_ARGS} \
                      -Dbrotli=disabled \
152
153
154
155
156
157
158
159
160
161
162
                      -Dbzip2=disabled \
                      -Dharfbuzz=disabled \
                      -Dpng=disabled \
                      -Dzlib=disabled

    meson compile --verbose -C build
    meson install -C build

linux meson libs:
  extends: '.build linux common'
  script: |
163
164
    meson setup build ${MESON_ARGS} \
                      -Dbrotli=enabled \
165
166
167
168
169
170
171
172
173
174
175
                      -Dbzip2=enabled \
                      -Dharfbuzz=disabled \
                      -Dpng=disabled \
                      -Dzlib=disabled

    meson compile --verbose -C build
    meson install -C build

linux cmake:
  extends: '.build linux common'
  script: |
176
177
178
179
180
    cmake -B build -D FT_DISABLE_BROTLI=TRUE \
                   -D FT_DISABLE_BZIP2=TRUE \
                   -D FT_DISABLE_HARFBUZZ=TRUE \
                   -D FT_DISABLE_PNG=TRUE \
                   -D FT_DISABLE_ZLIB=TRUE
181
182
183
184
185
186

    cmake --build build --target install

linux cmake libs:
  extends: '.build linux common'
  script: |
187
188
189
190
191
    cmake -B build -D FT_REQUIRE_BROTLI=TRUE \
                   -D FT_REQUIRE_BZIP2=TRUE \
                   -D FT_REQUIRE_HARFBUZZ=TRUE \
                   -D FT_REQUIRE_PNG=TRUE \
                   -D FT_REQUIRE_ZLIB=TRUE
192
193

    cmake --build build --target install
194

195
196
197

# MacOS jobs.

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
macos autotools:
  extends: '.build macos common'
  before_script:
    - '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
  script:
    - brew install autoconf automake libtool
    - ./autogen.sh
    - ./configure
    - 'make -j$(sysctl -n hw.logicalcpu)'
    - make install

macos autotools clang:
  extends: '.build macos common'
  before_script:
    - '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
  script:
    - brew install autoconf automake libtool
    - ./autogen.sh
    - './configure CC=clang'
    - 'make -j$(sysctl -n hw.logicalcpu)'
    - make install

macos meson:
  extends: '.build macos common'
  script:
    - pip3 install --upgrade pip
    - pip3 install -U meson
    - pip3 install --upgrade certifi
    - pip3 install -U ninja
227
228

    - meson setup build ${MESON_ARGS}
229
230
    - meson compile --verbose -C build
    - sudo meson install -C build