2018-02-22 19:37:16 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-10-29 02:29:38 +02:00
|
|
|
|
set -ex
|
2018-02-22 19:37:16 +01:00
|
|
|
|
|
|
|
|
|
export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
|
|
|
|
|
|
|
|
|
|
pacman --noconfirm -Suy
|
|
|
|
|
|
|
|
|
|
pacman --noconfirm -S --needed \
|
|
|
|
|
base-devel \
|
2020-09-30 11:36:49 +02:00
|
|
|
|
lcov \
|
2022-10-29 02:29:38 +02:00
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-ccache \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-gettext \
|
2024-02-06 17:34:36 +01:00
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-gi-docgen \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-gobject-introspection \
|
2022-10-29 02:29:38 +02:00
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-libffi \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-meson \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-pcre2 \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-python3 \
|
2024-02-06 17:34:36 +01:00
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-python-docutils \
|
2022-10-29 02:29:38 +02:00
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-python-pip \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-toolchain \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-zlib \
|
|
|
|
|
"${MINGW_PACKAGE_PREFIX}"-libelf
|
2018-02-22 19:37:16 +01:00
|
|
|
|
|
2018-07-06 09:33:22 +02:00
|
|
|
|
mkdir -p _coverage
|
2018-02-22 19:37:16 +01:00
|
|
|
|
mkdir -p _ccache
|
2020-02-25 12:46:11 +01:00
|
|
|
|
CCACHE_BASEDIR="$(pwd)"
|
|
|
|
|
CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
|
|
|
|
export CCACHE_BASEDIR CCACHE_DIR
|
|
|
|
|
|
2024-02-15 22:21:52 +01:00
|
|
|
|
pip3 install --upgrade --user packaging==23.2
|
2020-02-25 12:46:11 +01:00
|
|
|
|
|
2020-05-06 21:54:35 +02:00
|
|
|
|
PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
2018-07-06 09:33:22 +02:00
|
|
|
|
DIR="$(pwd)"
|
2020-02-25 12:46:11 +01:00
|
|
|
|
export PATH CFLAGS
|
2018-02-22 19:37:16 +01:00
|
|
|
|
|
2024-02-15 22:30:08 +01:00
|
|
|
|
# FIXME: We can’t use ${MESON_COMMON_OPTIONS} here because this script installs
|
|
|
|
|
# Meson 1.3. See the comment in .gitlab-ci.yml about the same problem on
|
|
|
|
|
# FreeBSD.
|
2023-10-05 16:52:53 +02:00
|
|
|
|
# shellcheck disable=SC2086
|
2024-02-15 22:30:08 +01:00
|
|
|
|
meson setup \
|
|
|
|
|
--buildtype=debug \
|
|
|
|
|
--wrap-mode=nodownload \
|
2024-02-06 17:34:36 +01:00
|
|
|
|
--werror \
|
|
|
|
|
-Ddocumentation=true \
|
|
|
|
|
-Dintrospection=enabled \
|
|
|
|
|
-Dman-pages=enabled \
|
|
|
|
|
_build
|
2022-10-29 04:14:29 +02:00
|
|
|
|
|
2023-08-16 13:57:47 +02:00
|
|
|
|
meson compile -C _build
|
2018-02-22 19:37:16 +01:00
|
|
|
|
|
2022-10-29 04:12:21 +02:00
|
|
|
|
if [[ "$CFLAGS" == *"-coverage"* ]]; then
|
|
|
|
|
lcov \
|
|
|
|
|
--quiet \
|
|
|
|
|
--config-file "${DIR}"/.lcovrc \
|
|
|
|
|
--directory "${DIR}/_build" \
|
|
|
|
|
--capture \
|
|
|
|
|
--initial \
|
|
|
|
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
|
|
|
|
|
fi
|
2018-07-06 09:33:22 +02:00
|
|
|
|
|
2023-08-16 13:57:47 +02:00
|
|
|
|
meson test -C _build -v --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}"
|
|
|
|
|
meson test -C _build -v --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
2022-10-19 20:08:15 +02:00
|
|
|
|
--setup=unstable_tests --suite=failing --suite=flaky || true
|
2018-04-27 17:04:52 +02:00
|
|
|
|
|
2022-10-29 04:12:21 +02:00
|
|
|
|
if [[ "$CFLAGS" == *"-coverage"* ]]; then
|
|
|
|
|
lcov \
|
|
|
|
|
--quiet \
|
|
|
|
|
--config-file "${DIR}"/.lcovrc \
|
|
|
|
|
--directory "${DIR}/_build" \
|
|
|
|
|
--capture \
|
|
|
|
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
|
|
|
|
|
fi
|
2024-02-06 17:34:36 +01:00
|
|
|
|
|
|
|
|
|
# Copy the built documentation to an artifact directory. The build for docs.gtk.org
|
|
|
|
|
# can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md
|
|
|
|
|
mkdir -p _reference/
|
2024-03-13 17:46:06 +01:00
|
|
|
|
mv _build/docs/reference/glib/glib-win32-2.0/ _reference/glib-win32/
|
|
|
|
|
mv _build/docs/reference/gio/gio-win32-2.0/ _reference/gio-win32/
|