summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhololeap <hololeap@protonmail.com>2023-11-04 17:20:59 -0600
committerSam James <sam@gentoo.org>2023-11-19 18:32:24 +0000
commit9dd4edd989c5ddc8770151515a6c8f6f627ed2fb (patch)
treeb9d4122de9f12a9eaf2577c93e8d0d481d5934f1 /dev-lang/ghc
parentdev-lang/ghc: drop dead prefix targets (diff)
downloadgentoo-9dd4edd989c5ddc8770151515a6c8f6f627ed2fb.tar.gz
gentoo-9dd4edd989c5ddc8770151515a6c8f6f627ed2fb.tar.bz2
gentoo-9dd4edd989c5ddc8770151515a6c8f6f627ed2fb.zip
dev-lang/ghc: Fix python deps for docs
Add python_gen_any_dep and python_check_deps to correctly resolve python dependencies (needed for building documentation) See: https://projects.gentoo.org/python/guide/any.html See: d53d537ffcafbf92c3d364db95427303ecf6aed1 Closes: https://bugs.gentoo.org/915722 Closes: https://bugs.gentoo.org/915884 Closes: https://bugs.gentoo.org/915227 Thanks-to: Sam James <sam@gentoo.org> 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.ebuild28
-rw-r--r--dev-lang/ghc/ghc-9.2.8.ebuild34
2 files changed, 47 insertions, 15 deletions
diff --git a/dev-lang/ghc/ghc-9.0.2-r4.ebuild b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
index 140c6cdfed30..b05739eb215f 100644
--- a/dev-lang/ghc/ghc-9.0.2-r4.ebuild
+++ b/dev-lang/ghc/ghc-9.0.2-r4.ebuild
@@ -161,19 +161,28 @@ RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
- doc? ( app-text/docbook-xml-dtd:4.2
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ app-text/docbook-xml-dtd:4.2
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} )
+ >=dev-libs/libxslt-1.1.2
+ )
+ !ghcbootstrap? (
+ ${PREBUILT_BINARY_DEPENDS}
+ )
+ test? (
+ ${PYTHON_DEPS}
+ )
"
needs_python() {
# test driver is written in python
use test && return 0
+ use doc && return 0
return 1
}
@@ -187,6 +196,13 @@ REQUIRED_USE="
# haskell libraries built with cabal in configure mode, #515354
QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
+python_check_deps() {
+ if use doc; then
+ python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+ fi
+}
+
is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
}
diff --git a/dev-lang/ghc/ghc-9.2.8.ebuild b/dev-lang/ghc/ghc-9.2.8.ebuild
index b6e51fdcdfe8..d6fbae083399 100644
--- a/dev-lang/ghc/ghc-9.2.8.ebuild
+++ b/dev-lang/ghc/ghc-9.2.8.ebuild
@@ -170,19 +170,28 @@ RDEPEND+="binary? ( ${PREBUILT_BINARY_RDEPENDS} )"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
- doc? ( app-text/docbook-xml-dtd:4.2
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ app-text/docbook-xml-dtd:4.2
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} )
+ >=dev-libs/libxslt-1.1.2
+ )
+ !ghcbootstrap? (
+ ${PREBUILT_BINARY_DEPENDS}
+ )
+ test? (
+ ${PYTHON_DEPS}
+ )
"
needs_python() {
# test driver is written in python
use test && return 0
+ use doc && return 0
return 1
}
@@ -196,6 +205,13 @@ REQUIRED_USE="
# haskell libraries built with cabal in configure mode, #515354
QA_CONFIGURE_OPTIONS+=" --with-compiler --with-gcc"
+python_check_deps() {
+ if use doc; then
+ python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+ fi
+}
+
is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
}
@@ -653,13 +669,13 @@ src_prepare() {
# 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 rtd_theme_dir="$(dirname $(python -c "import sphinx_rtd_theme; print(sphinx_rtd_theme.__file__)"))"
+ 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"
- ebegin "Replacing bundled rtd-theme with dev-python/sphinx-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
- eend 0
fi
# mingw32 target