[PATCH] docker: add rhel9 build support

18 views
Skip to first unread message

Mathias De Mare

unread,
Nov 9, 2023, 10:39:57 AM11/9/23
to thg...@googlegroups.com
# 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

Matt Harbison

unread,
Nov 9, 2023, 12:02:35 PM11/9/23
to TortoiseHg Developers
I have a Rocky 9.2 system.  What do you need tested?

Yuya Nishihara

unread,
Nov 10, 2023, 8:02:36 AM11/10/23
to Mathias De Mare, thg...@googlegroups.com
On Thu, 09 Nov 2023 16:39:30 +0100, Mathias De Mare wrote:
> # 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

Queued for stable, thanks.

Mathias De Mare (Nokia)

unread,
Nov 13, 2023, 3:03:33 AM11/13/23
to thg...@googlegroups.com

Startup would probably be interesting 😊 Since I don’t have such a system yet, I only tested if I could build it.

 

Greetings,

Mathias

 

From: 'Matt Harbison' via TortoiseHg Developers <thg...@googlegroups.com>
Sent: Thursday, November 9, 2023 6:03 PM
To: TortoiseHg Developers <thg...@googlegroups.com>
Subject: [thg-dev] Re: [PATCH] docker: add rhel9 build support

 

 

CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.

 

--
You received this message because you are subscribed to the Google Groups "TortoiseHg Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thg-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thg-dev/6ccb5d75-e5e8-4378-baee-4d18578ded8an%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages