]> git.draconx.ca Git - gentoo-fixes.git/blob - media-gfx/uniconvertor/uniconvertor-2.0_pre379-r1.ebuild
Initial commit
[gentoo-fixes.git] / media-gfx / uniconvertor / uniconvertor-2.0_pre379-r1.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
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         )
39
40 python_prepare_all() {
41         local wand
42
43         if use imagemagick; then
44                 PATCHES+=("$FILESDIR/$P-libimg.patch")
45                 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")
46         fi
47
48         distutils-r1_python_prepare_all
49
50         if use imagemagick; then
51                 sed \
52                         -e "/libraries/s:'MagickWand':${wand}:g" \
53                         -i setup.py || die
54         fi
55
56         ln -sf \
57                 "${EPREFIX}"/usr/share/imagemagick/sRGB.icm \
58                 src/unittests/cms_tests/cms_data/sRGB.icm || die
59 }
60
61 python_test() {
62         einfo ${PYTHONPATH}
63         #distutils_install_for_testing
64         cd src/unittests || die
65         ${EPYTHON} all_tests.py || die
66 }