1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools toolchain-funcs
8 MY_P=${P/graphicsm/GraphicsM}
10 DESCRIPTION="Collection of tools and libraries for many image formats"
11 HOMEPAGE="http://www.graphicsmagick.org/"
12 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.xz"
16 KEYWORDS="alpha amd64 hppa ~ppc ppc64 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
17 IUSE="bzip2 cxx debug fpx imagemagick jbig jpeg jpeg2k lcms lzma modules openmp
18 perl png postscript q16 q32 static-libs svg threads tiff truetype webp wmf X zlib"
20 RDEPEND=">=sys-devel/libtool-2.2.6b
21 bzip2? ( app-arch/bzip2 )
22 fpx? ( media-libs/libfpx )
23 imagemagick? ( !media-gfx/imagemagick )
24 jbig? ( media-libs/jbigkit )
25 jpeg? ( virtual/jpeg:0 )
26 jpeg2k? ( media-libs/jasper )
27 lcms? ( media-libs/lcms:2 )
28 lzma? ( app-arch/xz-utils )
29 perl? ( dev-lang/perl )
30 png? ( media-libs/libpng:0 )
31 postscript? ( app-text/ghostscript-gpl )
32 svg? ( dev-libs/libxml2 )
33 tiff? ( media-libs/tiff:0 )
36 >=media-libs/freetype-2
38 webp? ( media-libs/libwebp )
39 wmf? ( media-libs/libwmf )
44 zlib? ( sys-libs/zlib )"
50 "${FILESDIR}"/${PN}-1.3.19-flags.patch
51 "${FILESDIR}"/${PN}-1.3.19-perl.patch
52 "${FILESDIR}"/${PN}-1.3.20-powerpc.patch
66 if use openmp && tc-has-openmp; then
71 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
72 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
76 $(use_enable static-libs static) \
77 $(use_enable debug prof) \
78 $(use_enable debug gcov) \
79 $(use_enable imagemagick magick-compat) \
82 --with-quantum-depth=${depth} \
83 --without-frozenpaths \
84 $(use_with cxx magick-plus-plus) \
86 --with-perl-options=INSTALLDIRS=vendor \
87 $(use_with bzip2 bzlib) \
88 $(use_with postscript dps) \
94 $(use_with jpeg2k jp2) \
95 $(use_with lcms lcms2) \
99 $(use_with truetype ttf) \
101 --with-fontpath="${EPREFIX}"/usr/share/fonts \
102 --with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts \
103 --with-windows-font-dir="${EPREFIX}"/usr/share/fonts/corefonts \
104 $(use_with svg xml) \
111 use perl && emake perl-build
115 unset DISPLAY # some perl tests fail when DISPLAY is set
123 emake -C PerlMagick DESTDIR="${D}" install
124 find "${ED}" -type f -name perllocal.pod -exec rm -f {} +
125 find "${ED}" -depth -mindepth 1 -type d -empty -exec rm -rf {} +
128 find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +