dev-python/zc-lockfile: keyworded 2.0 for ia64, bug #717946
[gentoo.git] / dev-python / translate-toolkit / translate-toolkit-2.4.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} )
7 PYTHON_REQ_USE="sqlite"
8
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         dev-python/setuptools[${PYTHON_USEDEP}]
24         doc? ( dev-python/sphinx )
25 "
26 DEPEND="
27         >=dev-python/six-1.10.0[${PYTHON_USEDEP}]
28 "
29 RDEPEND="${DEPEND}
30         !dev-python/pydiff
31         app-text/iso-codes
32         >=dev-python/chardet-3.0.4[${PYTHON_USEDEP}]
33         >=dev-python/lxml-3.5[${PYTHON_USEDEP}]
34         >=dev-python/pycountry-18.5.26[${PYTHON_USEDEP}]
35         >=dev-python/python-levenshtein-0.12.0[${PYTHON_USEDEP}]
36         sys-devel/gettext
37         html? ( dev-python/utidylib[${PYTHON_USEDEP}] )
38         ical? ( dev-python/vobject[${PYTHON_USEDEP}] )
39         ini? ( dev-python/iniparse[${PYTHON_USEDEP}] )
40         subtitles? ( media-video/gaupol[${PYTHON_USEDEP}] )
41         yaml? ( dev-python/pyyaml[${PYTHON_USEDEP}] )
42 "
43
44 python_prepare_all() {
45         # Prevent unwanted d'loading in doc build
46         sed -e "/^    'sphinx.ext.intersphinx',/d" \
47                 -e "/html_theme/ s/sphinx-bootstrap/classic/" \
48                 -i docs/conf.py || die
49
50         distutils-r1_python_prepare_all
51 }
52
53 python_compile_all() {
54         if use doc; then
55                 emake -C docs html
56                 HTML_DOCS=( "${S}"/docs/_build/html/. )
57         fi
58 }
59
60 python_install_all() {
61         distutils-r1_python_install_all
62
63         rm -Rf docs || die
64         if ! use html; then
65                 rm "${ED}"/usr/bin/{html2po,po2html} || die
66         fi
67         if ! use ical; then
68                 rm "${ED}"/usr/bin/{ical2po,po2ical} || die
69         fi
70         if ! use ini; then
71                 rm "${ED}"/usr/bin/{ini2po,po2ini} || die
72         fi
73         if ! use subtitles; then
74                 rm "${ED}"/usr/bin/{sub2po,po2sub} || die
75         fi
76 }