summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhololeap <hololeap@protonmail.com>2023-10-08 13:56:47 -0600
committerSam James <sam@gentoo.org>2023-10-14 01:47:05 +0100
commitd53d537ffcafbf92c3d364db95427303ecf6aed1 (patch)
tree924c99b4271540651e716f55de96578c1959cfa1 /dev-lang/ghc
parentdev-lang/ghc: Update PYTHON_COMPAT (diff)
downloadgentoo-d53d537ffcafbf92c3d364db95427303ecf6aed1.tar.gz
gentoo-d53d537ffcafbf92c3d364db95427303ecf6aed1.tar.bz2
gentoo-d53d537ffcafbf92c3d364db95427303ecf6aed1.zip
dev-lang/ghc: Use system sphinx-rtd-theme
This allows sphinx-7 to build the GHC user's guide The upstream rtd-theme that is bundled with GHC has been updated but none of our GHC versions contain this fix. See: https://gitlab.haskell.org/ghc/ghc/-/commit/70526f5bd8886126f49833ef20604a2c6477780a Closes: https://bugs.gentoo.org/906784 Signed-off-by: hololeap <hololeap@protonmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/ghc')
-rw-r--r--dev-lang/ghc/ghc-9.0.2-r4.ebuild17
1 files changed, 17 insertions, 0 deletions
diff --git a/dev-lang/ghc/ghc-9.0.2-r4.ebuild b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
index 1691ba87bc87..b3d72fb4d5eb 100644
--- a/dev-lang/ghc/ghc-9.0.2-r4.ebuild
+++ b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
@@ -165,6 +165,7 @@ BDEPEND="
app-text/docbook-xml-dtd:4.5
app-text/docbook-xsl-stylesheets
dev-python/sphinx
+ dev-python/sphinx-rtd-theme
>=dev-libs/libxslt-1.1.2 )
!ghcbootstrap? ( ${PREBUILT_BINARY_DEPENDS} )
test? ( ${PYTHON_DEPS} )
@@ -597,6 +598,22 @@ src_prepare() {
eapply "${FILESDIR}"/${PN}-9.0.2-fptools.patch # clang-16 workaround
eapply "${FILESDIR}"/${PN}-9.0.2-sphinx-6.patch
+ # FIXME: A hack that allows dev-python/sphinx-7 to build the docs
+ #
+ # GHC has updated the bundled version here:
+ # <https://gitlab.haskell.org/ghc/ghc/-/commit/70526f5bd8886126f49833ef20604a2c6477780a>
+ # However, the patch is difficult to apply and our versions of GHC don't
+ # have the update, so we symlink to the system version instead.
+ if use doc; then
+ local python_str="import sphinx_rtd_theme; print(sphinx_rtd_theme.__file__)"
+ local rtd_theme_dir="$(dirname $("${EPYTHON}" -c "$python_str"))"
+ local orig_rtd_theme_dir="${S}/docs/users_guide/rtd-theme"
+
+ einfo "Replacing bundled rtd-theme with dev-python/sphinx-rtd-theme"
+ rm -r "${orig_rtd_theme_dir}" || die
+ ln -s "${rtd_theme_dir}" "${orig_rtd_theme_dir}" || die
+ fi
+
# mingw32 target
pushd "${S}/libraries/Win32"
eapply "${FILESDIR}"/${PN}-8.2.1_rc1-win32-cross-2-hack.patch # bad workaround