Add built_with_use checks for the ubuntu/newspr font flags.
[gentoo-soor-overlay.git] / media-libs / fontconfig / fontconfig-2.5.0-r1.ebuild
blobe48696a41382fc5801fcf76c260bb6c8ea3b6af6
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="1"
6 inherit eutils libtool autotools
8 DESCRIPTION="A library for configuring and customizing font access"
9 HOMEPAGE="http://fontconfig.org/"
10 SRC_URI="http://fontconfig.org/release/${P}.tar.gz"
12 LICENSE="fontconfig"
13 SLOT="1.0"
14 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
15 IUSE="doc xml +ubuntu"
17 RDEPEND="newspr? ( >=media-libs/freetype-2.3.5-r2 )
18 !newspr? ( media-libs/freetype:2 )
19 !xml? ( dev-libs/expat )
20 xml? ( dev-libs/libxml2:2 )"
21 DEPEND="${RDEPEND}
22 dev-util/pkgconfig
23 doc? ( app-text/docbook-sgml-utils )"
24 PDEPEND="app-admin/eselect-fontconfig"
26 pkg_setup () {
27 if use ubuntu && \
28 ! built_with_use --missing false media-libs/freetype:2 ubuntu; then
29 eerror "You need to compile freetype-2 with the ubuntu USE before you can compile fontconfig with the ubuntu USE flag."
30 die "Please rebuild freetype-2 with ubuntu enabled."
34 src_unpack() {
35 unpack ${A}
37 cd "${S}"
38 # add docbook switch so we can disable it
39 epatch "${FILESDIR}"/${PN}-2.3.2-docbook.patch
41 # Enable control over freetype's sub-pixel configuration; currently, this
42 # only has an effect on cairo, and only if it contains the patch from
43 # freedesktop #10301. This will be included in fontconfig 2.6. See
44 # freedesktop #13566.
45 if use ubuntu; then
46 epatch "${FILESDIR}"/${PN}-2.5.0-ubuntu-3.diff
47 epatch "${FILESDIR}"/${PN}-lcd-filtering.patch
48 epatch "${FILESDIR}"/${PN}-monospace-lcd-filtering.patch
49 epatch "${FILESDIR}"/${PN}-hinting-and-alising-confs.patch
50 cp "${FILESDIR}"/30-replace-bitmap-fonts.conf conf.d/
53 eautoreconf
54 epunt_cxx #74077
57 src_compile() {
58 # I'm thinking this should be removed
59 [[ ${ARCH} == alpha && ${CC} == ccc ]] && \
60 die "Dont compile fontconfig with ccc, it doesnt work very well"
62 # disable docs only disables local docs generation, they come with the tarball
63 econf $(use_enable doc docs) \
64 $(use_enable doc docbook) \
65 --localstatedir=/var \
66 --with-docdir=/usr/share/doc/${PF} \
67 --with-default-fonts=/usr/share/fonts \
68 --with-add-fonts=/usr/local/share/fonts \
69 $(use_enable xml libxml2) \
70 || die
72 emake || die
75 src_install() {
76 emake DESTDIR="${D}" install || die
78 insinto /etc/fonts
79 doins "${S}"/fonts.conf
81 newman doc/fonts-conf.5 fonts.conf.5
82 dohtml doc/fontconfig-user.html
83 dodoc doc/fontconfig-user.{txt,pdf}
85 if use doc; then
86 doman doc/Fc*.3
87 dohtml doc/fontconfig-devel.html doc
88 dohtml -r doc/fontconfig-devel
89 dodoc doc/fontconfig-devel.{txt,pdf}
92 dodoc AUTHORS ChangeLog NEWS README
94 # Changes should be made to /etc/fonts/local.conf, and as we had
95 # too much problems with broken fonts.conf, we force update it ...
96 # <azarah@gentoo.org> (11 Dec 2002)
97 echo 'CONFIG_PROTECT_MASK="/etc/fonts/fonts.conf"' > "${T}"/37fontconfig
98 doenvd "${T}"/37fontconfig
101 pkg_postinst() {
102 echo
103 ewarn "Please make fontconfig configuration changes in /etc/fonts/conf.d/"
104 ewarn "and NOT to /etc/fonts/fonts.conf, as it will be replaced!"
105 echo
107 if [[ ${ROOT} = / ]]; then
108 ebegin "Creating global font cache..."
109 /usr/bin/fc-cache -sr
110 eend $?