Add built_with_use checks for the ubuntu/newspr font flags.
[gentoo-soor-overlay.git] / x11-libs / cairo / cairo-1.6.4.ebuild
blob8c10e69b58012023368ee0dff6b90cf0f3cd41de
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="1"
7 inherit eutils flag-o-matic libtool
9 DESCRIPTION="A vector graphics library with cross-device output support"
10 HOMEPAGE="http://cairographics.org/"
11 SRC_URI="http://cairographics.org/releases/${P}.tar.gz"
13 LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
16 IUSE="debug directfb doc glitz +newspr opengl svg test X xcb"
18 RDEPEND="media-libs/fontconfig
19 newspr? ( >=media-libs/freetype-2.3.5-r2 )
20 !newspr? ( media-libs/freetype:2 )
21 sys-libs/zlib
22 media-libs/libpng
23 >=x11-libs/pixman-0.10.0
24 X? (
25 x11-libs/libXrender
26 x11-libs/libXext
27 x11-libs/libX11
28 virtual/xft
29 xcb? (
30 x11-libs/libxcb
31 x11-libs/xcb-util
34 directfb? ( >=dev-libs/DirectFB-0.9.24 )
35 glitz? ( >=media-libs/glitz-0.5.1 )
36 svg? ( dev-libs/libxml2 )"
38 DEPEND="${RDEPEND}
39 >=dev-util/pkgconfig-0.19
40 test? (
41 virtual/ghostscript
42 >=app-text/poppler-bindings-0.4.1
43 x11-libs/pango
44 x11-libs/gtk+
45 svg? ( >=gnome-base/librsvg-2.15.0 )
47 X? (
48 x11-proto/renderproto
49 xcb? ( x11-proto/xcb-proto )
51 doc? (
52 >=dev-util/gtk-doc-1.6
53 app-text/docbook-xml-dtd:4.2
56 RESTRICT="test"
58 pkg_setup () {
59 if use newspr && \
60 ! built_with_use --missing false x11-libs/libXft newspr; then
61 eerror "You need to rebuild libXft with newspr USE enabled"
62 eerror "before you can compile cairo with newspr."
63 die "Please rebuild libXft with newspr enabled."
67 src_unpack() {
68 unpack ${A}
69 cd "${S}"
71 if use newspr; then
72 epatch "${FILESDIR}"/${PN}-1.6.4-0ubuntu1.diff.bz2 || die
75 # We need to run elibtoolize to ensure correct so versioning on FreeBSD
76 elibtoolize
79 src_compile() {
80 #gets rid of fbmmx.c inlining warnings
81 append-flags -finline-limit=1200
83 if use glitz && use opengl; then
84 export glitz_LIBS=-lglitz-glx
87 econf $(use_enable X xlib) $(use_enable doc gtk-doc) $(use_enable directfb) \
88 $(use_enable svg) $(use_enable glitz) $(use_enable X xlib-xrender) \
89 $(use_enable debug test-surfaces) --enable-pdf --enable-png \
90 --enable-freetype --enable-ps $(use_enable xcb) \
91 || die "configure failed"
93 emake || die "compile failed"
96 src_install() {
97 make DESTDIR="${D}" install || die "Installation failed"
98 dodoc AUTHORS ChangeLog NEWS README
101 pkg_postinst() {
102 elog "DO NOT report bugs to Gentoo's bugzilla"
103 elog "See http://forums.gentoo.org/viewtopic-t-511382.html for support topic on Gentoo forums."