*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / reportlab / reportlab-3.5.13-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 PYTHON_COMPAT=( python{2_7,3_6,3_7,3_8} ) # Tests crash with pypy
7
8 inherit distutils-r1 flag-o-matic
9
10 DESCRIPTION="Tools for generating printable PDF documents from any data source"
11 HOMEPAGE="http://www.reportlab.com/"
12 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz
13         http://www.reportlab.com/ftp/fonts/pfbfer-20070710.zip"
14
15 LICENSE="BSD"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
18 IUSE="doc examples"
19
20 RDEPEND="
21         dev-python/pillow[tiff,truetype,jpeg(+),${PYTHON_USEDEP}]
22         media-libs/libart_lgpl
23         sys-libs/zlib
24 "
25 DEPEND="${RDEPEND}
26         dev-python/setuptools[${PYTHON_USEDEP}]
27         app-arch/unzip
28 "
29
30 PATCHES=(
31         "${FILESDIR}/${PN}-3.5.13-disable-network-tests.patch"
32         "${FILESDIR}/${PN}-3.5.13-pillow-VERSION.patch"
33 )
34
35 src_unpack() {
36         unpack ${P}.tar.gz
37         cd ${P}/src/reportlab/fonts || die
38         unpack pfbfer-20070710.zip
39 }
40
41 python_compile_all() {
42         use doc && emake -C docs html
43 }
44
45 python_compile() {
46         if ! python_is_python3; then
47                 local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
48         fi
49         distutils-r1_python_compile
50 }
51
52 python_test() {
53         pushd tests > /dev/null || die
54         "${PYTHON}" runAll.py || die "Testing failed with ${EPYTHON}"
55         popd > /dev/null || die
56 }
57
58 python_install_all() {
59         use doc && local HTML_DOCS=( docs/build/html/. )
60         if use examples ; then
61                 docinto examples
62                 dosod -r demos/. tools/pythonpoint/demos
63         fi
64
65         distutils-r1_python_install_all
66 }