mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
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: d53d537ffc
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>
This commit is contained in:
@@ -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} ]]
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user