summaryrefslogtreecommitdiff
path: root/media-gfx/img2pdf/img2pdf-0.4.0.ebuild
blob: 03f64a2071de89acd207a512d14071f76c03785d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{7,8} )
DISTUTILS_USE_SETUPTOOLS=rdepend

inherit distutils-r1

DESCRIPTION="Losslessly convert raster images to PDF"
HOMEPAGE="https://gitlab.mister-muffin.de/josch/img2pdf"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"

LICENSE="LGPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gui"

# missing dev-python/pdfrw dependency and
# require old version of imagemagick
# waiting new version
RESTRICT="test"

#BDEPEND="test? (
#	dev-python/numpy[${PYTHON_USEDEP}]
#	dev-python/pdfrw[${PYTHON_USEDEP}]
#	dev-python/pikepdf[${PYTHON_USEDEP}]
#	dev-python/pytest[${PYTHON_USEDEP}]
#	dev-python/scipy[${PYTHON_USEDEP}]
#	<media-gfx/imagemagick-7.0.0[jpeg,jpeg2k,png,q8,q32,tiff]
#)"
RDEPEND="dev-python/pikepdf[${PYTHON_USEDEP}]
	dev-python/pillow[${PYTHON_USEDEP}]
	gui? ( $(python_gen_impl_dep tk) )"

distutils_enable_tests pytest

src_prepare() {
	distutils-r1_python_prepare_all

	# Remove gui executable if there's no demand/support for it.
	if ! use gui; then
		sed -i '/gui_scripts/d' setup.py || die
	fi
}

python_test() {
	pytest -vv src/img2pdf_test.py || die "Tests fail with ${EPYTHON}"
}