mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
ci: Only build gobject-introspection if the system version is too old
We want to build GLib against a matched version of gobject-introspection, and this version will probably be bumped quite often as the two are developed in tandem. However, if the CI system provides a newer version, we should probably use that, otherwise we’re essentially downgrading part of the OS on the CI system, and that probably will result in issues. In particular, gobject-introspection <1.82 has a bug on MSYS2 which means it doesn’t build (see issue #3464). So, build gobject-introspection manually if the CI system version is too old, otherwise use the system version. Do this programmatically so we don’t have to repeatedly add and remove the gobject-introspection build commands from the CI configuration as versions are bumped. Fixes: #3464
This commit is contained in:
parent
303f04286e
commit
96652e7def
@ -108,10 +108,16 @@ variables:
|
||||
|
||||
.build-gobject-introspection:
|
||||
before_script:
|
||||
- mkdir -p gobject-introspection
|
||||
- git clone --branch $GOBJECT_INTROSPECTION_TAG https://gitlab.gnome.org/GNOME/gobject-introspection.git gobject-introspection
|
||||
- meson gobject-introspection gobject-introspection/build --prefix=/usr
|
||||
- sudo meson install -C gobject-introspection/build
|
||||
# If the CI image doesn’t provide a new enough gobject-introspection
|
||||
# package, build it ourselves.
|
||||
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3746#note_2161354
|
||||
- >
|
||||
if ! pkg-config --atleast-version "${GOBJECT_INTROSPECTION_TAG}" gobject-introspection-1.0; then
|
||||
mkdir -p gobject-introspection
|
||||
git clone --branch $GOBJECT_INTROSPECTION_TAG https://gitlab.gnome.org/GNOME/gobject-introspection.git gobject-introspection
|
||||
meson gobject-introspection gobject-introspection/build --prefix=/usr
|
||||
sudo meson install -C gobject-introspection/build
|
||||
fi
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
paths:
|
||||
|
@ -34,10 +34,15 @@ PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
||||
DIR="$(pwd)"
|
||||
export PATH CFLAGS
|
||||
|
||||
mkdir -p gobject-introspection
|
||||
git clone --branch "${GOBJECT_INTROSPECTION_TAG}" https://gitlab.gnome.org/GNOME/gobject-introspection.git gobject-introspection
|
||||
meson gobject-introspection gobject-introspection/build --prefix "/c/msys64/${MSYSTEM}/usr"
|
||||
meson install -C gobject-introspection/build
|
||||
# If msys2 doesn’t provide a new enough gobject-introspection package, build it
|
||||
# ourselves.
|
||||
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3746#note_2161354
|
||||
if [[ $(vercmp "$(pacman -Qi "${MINGW_PACKAGE_PREFIX}"-gobject-introspection | grep -Po '^Version\s*: \K.+')" "${GOBJECT_INTROSPECTION_TAG}") -lt 0 ]]; then
|
||||
mkdir -p gobject-introspection
|
||||
git clone --branch "${GOBJECT_INTROSPECTION_TAG}" https://gitlab.gnome.org/GNOME/gobject-introspection.git gobject-introspection
|
||||
meson gobject-introspection gobject-introspection/build --prefix "/c/msys64/${MSYSTEM}/usr"
|
||||
meson install -C gobject-introspection/build
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user