# This Containerfile builds the image that we use in all github workflows.
# When this file is changed, or one needs to rebuild the image for another
# reason, bump the `IMAGE_TAG` in the container.yml workflow.

FROM ubuntu:latest

RUN apt update
RUN apt upgrade -y

# Install dependencies
RUN apt install -y --no-install-recommends \
    # build tools
    meson \
    gcc clang \
    ca-certificates \
    git \
    libclang-rt-18-dev \
    # python tools
    python3-pip \
    python-is-python3 \
    # deps
    libglib2.0-dev \
    libjson-glib-dev \
    # testing deps
    python3-gi \
    python3-pytest \
    python3-dbusmock \
    python3-dbus \
    # ci deps
    jq

# Install pre-commit
RUN pip install --user --break-system-packages pre-commit

# Install latest libdex; required because it contains fixes for cancellation
RUN git clone https://gitlab.gnome.org/GNOME/libdex.git && \
    cd libdex && \
    meson setup _build \
      --prefix=/usr \
      --libdir=lib \
      -Dexamples=false \
      -Dtests=false \
      -Dvapi=false \
      -Dintrospection=disabled && \
    meson install -C _build
