Add rbutil.
[gentoo-soor-overlay.git] / media-libs / fontconfig / fontconfig-2.5.0-r1.ebuild
blob99d79e9ae7df11b03122455a1c766897238c4b3d
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 )
19 !xml? ( >=dev-libs/expat-1.95.3 )
20 xml? ( >=dev-libs/libxml2-2.6 )"
21 DEPEND="${RDEPEND}
22 dev-util/pkgconfig
23 doc? ( app-text/docbook-sgml-utils )"
24 PDEPEND="app-admin/eselect-fontconfig"
26 src_unpack() {
27 unpack ${A}
29 cd "${S}"
30 # add docbook switch so we can disable it
31 epatch "${FILESDIR}"/${PN}-2.3.2-docbook.patch
33 # Enable control over freetype's sub-pixel configuration; currently, this
34 # only has an effect on cairo, and only if it contains the patch from
35 # freedesktop #10301. This will be included in fontconfig 2.6. See
36 # freedesktop #13566.
37 if use ubuntu; then
38 epatch "${FILESDIR}"/${PN}-2.5.0-ubuntu-3.diff
39 epatch "${FILESDIR}"/${PN}-lcd-filtering.patch
40 epatch "${FILESDIR}"/${PN}-monospace-lcd-filtering.patch
41 epatch "${FILESDIR}"/${PN}-hinting-and-alising-confs.patch
42 cp "${FILESDIR}"/30-replace-bitmap-fonts.conf conf.d/
45 eautoreconf
46 epunt_cxx #74077
49 src_compile() {
50 # I'm thinking this should be removed
51 [[ ${ARCH} == alpha && ${CC} == ccc ]] && \
52 die "Dont compile fontconfig with ccc, it doesnt work very well"
54 # disable docs only disables local docs generation, they come with the tarball
55 econf $(use_enable doc docs) \
56 $(use_enable doc docbook) \
57 --localstatedir=/var \
58 --with-docdir=/usr/share/doc/${PF} \
59 --with-default-fonts=/usr/share/fonts \
60 --with-add-fonts=/usr/local/share/fonts \
61 $(use_enable xml libxml2) \
62 || die
64 emake || die
67 src_install() {
68 emake DESTDIR="${D}" install || die
70 insinto /etc/fonts
71 doins "${S}"/fonts.conf
73 newman doc/fonts-conf.5 fonts.conf.5
74 dohtml doc/fontconfig-user.html
75 dodoc doc/fontconfig-user.{txt,pdf}
77 if use doc; then
78 doman doc/Fc*.3
79 dohtml doc/fontconfig-devel.html doc
80 dohtml -r doc/fontconfig-devel
81 dodoc doc/fontconfig-devel.{txt,pdf}
84 dodoc AUTHORS ChangeLog NEWS README
86 # Changes should be made to /etc/fonts/local.conf, and as we had
87 # too much problems with broken fonts.conf, we force update it ...
88 # <azarah@gentoo.org> (11 Dec 2002)
89 echo 'CONFIG_PROTECT_MASK="/etc/fonts/fonts.conf"' > "${T}"/37fontconfig
90 doenvd "${T}"/37fontconfig
93 pkg_postinst() {
94 echo
95 ewarn "Please make fontconfig configuration changes in /etc/fonts/conf.d/"
96 ewarn "and NOT to /etc/fonts/fonts.conf, as it will be replaced!"
97 echo
99 if [[ ${ROOT} = / ]]; then
100 ebegin "Creating global font cache..."
101 /usr/bin/fc-cache -sr
102 eend $?