1
0
Fork 0

ci: Move installation of common dependencies to a separate script

Since we would be building custom images and system extensions, having
a centralize script has the following advantages:

1. Provides a single place to add/bump dependencies.
2. Allows us to automatically stop building dependencies for
   GNOME OS that has been updated to a recent-enough version.

See https://discourse.gnome.org/t/towards-a-better-way-to-hack-and-test-your-system-components/21075
See https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/837

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3843>
This commit is contained in:
Martin Abente Lahaye 2024-07-11 12:07:37 -04:00
parent 8aeb6dc864
commit 0d647bb1d6
2 changed files with 82 additions and 11 deletions

View file

@ -128,21 +128,11 @@ variables:
https://gitlab.gnome.org/jadahl/catch.git \ https://gitlab.gnome.org/jadahl/catch.git \
main main
./.gitlab-ci/install-meson-project.sh \
https://gitlab.freedesktop.org/wayland/wayland.git \
1.23.0
./.gitlab-ci/install-meson-project.sh \ ./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gi-docgen.git \ https://gitlab.gnome.org/GNOME/gi-docgen.git \
main main
./.gitlab-ci/install-meson-project.sh \ ./.gitlab-ci/install-common-dependencies.sh
https://gitlab.freedesktop.org/wayland/wayland-protocols.git \
1.36
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git \
master
rpm -e --nodeps gnome-bluetooth-libs-devel \ rpm -e --nodeps gnome-bluetooth-libs-devel \
mutter mutter-devel \ mutter mutter-devel \

View file

@ -0,0 +1,81 @@
#!/bin/bash
set -e
usage() {
cat <<-EOF
Usage: $(basename $0) [OPTION…]
Install common dependencies to a base image or system extension
Options:
--libdir Setup the projects with a different libdir
--destdir Install the projects to an additional destdir
-h, --help Display this help
EOF
}
TEMP=$(getopt \
--name=$(basename $0) \
--options='' \
--longoptions='libdir:' \
--longoptions='destdir:' \
--longoptions='help' \
-- "$@")
eval set -- "$TEMP"
unset TEMP
OPTIONS=()
while true; do
case "$1" in
--libdir)
OPTIONS+=( --libdir=$2 )
shift 2
;;
--destdir)
OPTIONS+=( --destdir=$2 )
shift 2
;;
-h|--help)
usage
exit 0
;;
--)
shift
break
;;
esac
done
SCRIPTS_DIR="$(dirname $0)"
if ! pkgconf --atleast-version 1.23.0 wayland-server
then
./$SCRIPTS_DIR/install-meson-project.sh \
"${OPTIONS[@]}" \
https://gitlab.freedesktop.org/wayland/wayland.git \
1.23.0
fi
if ! pkgconf --atleast-version 1.36 wayland-protocols
then
./$SCRIPTS_DIR/install-meson-project.sh \
"${OPTIONS[@]}" \
https://gitlab.freedesktop.org/wayland/wayland-protocols.git \
1.36
fi
if ! gsettings get org.gnome.desktop.interface accent-color >/dev/null 2>&1
then
./$SCRIPTS_DIR/install-meson-project.sh \
"${OPTIONS[@]}" \
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git \
master
fi