void-packages/srcpkgs/ghc/patches/sphinx-unicode.patch
J Farkas c74ff7e542 ghc: allow building with current Sphinx
./srcpkg build ghc fails with current tools:

"inplace/bin/ghc-stage1" [...] /build/cbits/longlong.p_o
Running Sphinx v4.0.2

Configuration error:
There is a syntax error in your configuration file: (unicode error) 'unicodeescape' codec can't decode bytes in position 1-2: truncated \uXXXX escape (conf.py, line 87)

...
make: *** [Makefile:128: all] Error 2

According to https://gitlab.haskell.org/ghc/ghc/-/issues/19962

>> This fix is to use raw strings, as already done in master:
>> https://gitlab.haskell.org/ghc/ghc/-/blob/master/docs/users_guide/conf.py#L96

Sanitized from commit (only small parts apply)
83407ffc7a
2021-07-20 17:07:21 -03:00

17 lines
569 B
Diff

diff -rpU2 ghc-8.8.4-orig/docs/users_guide/conf.py ghc-8.8.4/docs/users_guide/conf.py
--- ghc-8.8.4-orig/docs/users_guide/conf.py 2020-07-08 16:43:03.000000000 +0000
+++ ghc-8.8.4/docs/users_guide/conf.py 2021-07-10 20:25:33.536928487 +0000
@@ -78,5 +78,5 @@ latex_elements = {
'inputenc': '',
'utf8extra': '',
- 'preamble': '''
+ 'preamble': r'''
\usepackage{fontspec}
\usepackage{makeidx}
@@ -84,5 +84,5 @@ latex_elements = {
\setromanfont{DejaVu Serif}
\setmonofont{DejaVu Sans Mono}
-\setlength{\\tymin}{45pt}
+\setlength{\tymin}{45pt}
''',
}