ea447a01c2bb02b32e2f027f12ac7c74284efd46
[gentoo.git] / dev-python / reportlab / reportlab-3.3.0-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python{2_7,3_5,3_6} ) # Tests crash with pypy
7
8 inherit distutils-r1 flag-o-matic prefix
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 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
18 IUSE="doc examples"
19
20 RDEPEND="
21         <dev-python/pillow-6[tiff,truetype,jpeg(+),${PYTHON_USEDEP}]
22         media-libs/libart_lgpl
23         sys-libs/zlib
24 "
25 DEPEND="${RDEPEND}
26         >=dev-python/setuptools-2.2[${PYTHON_USEDEP}]
27         app-arch/unzip
28 "
29
30 PATCHES=(
31         "${FILESDIR}"/reportlab-no-pip.patch
32 )
33
34 src_unpack() {
35         unpack ${P}.tar.gz
36         cd ${P}/src/reportlab/fonts || die
37         unpack pfbfer-20070710.zip
38 }
39
40 python_prepare_all() {
41         sed -i \
42                 -e 's|/usr/local/Acrobat|/opt/Acrobat|g' \
43                 -e 's|%(HOME)s/fonts|%(HOME)s/.fonts|g' \
44                 src/reportlab/rl_config.py || die
45
46         eprefixify setup.py
47         distutils-r1_python_prepare_all
48 }
49
50 python_compile_all() {
51         use doc && emake -C docs html
52 }
53
54 python_compile() {
55         if ! python_is_python3; then
56                 local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
57         fi
58         distutils-r1_python_compile
59 }
60
61 python_test() {
62         pushd tests > /dev/null || die
63         "${PYTHON}" runAll.py || die "Testing failed with ${EPYTHON}"
64         popd > /dev/null || die
65 }
66
67 python_install_all() {
68         use doc && local HTML_DOCS=( docs/build/html/. )
69         use examples && local EXAMPLES=( demos/. tools/pythonpoint/demos )
70
71         distutils-r1_python_install_all
72 }