| 1 | #!/bin/bash |
| 2 | # The following is to disable "info" warnings for the unquoted instandes of $MESON_FLAGS |
| 3 | # in the meson invocations below. We want the shell to actually split $MESON_FLAGS by spaces. |
| 4 | # shellcheck disable=SC2086 |
| 5 | # |
| 6 | # IMPORTANT: See |
| 7 | # https://gnome.pages.gitlab.gnome.org/librsvg/devel-docs/ci.html#container-image-version |
| 8 | |
| 9 | set -o errexit -o pipefail -o noclobber -o nounset |
| 10 | |
| 11 | # See the versions here: |
| 12 | # https://gitlab.gnome.org/GNOME/gnome-build-meta/-/tree/gnome-47/elements/sdk (or later versions) |
| 13 | # https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/tree/master/elements/components |
| 14 | |
| 15 | FREETYPE2_TAG="VER-2-13-3" |
| 16 | FONTCONFIG_TAG="2.17.1" |
| 17 | CAIRO_TAG="1.18.4" |
| 18 | HARFBUZZ_TAG="12.3.2" |
| 19 | PANGO_TAG="1.57.0" |
| 20 | LIBXML2_TAG="v2.15.1" |
| 21 | GDK_PIXBUF_TAG="2.44.5" |
| 22 | |
| 23 | PARSED=$(getopt --options '' --longoptions 'prefix:,meson-flags:' --name "$0" -- "$@") |
| 24 | eval set -- "$PARSED" |
| 25 | unset PARSED |
| 26 | |
| 27 | PREFIX= |
| 28 | MESON_FLAGS= |
| 29 | |
| 30 | while true; do |
| 31 | case "$1" in |
| 32 | '--prefix') |
| 33 | PREFIX=$2 |
| 34 | shift 2 |
| 35 | ;; |
| 36 | |
| 37 | '--meson-flags') |
| 38 | MESON_FLAGS=$2 |
| 39 | shift 2 |
| 40 | ;; |
| 41 | |
| 42 | '--') |
| 43 | shift |
| 44 | break |
| 45 | ;; |
| 46 | |
| 47 | *) |
| 48 | echo "Programming error" |
| 49 | exit 3 |
| 50 | ;; |
| 51 | esac |
| 52 | done |
| 53 | |
| 54 | if [ -z "$PREFIX" ]; then |
| 55 | echo "please specify a --prefix" |
| 56 | exit 1 |
| 57 | fi |
| 58 | |
| 59 | # The following assumes that $PREFIX has been set |
| 60 | source ci/setup-dependencies-env.sh |
| 61 | |
| 62 | cd .. |
| 63 | git clone --depth 1 --branch $FREETYPE2_TAG https://gitlab.freedesktop.org/freetype/freetype |
| 64 | cd freetype |
| 65 | meson setup _build --prefix "$PREFIX" -Dharfbuzz=disabled $MESON_FLAGS |
| 66 | meson compile -C _build |
| 67 | meson install -C _build |
| 68 | |
| 69 | cd .. |
| 70 | git clone --depth 1 --branch $FONTCONFIG_TAG https://gitlab.freedesktop.org/fontconfig/fontconfig |
| 71 | cd fontconfig |
| 72 | meson setup _build --prefix "$PREFIX" $MESON_FLAGS |
| 73 | meson compile -C _build |
| 74 | meson install -C _build |
| 75 | |
| 76 | cd .. |
| 77 | git clone --depth 1 --branch $CAIRO_TAG https://gitlab.freedesktop.org/cairo/cairo |
| 78 | cd cairo |
| 79 | meson setup _build --prefix "$PREFIX" $MESON_FLAGS |
| 80 | meson compile -C _build |
| 81 | meson install -C _build |
| 82 | |
| 83 | cd .. |
| 84 | git clone --depth 1 --branch $HARFBUZZ_TAG https://github.com/harfbuzz/harfbuzz |
| 85 | cd harfbuzz |
| 86 | meson setup _build --prefix "$PREFIX" $MESON_FLAGS |
| 87 | meson compile -C _build |
| 88 | meson install -C _build |
| 89 | |
| 90 | cd .. |
| 91 | git clone --depth 1 --branch $PANGO_TAG https://gitlab.gnome.org/GNOME/pango |
| 92 | cd pango |
| 93 | meson setup _build --prefix "$PREFIX" $MESON_FLAGS |
| 94 | meson compile -C _build |
| 95 | meson install -C _build |
| 96 | |
| 97 | cd .. |
| 98 | git clone --depth 1 --branch $LIBXML2_TAG https://gitlab.gnome.org/GNOME/libxml2 |
| 99 | cd libxml2 |
| 100 | mkdir _build |
| 101 | cd _build |
| 102 | ../autogen.sh --prefix "$PREFIX" --libdir "$PREFIX"/lib64 --without-python |
| 103 | make |
| 104 | make install |
| 105 | |
| 106 | cd .. |
| 107 | git clone --depth 1 --branch $GDK_PIXBUF_TAG https://gitlab.gnome.org/GNOME/gdk-pixbuf |
| 108 | cd gdk-pixbuf |
| 109 | meson setup _build --prefix "$PREFIX" -Dman=false -Dglycin=disabled $MESON_FLAGS |
| 110 | meson compile -C _build |
| 111 | meson install -C _build |