1 # Copyright © 2017 Nick Bowler
2 # License GPLv2+: GNU General Public License version 2 or later.
3 # There is NO WARRANTY, to the extent permitted by law.
5 # This file is a modified version of the original ebuild from Gentoo,
6 # covered by the following copyright and permission notice:
8 # Copyright 1999-2017 Gentoo Foundation
9 # Distributed under the terms of the GNU General Public License v2
13 PYTHON_COMPAT=( python2_7 )
15 inherit distutils-r1 eutils
17 DESCRIPTION="Convert vector graphic file formats like .cdr, .svg, wmf and more."
18 HOMEPAGE="https://sk1project.net/modules.php?name=Products&product=uniconvertor"
19 SRC_URI="https://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
21 KEYWORDS="amd64 ~arm ~hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~x86-solaris"
23 LICENSE="GPL-2 LGPL-2"
27 dev-python/pycairo[${PYTHON_USEDEP}]
28 imagemagick? ( media-gfx/imagemagick:= )
30 dev-python/pillow[${PYTHON_USEDEP}]"
33 app-text/ghostscript-gpl"
36 "${FILESDIR}"/${P}-import.patch
37 "${FILESDIR}"/${P}-test.patch
38 "${FILESDIR}"/${P}-abs.patch
41 python_prepare_all() {
44 if use imagemagick; then
45 PATCHES+=("$FILESDIR/$P-libimg.patch")
46 wand=$(pkg-config --libs MagickWand | sed -e "s:^ *::g" -e "s: *$::g" -e "s:-l:\':g" -e "s: :',:g" -e "s:$:':g" -e "s:,'$::g")
49 distutils-r1_python_prepare_all
51 if use imagemagick; then
53 -e "s@/usr/include@${EPREFIX}/usr/include@" \
54 -e "s@/usr/share@${EPREFIX}/usr/share@" \
55 -e "/libraries/s:'MagickWand':${wand}:g" \
58 # https://bugs.gentoo.org/581816
59 if has_version ">=media-gfx/imagemagick-7.0" ; then
60 sed -e "s:ImageMagick-6:ImageMagick-7:" -i setup.py || die
61 eapply "${FILESDIR}"/${P}-ImageMagick7.patch
66 "${EPREFIX}"/usr/share/imagemagick/sRGB.icm \
67 src/unittests/cms_tests/cms_data/sRGB.icm || die
72 #distutils_install_for_testing
73 cd src/unittests || die
74 ${EPYTHON} all_tests.py || die