summaryrefslogtreecommitdiff
path: root/haskell
diff options
context:
space:
mode:
authorDavid Spencer <idlemoor@slackbuilds.org>2018-11-17 03:25:21 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-11-17 18:42:50 +0700
commit7b9ef071e76253dcd93ed8d08118d03ac5fec7d2 (patch)
tree6624727e79485c301f9d2c8e450f076def4693fb /haskell
parentb78776a9321ec271e8f7f972878dff54f19ea738 (diff)
downloadslackbuilds-7b9ef071e76253dcd93ed8d08118d03ac5fec7d2.tar.gz
haskell/ghc: Fixed build with Sphinx-1.8.
Thanks to Arnaud. Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'haskell')
-rw-r--r--haskell/ghc/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch48
-rw-r--r--haskell/ghc/ghc.SlackBuild7
2 files changed, 54 insertions, 1 deletions
diff --git a/haskell/ghc/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch b/haskell/ghc/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
new file mode 100644
index 0000000000..e330963792
--- /dev/null
+++ b/haskell/ghc/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
@@ -0,0 +1,48 @@
+From 4eebc8016f68719e1ccdf460754a97d1f4d6ef05 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Thu, 20 Sep 2018 08:27:37 -0400
+Subject: [PATCH] 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.
+---
+ docs/users_guide/flags.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py
+index a70f7fef1e0..284b5e06cc1 100644
+--- a/docs/users_guide/flags.py
++++ b/docs/users_guide/flags.py
+@@ -48,6 +48,8 @@
+ 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/haskell/ghc/ghc.SlackBuild b/haskell/ghc/ghc.SlackBuild
index fae2c37322..2d5985a6e8 100644
--- a/haskell/ghc/ghc.SlackBuild
+++ b/haskell/ghc/ghc.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=ghc
VERSION=${VERSION:-8.4.3}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -115,6 +115,11 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Fix build with Sphinx
+# https://phabricator.haskell.org/D5161
+# https://github.com/ghc/ghc/commit/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
+patch -p1 < $CWD/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \