|
| 1 | +# Copyright 1999-2024 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +PYTHON_COMPAT=( python3_{10..14} ) |
| 7 | +DISTUTILS_USE_PEP517=setuptools |
| 8 | + |
| 9 | +inherit distutils-r1 pypi |
| 10 | + |
| 11 | +DESCRIPTION="Tool for transforming reStructuredText to PDF using ReportLab" |
| 12 | +HOMEPAGE="https://rst2pdf.org/ https://pypi.org/project/rst2pdf/" |
| 13 | + |
| 14 | +LICENSE="MIT" |
| 15 | +SLOT="0" |
| 16 | +KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
| 17 | +IUSE="math sphinx svg" |
| 18 | + |
| 19 | +BDEPEND="${PYTHON_DEPS} |
| 20 | + dev-python/jinja2[${PYTHON_USEDEP}] |
| 21 | + dev-python/pyyaml[${PYTHON_USEDEP}] |
| 22 | + dev-python/pygments[${PYTHON_USEDEP}] |
| 23 | + dev-python/smartypants[${PYTHON_USEDEP}] |
| 24 | + >=dev-python/reportlab-4.0[${PYTHON_USEDEP}] |
| 25 | + dev-python/setuptools-scm[${PYTHON_USEDEP}] |
| 26 | + >=dev-python/docutils-0.21.2[${PYTHON_USEDEP}] |
| 27 | + dev-python/importlib-metadata[${PYTHON_USEDEP}] |
| 28 | + math? ( dev-python/matplotlib[${PYTHON_USEDEP}] ) |
| 29 | + svg? ( dev-python/svglib[${PYTHON_USEDEP}] ) |
| 30 | + sphinx? ( dev-python/sphinx[${PYTHON_USEDEP}] ) |
| 31 | +" |
| 32 | + |
| 33 | +# restrict tests because: the price is way too high (in both developer time |
| 34 | +# to unhork and cost per megawatt in cpu power) |
| 35 | +RESTRICT="test" |
| 36 | + |
| 37 | +export SETUPTOOLS_SCM_PRETEND_VERSION=${PV} |
| 38 | + |
| 39 | +src_install() { |
| 40 | + distutils-r1_src_install |
| 41 | + pushd "${S}/doc" > /dev/null |
| 42 | + rst2man rst2pdf.rst output/rst2pdf.1 |
| 43 | + popd > /dev/null |
| 44 | + doman doc/output/rst2pdf.1 |
| 45 | +} |
| 46 | + |
| 47 | +pkg_postinst() { |
| 48 | + if [[ -z ${REPLACING_VERSIONS} ]]; then |
| 49 | + elog "rst2pdf can work with the following packages for additional functionality:" |
| 50 | + elog " dev-python/sphinx - versatile documentation creation" |
| 51 | + elog " dev-python/pythonmagick - image processing with ImageMagick" |
| 52 | + elog " dev-python/matplotlib - mathematical formulae" |
| 53 | + elog "It can also use wordaxe for hyphenation, but this package is not" |
| 54 | + elog "available in the portage tree yet. Please refer to the manual" |
| 55 | + elog "installed in /usr/share/doc/${PF}/ for more information." |
| 56 | + fi |
| 57 | +} |
0 commit comments