202
|
1 # Copyright 1999-2010 Gentoo Foundation
|
|
2 # Distributed under the terms of the GNU General Public License v2
|
204
|
3 # $Header: /var/cvsroot/gentoo-x86/media-gfx/graphicsmagick/graphicsmagick-1.3.10.ebuild,v 1.1 2010/02/14 18:05:43 bicatali Exp $
|
202
|
4
|
|
5 EAPI="2"
|
|
6
|
|
7 inherit eutils toolchain-funcs flag-o-matic perl-module
|
|
8
|
|
9 MY_P=${P/graphicsm/GraphicsM}
|
|
10
|
|
11 DESCRIPTION="Collection of tools and libraries for many image formats"
|
|
12 HOMEPAGE="http://www.graphicsmagick.org/"
|
|
13 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
|
|
14
|
|
15 LICENSE="MIT"
|
|
16 SLOT="0"
|
204
|
17 KEYWORDS="~amd64 ~hppa ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
202
|
18 IUSE="bzip2 cxx debug doc fpx imagemagick jbig jpeg jpeg2k lcms openmp
|
|
19 perl png q16 q32 svg threads tiff truetype X wmf zlib"
|
|
20
|
|
21 RDEPEND="app-text/ghostscript-gpl
|
|
22 bzip2? ( app-arch/bzip2 )
|
|
23 fpx? ( media-libs/libfpx )
|
|
24 jbig? ( media-libs/jbigkit )
|
|
25 jpeg? ( media-libs/jpeg )
|
|
26 jpeg2k? ( >=media-libs/jasper-1.701.0 )
|
|
27 lcms? ( media-libs/lcms )
|
|
28 perl? ( dev-lang/perl )
|
|
29 png? ( media-libs/libpng )
|
|
30 svg? ( dev-libs/libxml2 )
|
|
31 tiff? ( >=media-libs/tiff-3.8.2 )
|
|
32 truetype? ( >=media-libs/freetype-2.0 )
|
|
33 wmf? ( media-libs/libwmf )
|
|
34 X? ( x11-libs/libXext x11-libs/libSM )
|
|
35 imagemagick? ( !media-gfx/imagemagick )"
|
|
36
|
|
37 DEPEND="${RDEPEND}"
|
|
38
|
|
39 S="${WORKDIR}/${MY_P}"
|
|
40
|
|
41 pkg_setup() {
|
|
42 if use openmp &&
|
|
43 [[ $(tc-getCC)$ == *gcc* ]] &&
|
|
44 ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
|
|
45 ! built_with_use sys-devel/gcc openmp )
|
|
46 then
|
|
47 ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
|
|
48 ewarn "If you want to build fftw with OpenMP, abort now,"
|
|
49 ewarn "and switch CC to an OpenMP capable compiler"
|
|
50 epause 5
|
|
51 fi
|
|
52 }
|
|
53
|
|
54 src_prepare() {
|
|
55 epatch "${FILESDIR}/${PN}-1.3.7-perl-ldflags.patch"
|
|
56 epatch "${FILESDIR}/${PN}-1.3.7-debian-fixed.patch"
|
|
57 }
|
|
58
|
|
59 src_configure() {
|
|
60 local quantumDepth
|
|
61 if use q16 ; then
|
|
62 quantumDepth="16"
|
|
63 elif use q32 ; then
|
|
64 quantumDepth="32"
|
|
65 else
|
|
66 quantumDepth="8"
|
|
67 fi
|
|
68
|
|
69 use debug && filter-flags -fomit-frame-pointer
|
|
70 econf \
|
|
71 --docdir=/usr/share/doc/${PF} \
|
|
72 --htmldir=/usr/share/doc/${PF}/html \
|
|
73 --enable-shared \
|
|
74 --enable-largefile \
|
|
75 --without-included-ltdl \
|
|
76 --without-frozenpaths \
|
|
77 --without-gslib \
|
|
78 --with-modules \
|
|
79 --with-quantum-depth=${quantumDepth} \
|
|
80 --with-fontpath="/usr/share/fonts" \
|
|
81 --with-gs-font-dir="/usr/share/fonts/default/ghostscript" \
|
|
82 --with-windows-font-dir="/usr/share/fonts/corefonts" \
|
|
83 $(use_enable debug ccmalloc) \
|
|
84 $(use_enable debug prof) \
|
|
85 $(use_enable debug gcov) \
|
|
86 $(use_enable imagemagick magick-compat) \
|
|
87 $(use_enable openmp) \
|
|
88 $(use_with bzip2 bzlib) \
|
|
89 $(use_with cxx magick-plus-plus) \
|
|
90 $(use_with fpx) \
|
|
91 $(use_with jbig) \
|
|
92 $(use_with jpeg) \
|
|
93 $(use_with jpeg2k jp2) \
|
|
94 $(use_with lcms) \
|
|
95 $(use_with perl) \
|
|
96 $(use_with png) \
|
|
97 $(use_with svg xml) \
|
|
98 $(use_with threads) \
|
|
99 $(use_with tiff) \
|
|
100 $(use_with truetype ttf) \
|
|
101 $(use_with wmf) \
|
|
102 $(use_with X x) \
|
|
103 $(use_with zlib)
|
|
104 }
|
|
105
|
|
106 src_compile() {
|
|
107 emake || die "emake failed"
|
|
108 if use perl; then
|
|
109 emake perl-build || die "emake perl failed"
|
|
110 fi
|
|
111 }
|
|
112
|
|
113 src_test() {
|
|
114 emake check || die "tests failed"
|
|
115 }
|
|
116
|
|
117 src_install() {
|
|
118 emake DESTDIR="${D}" install || die "emake install failed"
|
|
119 if use perl; then
|
|
120 perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
|
|
121 emake -C PerlMagick DESTDIR="${D}" \
|
|
122 install || die "emake perl install failed"
|
|
123 fixlocalpod
|
|
124 fi
|
|
125 use doc || rm -rf "${D}"usr/share/doc/${PF}/html
|
|
126 }
|