media-gfx/graphicsmagick: bump to v1.3.33
[gentoo.git] / media-gfx / graphicsmagick / graphicsmagick-1.3.33.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools toolchain-funcs
6
7 MY_P=${P/graphicsm/GraphicsM}
8
9 DESCRIPTION="Collection of tools and libraries for many image formats"
10 HOMEPAGE="http://www.graphicsmagick.org/"
11 LICENSE="MIT"
12 SLOT="0/${PV%.*}"
13
14 if [[ ${PV} == "9999" ]] ; then
15         inherit mercurial
16         EHG_REPO_URI="http://hg.code.sf.net/p/${PN}/code"
17 else
18         SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.xz"
19         KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
20 fi
21
22 IUSE="bzip2 cxx debug fpx imagemagick jbig jpeg lcms lzma modules openmp
23         perl png postscript q16 q32 static-libs svg threads tiff truetype
24         webp wmf X zlib"
25
26 RDEPEND="dev-libs/libltdl:0
27         bzip2? ( app-arch/bzip2 )
28         fpx? ( media-libs/libfpx )
29         imagemagick? ( !media-gfx/imagemagick )
30         jbig? ( media-libs/jbigkit )
31         jpeg? ( virtual/jpeg:0 )
32         lcms? ( media-libs/lcms:2 )
33         lzma? ( app-arch/xz-utils )
34         perl? ( dev-lang/perl )
35         png? ( media-libs/libpng:0= )
36         postscript? ( app-text/ghostscript-gpl )
37         svg? ( dev-libs/libxml2 )
38         tiff? ( media-libs/tiff:0 )
39         truetype? (
40                 media-fonts/urw-fonts
41                 >=media-libs/freetype-2
42                 )
43         webp? ( media-libs/libwebp:= )
44         wmf? ( media-libs/libwmf )
45         X? (
46                 x11-libs/libSM
47                 x11-libs/libXext
48                 )
49         zlib? ( sys-libs/zlib )"
50 DEPEND="${RDEPEND}"
51
52 S=${WORKDIR}/${MY_P}
53
54 PATCHES=(
55         "${FILESDIR}"/${PN}-1.3.19-flags.patch
56         "${FILESDIR}"/${PN}-1.3.19-perl.patch
57 )
58
59 src_prepare() {
60         default
61         eautoreconf
62 }
63
64 src_configure() {
65         local depth=8
66         use q16 && depth=16
67         use q32 && depth=32
68
69         local openmp=disable
70         if use openmp && tc-has-openmp; then
71                 openmp=enable
72         fi
73
74         local myeconfargs=(
75                 --${openmp}-openmp
76                 --enable-largefile
77                 --enable-shared
78                 $(use_enable static-libs static)
79                 $(use_enable debug prof)
80                 $(use_enable debug gcov)
81                 $(use_enable imagemagick magick-compat)
82                 $(use_with threads)
83                 $(use_with modules)
84                 --with-quantum-depth=${depth}
85                 --without-frozenpaths
86                 $(use_with cxx magick-plus-plus)
87                 $(use_with perl)
88                 --with-perl-options=INSTALLDIRS=vendor
89                 $(use_with bzip2 bzlib)
90                 $(use_with postscript dps)
91                 $(use_with fpx)
92                 $(use_with jbig)
93                 $(use_with webp)
94                 $(use_with jpeg)
95                 --without-jp2
96                 $(use_with lcms lcms2)
97                 $(use_with lzma)
98                 $(use_with png)
99                 $(use_with tiff)
100                 $(use_with truetype ttf)
101                 $(use_with wmf)
102                 --with-fontpath="${EPREFIX}"/usr/share/fonts
103                 --with-gs-font-dir="${EPREFIX}"/usr/share/fonts/urw-fonts
104                 --with-windows-font-dir="${EPREFIX}"/usr/share/fonts/corefonts
105                 $(use_with svg xml)
106                 $(use_with zlib)
107                 $(use_with X x)
108         )
109         econf "${myeconfargs[@]}"
110 }
111
112 src_compile() {
113         default
114         use perl && emake perl-build
115 }
116
117 src_test() {
118         unset DISPLAY # some perl tests fail when DISPLAY is set
119         default
120 }
121
122 src_install() {
123         default
124
125         if use perl; then
126                 emake -C PerlMagick DESTDIR="${D}" install
127                 find "${ED}" -type f -name perllocal.pod -exec rm -f {} + || die
128                 find "${ED}" -depth -mindepth 1 -type d -empty -exec rm -rf {} + || die
129         fi
130
131         find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} + || die
132 }