*/*: Discontinue Gentoo SuperH port
[gentoo.git] / dev-python / jinja / jinja-2.10.3-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 DISTUTILS_USE_SETUPTOOLS=rdepend
7 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
8 PYTHON_REQ_USE="threads(+)"
9
10 inherit distutils-r1
11
12 DESCRIPTION="A full-featured template engine for Python"
13 HOMEPAGE="http://jinja.pocoo.org/ https://pypi.org/project/Jinja2/"
14 # pypi tarball is missing tests
15 SRC_URI="https://github.com/pallets/jinja/archive/${PV}.tar.gz -> ${P}.tar.gz"
16
17 LICENSE="BSD"
18 SLOT="0"
19 KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris"
20 IUSE="examples test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="
24         dev-python/markupsafe[${PYTHON_USEDEP}]
25         !dev-python/jinja:compat"
26 BDEPEND="${RDEPEND}"
27
28 distutils_enable_sphinx docs \
29         dev-python/sphinx-issues \
30         dev-python/pallets-sphinx-themes
31 distutils_enable_tests pytest
32
33 # XXX: handle Babel better?
34
35 wrap_opts() {
36         local mydistutilsargs=()
37
38         if [[ ${EPYTHON} == python* ]]; then
39                 mydistutilargs+=( --with-debugsupport )
40         fi
41
42         "${@}"
43 }
44
45 src_prepare() {
46         # avoid unnecessary dep on extra sphinxcontrib modules
47         sed -i '/sphinxcontrib.log_cabinet/ d' docs/conf.py || die
48         printf "############################# SED ###############################\n"
49
50         distutils-r1_src_prepare
51 }
52
53 python_prepare() {
54         # async is not supported on python2
55         if ! python_is_python3; then
56                 rm -f jinja2/async*.py || die "Failed to remove async from python2"
57         fi
58 }
59
60 python_compile() {
61         wrap_opts distutils-r1_python_compile
62 }
63
64 python_install_all() {
65         if use examples ; then
66                 docinto examples
67                 dodoc -r examples/.
68         fi
69
70         distutils-r1_python_install_all
71
72         insinto /usr/share/vim/vimfiles/syntax
73         doins ext/Vim/*
74 }
75
76 pkg_postinst() {
77         if ! has_version dev-python/Babel; then
78                 elog "For i18n support, please emerge dev-python/Babel."
79         fi
80 }