]> git.draconx.ca Git - gentoo-fixes.git/blob - media-gfx/uniconvertor/uniconvertor-2.0_pre379-r2.ebuild
Bump uniconvertor to match latest upstream.
[gentoo-fixes.git] / media-gfx / uniconvertor / uniconvertor-2.0_pre379-r2.ebuild
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.
4 #
5 # This file is a modified version of the original ebuild from Gentoo,
6 # covered by the following copyright and permission notice:
7 #
8 #   Copyright 1999-2017 Gentoo Foundation
9 #   Distributed under the terms of the GNU General Public License v2
10
11 EAPI=6
12
13 PYTHON_COMPAT=( python2_7 )
14
15 inherit distutils-r1 eutils
16
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"
20
21 KEYWORDS="amd64 ~arm ~hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~x86-solaris"
22 SLOT="0"
23 LICENSE="GPL-2 LGPL-2"
24 IUSE="imagemagick"
25
26 RDEPEND="
27         dev-python/pycairo[${PYTHON_USEDEP}]
28         imagemagick? ( media-gfx/imagemagick:= )
29         media-libs/lcms:2
30         dev-python/pillow[${PYTHON_USEDEP}]"
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33         app-text/ghostscript-gpl"
34
35 PATCHES=(
36         "${FILESDIR}"/${P}-import.patch
37         "${FILESDIR}"/${P}-test.patch
38         "${FILESDIR}"/${P}-abs.patch
39         )
40
41 python_prepare_all() {
42         local wand
43
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")
47         fi
48
49         distutils-r1_python_prepare_all
50
51         if use imagemagick; then
52                 sed \
53                         -e "s@/usr/include@${EPREFIX}/usr/include@" \
54                         -e "s@/usr/share@${EPREFIX}/usr/share@" \
55                         -e "/libraries/s:'MagickWand':${wand}:g" \
56                         -i setup.py || die
57
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
62                 fi
63         fi
64
65         ln -sf \
66                 "${EPREFIX}"/usr/share/imagemagick/sRGB.icm \
67                 src/unittests/cms_tests/cms_data/sRGB.icm || die
68 }
69
70 python_test() {
71         einfo ${PYTHONPATH}
72         #distutils_install_for_testing
73         cd src/unittests || die
74         ${EPYTHON} all_tests.py || die
75 }