From c149b76c5a6b3dbc5155b10e85e901e53e1fc998 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sat, 16 Feb 2019 01:30:47 +0800 Subject: [PATCH] add upstream fix for sphinx-1.8 --- ghc-sphinx-1.8-4eebc8016.patch | 46 ++++++++++++++++++++++++++++++++++ ghc.spec | 5 ++++ 2 files changed, 51 insertions(+) create mode 100644 ghc-sphinx-1.8-4eebc8016.patch diff --git a/ghc-sphinx-1.8-4eebc8016.patch b/ghc-sphinx-1.8-4eebc8016.patch new file mode 100644 index 0000000..155be14 --- /dev/null +++ b/ghc-sphinx-1.8-4eebc8016.patch @@ -0,0 +1,46 @@ +commit 4eebc8016f68719e1ccdf460754a97d1f4d6ef05 +Author: Ben Gamari +Date: Thu Sep 20 08:27:37 2018 -0400 + + users-guide: Fix build with sphinx 1.8 + + It seems that both add_object_type and add_directive_to_domain both register a + directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it + crashes with an exception. + +diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py +index a70f7fef1e..284b5e06cc 100644 +--- a/docs/users_guide/flags.py ++++ b/docs/users_guide/flags.py +@@ -48,6 +48,8 @@ from docutils import nodes + from docutils.parsers.rst import Directive, directives + from sphinx import addnodes + from sphinx.domains.std import GenericObject ++from sphinx.domains import ObjType ++from sphinx.roles import XRefRole + from sphinx.errors import SphinxError + from utils import build_table_from_list + +@@ -599,14 +601,20 @@ def purge_flags(app, env, docname): + ### Initialization + + def setup(app): ++ # Yuck: We can't use app.add_object_type since we need to provide the ++ # Directive instance ourselves. ++ std_object_types = app.registry.domain_object_types.setdefault('std', {}) + + # Add ghc-flag directive, and override the class with our own +- app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag) ++ app.add_role_to_domain('std', 'ghc-flag', XRefRole()) ++ std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + + # Add extension directive, and override the class with our own +- app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension) ++ app.add_role_to_domain('std', 'extension', XRefRole()) ++ std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') ++ + # NB: language-extension would be misinterpreted by sphinx, and produce + # lang="extensions" XML attributes + diff --git a/ghc.spec b/ghc.spec index 0099070..ea83881 100644 --- a/ghc.spec +++ b/ghc.spec @@ -58,7 +58,10 @@ Patch1: ghc-gen_contents_index-haddock-path.patch Patch2: ghc-Cabal-install-PATH-warning.patch # https://github.com/ghc/ghc/pull/143 Patch5: ghc-configure-fix-sphinx-version-check.patch +# https://phabricator.haskell.org/rGHC4eebc8016f68719e1ccdf460754a97d1f4d6ef05 +Patch6: ghc-sphinx-1.8-4eebc8016.patch +# Arch dependent packages Patch12: ghc-armv7-VFPv3D16--NEON.patch # for s390x @@ -276,6 +279,7 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %patch2 -p1 -b .orig %patch5 -p1 -b .orig +%patch6 -p1 -b .orig %if 0%{?fedora} || 0%{?rhel} > 6 rm -r libffi-tarballs @@ -659,6 +663,7 @@ fi - new patches: - 6e361d895dda4600a85e01c72ff219474b5c7190.patch - fix-build-using-unregisterized-v8.2.patch + - ghc-sphinx-1.8-4eebc8016.patch - dropped patch: - D4159.patch - ghc-7.8-arm7_saner-linker-opt-handling-9873.patch