From 1b7335d495476cd52bf55e80aea3679967dc495d Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 24 Jul 2023 21:51:10 +0800 Subject: [PATCH] fix sphinx flags.py: python 3.12 dropped distutils https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922 --- 10922.patch | 37 +++++++++++++++++++++++++++++++++++++ ghc.spec | 4 ++++ 2 files changed, 41 insertions(+) create mode 100644 10922.patch diff --git a/10922.patch b/10922.patch new file mode 100644 index 0000000..ca7da4a --- /dev/null +++ b/10922.patch @@ -0,0 +1,37 @@ +From 2e6447e073144b9b1352d5167f67ccd07460444a Mon Sep 17 00:00:00 2001 +From: Jens Petersen +Date: Thu, 20 Jul 2023 13:16:03 +0800 +Subject: [PATCH] user_guide/flags.py: python-3.12 no longer includes distutils + +packaging.version seems able to handle this fine +--- + docs/users_guide/flags.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py +index f6927d59817..474d1b65d4b 100644 +--- a/docs/users_guide/flags.py ++++ b/docs/users_guide/flags.py +@@ -50,7 +50,7 @@ import sphinx + from sphinx import addnodes + from sphinx.domains.std import GenericObject + from sphinx.errors import SphinxError +-from distutils.version import LooseVersion ++from packaging.version import parse + from utils import build_table_from_list + + import os.path +@@ -628,8 +628,8 @@ def purge_flags(app, env, docname): + + def setup(app): + # The override argument to add_directive_to_domain is only supported by >= 1.8 +- sphinx_version = LooseVersion(sphinx.__version__) +- override_arg = {'override': True} if sphinx_version >= LooseVersion('1.8') else {} ++ sphinx_version = parse(sphinx.__version__) ++ override_arg = {'override': True} if sphinx_version >= parse('1.8') else {} + + # Add ghc-flag directive, and override the class with our own + app.add_object_type('ghc-flag', 'ghc-flag') +-- +GitLab + diff --git a/ghc.spec b/ghc.spec index 945ada6..ee13972 100644 --- a/ghc.spec +++ b/ghc.spec @@ -118,6 +118,9 @@ Patch2: ghc-Cabal-install-PATH-warning.patch Patch3: ghc-gen_contents_index-nodocs.patch # https://gitlab.haskell.org/ghc/ghc/-/issues/23286 (sphinx modern extlinks) Patch9: https://gitlab.haskell.org/ghc/ghc/-/commit/00dc51060881df81258ba3b3bdf447294618a4de.patch +# distutils gone in python 3.12 +# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922 +Patch8: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10922.patch # https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 # https://gitlab.haskell.org/ghc/ghc/-/issues/19684 @@ -448,6 +451,7 @@ Installing this package causes %{name}-*-prof packages corresponding to %patch -P2 -p1 -b .orig %patch -P9 -p1 -b .orig +%patch -P8 -p1 -b .orig %patch -P10 -p1 -b .orig %patch -P11 -p1 -b .orig11