FROM rockylinux/rockylinux:9
RUN yum install -y \
	gcc \
	gettext \
	make \
	python3-devel \
	rpm-build \
	tar

# For creating repo meta data
RUN yum install -y createrepo

# Enable more packages
RUN yum install 'dnf-command(config-manager)' -y
RUN yum config-manager --set-enabled crb

# THg GUI dependencies
RUN yum install -y \
	dejavu-sans-fonts \
	dejavu-sans-mono-fonts \
	python3-qt5-devel \
	python3-iniparse

# THg tests dependencies
RUN yum install -y python3-pip && \
	pip3 install nose

# Qscintilla
RUN pip3 install QScintilla

# RPM build dependencies
RUN yum install -y \
	desktop-file-utils \
	python3-sphinx

# Install rust for rust-based optimizations
RUN yum install -y cargo

# Install Mercurial (so it can be called in our scripts)
RUN pip3 install mercurial --global-option="--rust"

# Install libffi-devel for pygit2
RUN yum install -y libffi-devel

# Install libgit2 to allow usage of pygit2
RUN yum install -y git openssl-devel && \
    mkdir /libgit2 && \
    git clone -b v1.5.0 https://github.com/libgit2/libgit2.git /libgit2 && \
    mkdir /libgit2/build && cd /libgit2/build && cmake .. && cmake --build . --target install

# wish is needed for Mercurial
RUN yum install tk -y
