• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# CI setup for FreeType.
2
3stages:
4 - build
5
6# FIXME: Use --werror once warnings are fixed.
7variables:
8  MESON_ARGS: --fatal-meson-warnings --default-library=both
9  MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
10
11.build windows common:
12  # TODO: should probably get its own image at some point instead of reusing the GStreamer one
13  # See https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry/18035 for latest
14  image: "registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2022-07-29.3-main"
15  stage: 'build'
16  tags:
17    - 'docker'
18    - 'windows'
19    - '2022'
20    - 'gstreamer-windows'
21
22.build linux common:
23  # See
24  # https://gitlab.freedesktop.org/freetype/docker-images/container_registry/20896
25  image: 'registry.freedesktop.org/freetype/docker-images/debian:latest'
26  stage: 'build'
27
28.build macos common:
29  stage: 'build'
30  tags:
31    - 'gst-macos-11.1'
32
33.build windows meson:
34  extends: '.build windows common'
35  variables:
36    # Make sure any failure in PowerShell scripts is fatal.
37    ErrorActionPreference: 'Stop'
38    WarningPreference: 'Stop'
39    # Uncomment the following key if you need to pass custom args, as well
40    # with the `$env:MESON_ARGS` line in the `script:` blocks.
41    # MESON_ARGS: >-
42    #   -Dfoo=enabled
43    #   -Dbar=disabled
44  before_script:
45    # Update RootCAs in order to access to some sites.
46    - certutil -generateSSTFromWU "C:\roots.sst"
47    - 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    # Generate a UWP cross-file in case it's used
55    - $PSDefaultParameterValues['Out-File:Encoding'] = 'ASCII'
56    - echo "[binaries]" > uwp-crossfile.meson
57    - echo "c = 'cl'" >> uwp-crossfile.meson
58    - echo "strip = ['true']" >> uwp-crossfile.meson
59    - echo "[built-in options]" >> uwp-crossfile.meson
60    - echo "c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP', '-DUNICODE', '-D_WIN32_WINNT=0x0A00', '-we4013']" >> uwp-crossfile.meson
61    - echo "c_winlibs = ['windowsapp.lib']" >> uwp-crossfile.meson
62  script:
63    # For some reason, options are separated by newlines instead of spaces,
64    # so we have to replace them first.
65    #
66    # - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
67    #
68    # Gitlab executes PowerShell in docker, but `VsDevCmd.bat` is a batch
69    # script.  Environment variables substitutions is done by PowerShell
70    # before calling `cmd.exe`, that's why we use `$env:FOO` instead of
71    # `%FOO%`.
72    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH $env:VS_UWP &&
73        meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
74        meson compile --verbose -C build
75        $env:MESON_WINDOWS_TESTS"
76
77
78# Format of job names:
79# <OS> <Build-Tool> <Build-Params> <Architecture>
80
81
82# Windows jobs.
83
84windows meson vs2019 amd64:
85  extends: '.build windows meson'
86  variables:
87    ARCH: 'amd64'
88    MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
89
90windows meson vs2019 x86:
91  extends: '.build windows meson'
92  variables:
93    ARCH: 'x86'
94    MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
95
96windows meson vs2019 amd64 uwp:
97  extends: '.build windows meson'
98  variables:
99    ARCH: 'amd64'
100    VS_UWP: '-app_platform=UWP'
101    MESON_ARGS_UWP: '--cross-file uwp-crossfile.meson -Dc_winlibs="windowsapp.lib"'
102
103# Linux Jobs.
104#
105# Jobs with "libs" in the name force-enable libraries.
106# They are disabled for the remaining jobs.
107
108linux autotools:
109  extends: '.build linux common'
110  script: |
111    ./autogen.sh
112    ./configure --with-brotli=no \
113                --with-bzip2=no \
114                --with-harfbuzz=no \
115                --with-png=no \
116                --with-zlib=no \
117                CC=gcc
118
119    make -j$(nproc) && make install
120
121linux autotools libs:
122  extends: '.build linux common'
123  script: |
124    ./autogen.sh
125    ./configure --with-brotli=yes \
126                --with-bzip2=yes \
127                --with-harfbuzz=yes \
128                --with-png=yes \
129                --with-zlib=yes \
130                CC=gcc
131
132    make -j$(nproc) && make install
133
134linux autotools libs clang:
135  extends: '.build linux common'
136  script: |
137    ./autogen.sh
138    ./configure --with-brotli=yes \
139                --with-bzip2=yes \
140                --with-harfbuzz=yes \
141                --with-png=yes \
142                --with-zlib=yes \
143                CC=clang
144
145    make -j$(nproc) && make install
146
147linux meson:
148  extends: '.build linux common'
149  script: |
150    meson setup build ${MESON_ARGS} \
151                      -Dbrotli=disabled \
152                      -Dbzip2=disabled \
153                      -Dharfbuzz=disabled \
154                      -Dpng=disabled \
155                      -Dzlib=disabled
156
157    meson compile --verbose -C build
158    meson install -C build
159
160linux meson libs:
161  extends: '.build linux common'
162  script: |
163    meson setup build ${MESON_ARGS} \
164                      -Dbrotli=enabled \
165                      -Dbzip2=enabled \
166                      -Dharfbuzz=disabled \
167                      -Dpng=disabled \
168                      -Dzlib=disabled
169
170    meson compile --verbose -C build
171    meson install -C build
172
173linux cmake:
174  extends: '.build linux common'
175  script: |
176    cmake -B build -D FT_DISABLE_BROTLI=TRUE \
177                   -D FT_DISABLE_BZIP2=TRUE \
178                   -D FT_DISABLE_HARFBUZZ=TRUE \
179                   -D FT_DISABLE_PNG=TRUE \
180                   -D FT_DISABLE_ZLIB=TRUE
181
182    cmake --build build --target install
183
184linux cmake libs:
185  extends: '.build linux common'
186  script: |
187    cmake -B build -D FT_REQUIRE_BROTLI=TRUE \
188                   -D FT_REQUIRE_BZIP2=TRUE \
189                   -D FT_REQUIRE_HARFBUZZ=TRUE \
190                   -D FT_REQUIRE_PNG=TRUE \
191                   -D FT_REQUIRE_ZLIB=TRUE
192
193    cmake --build build --target install
194
195
196# MacOS jobs.
197
198macos autotools:
199  extends: '.build macos common'
200  before_script:
201    - '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
202  script:
203    - brew install autoconf automake libtool
204    - ./autogen.sh
205    - ./configure
206    - 'make -j$(sysctl -n hw.logicalcpu)'
207    - make install
208
209macos autotools clang:
210  extends: '.build macos common'
211  before_script:
212    - '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
213  script:
214    - brew install autoconf automake libtool
215    - ./autogen.sh
216    - './configure CC=clang'
217    - 'make -j$(sysctl -n hw.logicalcpu)'
218    - make install
219
220macos meson:
221  extends: '.build macos common'
222  script:
223    - pip3 install --upgrade pip
224    - pip3 install -U meson
225    - pip3 install --upgrade certifi
226    - pip3 install -U ninja
227
228    - meson setup build ${MESON_ARGS}
229    - meson compile --verbose -C build
230    - sudo meson install -C build
231