FROM docker.io/library/debian:trixie

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && \
    apt-get install -yqq \
                   git \
                   meson \
                   ninja-build \
                   make \
                   pkg-config \
                   libtool \
                   build-essential \
                   autopoint \
                   gettext \
                   curl \
                   wget \
                   libcurl4-gnutls-dev \
                   libgcrypt-dev \
                   libjansson-dev \
                   libmicrohttpd-dev \
                   libpq-dev \
                   libqrencode-dev \
                   libsodium-dev \
                   libsqlite3-dev \
                   libunistring-dev \
                   uuid-dev \
                   zlib1g-dev \
                   # Test suite dependencies \
                   jq \
                   postgresql \
                   sudo

# Debian packaging tools
RUN apt-get install -yqq \
                   po-debconf \
                   debhelper-compat \
                   devscripts \
                   fakeroot \
                   git-buildpackage

# Documentation generation utils.  The Texinfo manual is built by
# 'make' itself (texinfo/makeinfo), the handbook by Sphinx; the theme
# and the httpdomain extension are vendored in doc/sphinx/_exts/, but
# recommonmark and graphviz are not.
RUN apt-get update -yqq && \
    apt-get install -yqq \
                   texinfo \
                   python3-sphinx \
                   python3-sphinx-rtd-theme \
                   python3-recommonmark \
                   graphviz \
                   # For coverage reports and their upload \
                   lcov \
                   rsync \
   && rm -rf /var/lib/apt/lists/*

# Install Taler (and friends) packages
RUN curl -sS https://deb.taler.net/apt-nightly/taler-trixie-ci.sources \
    | tee /etc/apt/sources.list.d/taler-trixie-ci.sources

RUN echo '\
Package: * \n\
Pin: origin "deb.taler.net" \n\
Pin-Priority: 999' > /etc/apt/preferences.d/taler

# libtalerexchange-dev provides taler-unified-setup.sh, which the reducer
# and IBAN CLI tests use to bring up an exchange, a merchant and a bank.
RUN cat /etc/apt/preferences.d/taler && \
    apt-get update -y && \
    apt-get install -y \
                   libgnunet-dev \
                   libgnunet \
                   gnunet \
                   libtalerexchange-dev \
                   libtalerexchange \
                   libtalermerchant-dev \
                   libtalermerchant \
                   taler-exchange \
                   taler-exchange-database \
                   taler-exchange-offline \
                   taler-auditor \
                   taler-merchant \
                   taler-harness \
                   taler-wallet-cli \
                   libeufin-common \
                   libeufin-bank \
                   libeufin-nexus \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /workdir
