dev-python/zc-lockfile: keyworded 2.0 for ia64, bug #717946
[gentoo.git] / dev-python / translate-toolkit / translate-toolkit-2.5.0.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 PYTHON_COMPAT=( python3_{6,7,8} )
7 PYTHON_REQ_USE="sqlite"
8 DISTUTILS_USE_SETUPTOOLS=rdepend
9 inherit distutils-r1
10
11 DESCRIPTION="Toolkit to convert between many translation formats"
12 HOMEPAGE="https://github.com/translate/translate"
13 SRC_URI="https://github.com/translate/translate/releases/download/${PV}/${P}.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux"
18 IUSE="doc +html +ical +ini +subtitles +yaml"
19
20 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
21
22 BDEPEND="
23         doc? ( >=dev-python/sphinx-3.0.1 )
24 "
25 DEPEND="
26         >=dev-python/six-1.11.0[${PYTHON_USEDEP}]
27 "
28 RDEPEND="${DEPEND}
29         !dev-python/pydiff
30         app-text/iso-codes
31         >=dev-python/chardet-3.0.4[${PYTHON_USEDEP}]
32         >=dev-python/lxml-4.3.1[${PYTHON_USEDEP}]
33         >=dev-python/pycountry-19.8.18[${PYTHON_USEDEP}]
34         >=dev-python/python-levenshtein-0.12.0[${PYTHON_USEDEP}]
35         sys-devel/gettext
36         html? ( dev-python/utidylib[${PYTHON_USEDEP}] )
37         ical? ( dev-python/vobject[${PYTHON_USEDEP}] )
38         ini? ( dev-python/iniparse[${PYTHON_USEDEP}] )
39         subtitles? ( media-video/gaupol[${PYTHON_USEDEP}] )
40         yaml? ( dev-python/pyyaml[${PYTHON_USEDEP}] )
41 "
42
43 python_prepare_all() {
44         # Prevent unwanted d'loading in doc build
45         sed -e "/^    'sphinx.ext.intersphinx',/d" \
46                 -e "/html_theme/ s/sphinx-bootstrap/classic/" \
47                 -i docs/conf.py || die
48
49         distutils-r1_python_prepare_all
50 }
51
52 python_compile_all() {
53         if use doc; then
54                 emake -C docs html
55                 HTML_DOCS=( "${S}"/docs/_build/html/. )
56         fi
57 }
58
59 python_install_all() {
60         distutils-r1_python_install_all
61
62         rm -Rf docs || die
63         if ! use html; then
64                 rm "${ED}"/usr/bin/{html2po,po2html} || die
65         fi
66         if ! use ical; then
67                 rm "${ED}"/usr/bin/{ical2po,po2ical} || die
68         fi
69         if ! use ini; then
70                 rm "${ED}"/usr/bin/{ini2po,po2ini} || die
71         fi
72         if ! use subtitles; then
73                 rm "${ED}"/usr/bin/{sub2po,po2sub} || die
74         fi
75
76         python_optimize
77 }