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