Skip to content

Commit

Permalink
cabal: Fix sphinx bug in User Manual creation
Browse files Browse the repository at this point in the history
  • Loading branch information
essandess authored and kencu committed Jan 15, 2023
1 parent d1cb741 commit 2509f25
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lang/cabal/Portfile
Expand Up @@ -4,7 +4,7 @@ PortSystem 1.0

name cabal
version 3.8.1.0
revision 1
revision 2
categories lang haskell devel
platforms darwin
license BSD
Expand Down Expand Up @@ -148,6 +148,13 @@ if {${name} eq ${subport}} {
delete ${haskell_cabal.cabal_root}/bin/ghc-pkg
}

# https://trac.macports.org/ticket/66680#comment:12
# please remove afer this this sphinx issue is fixed:
# https://github.com/haskell/cabal/issues/8681
# diff -NaurdwB ./cabal-orig/doc/conf.py ./cabal-new/doc/conf.py | sed -E -e 's/\.\/cabal-(orig|new)/\./' | sed -E -e 's|/opt/local|@PREFIX@|g' > ~/Downloads/patch-doc_conf_py.diff
patchfiles-append \
patch-doc_conf_py.diff

haskell_cabal.env \
"CABAL_CONFIG=${haskell_cabal.cabal_root}/config" \
"GHC=${prefix}/bin/ghc"
Expand Down Expand Up @@ -183,6 +190,7 @@ if {${name} eq ${subport}} {
}

subport cabal-prebuilt {
revision 1
supported_archs arm64 x86_64

use_configure no
Expand Down
19 changes: 19 additions & 0 deletions lang/cabal/files/patch-doc_conf_py.diff
@@ -0,0 +1,19 @@
--- ./doc/conf.py 2023-01-15 15:54:29
+++ ./doc/conf.py 2023-01-15 15:57:09
@@ -28,12 +28,12 @@

# extlinks -- see http://www.sphinx-doc.org/en/stable/ext/extlinks.html
extlinks = {
- 'issue': ('https://github.com/haskell/cabal/issues/%s', '#'),
+ 'issue': ('https://github.com/haskell/cabal/issues/%s', '#%s'),

- 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', ''),
- 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #'),
+ 'ghc-wiki': ('https://gitlab.haskell.org/ghc/ghc/-/wikis/%s', None),
+ 'ghc-ticket': ('https://gitlab.haskell.org/ghc/ghc/-/issues/%s', 'GHC #%s'),

- 'hackage-pkg': ('http://hackage.haskell.org/package/%s', ''),
+ 'hackage-pkg': ('http://hackage.haskell.org/package/%s', None),
}

# General information about the project.

0 comments on commit 2509f25

Please sign in to comment.