# HG changeset patch
# User Mathias De Mare <
mathias...@nokia.com>
# Date 1672917428 -3600
# Thu Jan 05 12:17:08 2023 +0100
# Branch stable
# Node ID 2d4d4bbd5faeaab71ca079f9fa13f481d8ebe39b
# Parent 7e2f66c6c4052763f95737b68f71556d8d577a97
docker: add rhel9 build support
I don't have a rhel9-based machine at the moment,
so I only tested making the RPM so far.
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -89,3 +89,6 @@ docker-rhel7:
docker-rhel8:
$(MAKE) -C contrib/docker build-thg-rpm PLATFORM=rhel8 EXTRA_RPM_OPTS_TOPLEVEL=--arch-dependent
+
+docker-rhel9:
+ $(MAKE) -C contrib/docker build-thg-rpm PLATFORM=rhel9 EXTRA_RPM_OPTS_TOPLEVEL=--arch-dependent
diff --git a/contrib/docker/rhel8 b/contrib/docker/rhel9
copy from contrib/docker/rhel8
copy to contrib/docker/rhel9
--- a/contrib/docker/rhel8
+++ b/contrib/docker/rhel9
@@ -1,10 +1,9 @@
-FROM rockylinux/rockylinux:8.4
+FROM rockylinux/rockylinux:9
RUN yum install -y \
gcc \
gettext \
make \
python3-devel \
- python3-docutils \
rpm-build \
tar
@@ -13,23 +12,22 @@ RUN yum install -y createrepo
# Enable more packages
RUN yum install 'dnf-command(config-manager)' -y
-RUN yum config-manager --set-enabled powertools
-
-# install this first to make sure we can install python3-qscintilla-qt5 next
-RUN yum install -y epel-release
+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 \
- python3-qscintilla-qt5
+ python3-iniparse
# THg tests dependencies
RUN yum install -y python3-pip && \
pip3 install mock nose
+# Qscintilla
+RUN pip3 install QScintilla
+
# RPM build dependencies
RUN yum install -y \
desktop-file-utils \
@@ -47,7 +45,7 @@ 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.1.1
https://github.com/libgit2/libgit2.git /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
diff --git a/contrib/tortoisehg.spec b/contrib/tortoisehg.spec
--- a/contrib/tortoisehg.spec
+++ b/contrib/tortoisehg.spec
@@ -44,7 +44,7 @@ with a graphical interface.
# (as that directory gets cleared before the install section)
# --> we could consider not doing anything in the build section and instead just do everything in the install section
pip3 install -r %{requirements_txt} --prefix=%{buildroot}%{_prefix}/local/lib/thg-env --ignore-installed
-export PYTHONPATH=%{buildroot}%{_prefix}/local/lib/thg-env/lib/python3.6/site-packages:%{buildroot}%{_prefix}/local/lib/thg-env/lib64/python3.6/site-packages
+export PYTHONPATH=%{buildroot}%{_prefix}/local/lib/thg-env/lib/python%{python3_version}/site-packages:%{buildroot}%{_prefix}/local/lib/thg-env/lib64/python%{python3_version}/site-packages
python3 setup.py build
@@ -62,11 +62,11 @@ echo $RPM_BUILD_ROOT
pip3 install -r %{requirements_txt} --prefix=%{buildroot}%{_prefix}/local/lib/thg-env --ignore-installed
# Mercurial binaries for RHEL are installed using rust support, so let's do the same for Mercurial shipped with Tortoisehg for RHEL
pip3 install mercurial --prefix=%{buildroot}%{_prefix}/local/lib/thg-env --ignore-installed --global-option="--rust"
-export PYTHONPATH=%{buildroot}%{_prefix}/local/lib/thg-env/lib/python3.6/site-packages:%{buildroot}%{_prefix}/local/lib/thg-env/lib64/python3.6/site-packages
+export PYTHONPATH=%{buildroot}%{_prefix}/local/lib/thg-env/lib/python%{python3_version}/site-packages:%{buildroot}%{_prefix}/local/lib/thg-env/lib64/python%{python3_version}/site-packages
python3 setup.py install -O1 --skip-build --root %{buildroot}%{_prefix}/local/lib/thg-env
-cat > %{buildroot}%{_prefix}/local/lib/thg-env/usr/lib/python3.6/site-packages/tortoisehg/util/config.py << EOT
+cat > %{buildroot}%{_prefix}/local/lib/thg-env/usr/lib/python%{python3_version}/site-packages/tortoisehg/util/config.py << EOT
bin_path = "%{_prefix}/local/lib/thg-env/bin"
license_path = "%{_docdir}/%{name}-%{version}/COPYING.txt"
locale_path = "%{_prefix}/local/lib/thg-env/usr/share/locale"
@@ -83,9 +83,9 @@ desktop-file-install --dir=%{buildroot}%
mkdir -p %{buildroot}%{_prefix}/local/bin
cat > %{buildroot}%{_prefix}/local/bin/thg << EOF
#!/bin/sh
-export PYTHONPATH=%{_prefix}/local/lib/thg-env/lib/python3.6/site-packages/:\$PYTHONPATH
-export PYTHONPATH=%{_prefix}/local/lib/thg-env/lib64/python3.6/site-packages/:\$PYTHONPATH
-export PYTHONPATH=%{_prefix}/local/lib/thg-env/usr/lib/python3.6/site-packages/:\$PYTHONPATH
+export PYTHONPATH=%{_prefix}/local/lib/thg-env/lib/python%{python3_version}/site-packages/:\$PYTHONPATH
+export PYTHONPATH=%{_prefix}/local/lib/thg-env/lib64/python%{python3_version}/site-packages/:\$PYTHONPATH
+export PYTHONPATH=%{_prefix}/local/lib/thg-env/usr/lib/python%{python3_version}/site-packages/:\$PYTHONPATH
export PATH=%{_prefix}/local/lib/thg-env/bin:\$PATH
%{_prefix}/local/lib/thg-env/usr/bin/thg "\$@"
EOF