app-misc/gnome-commander: 1.3.0.99 - adjust dep for app-doc/chmlib -> dev-libs/chmlib...
[gentoo-soor-overlay.git] / media-libs / fontconfig / fontconfig-2.5.0-r1.ebuild
blob7bc3fa9f841ee9218cca9347906b80b5c05f1491
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
40 epatch "${FILESDIR}"/${P}-libtool-2.2.patch #213831 Fix libtool-2.2 brekage
42 # Enable control over freetype's sub-pixel configuration; currently, this
43 # only has an effect on cairo, and only if it contains the patch from
44 # freedesktop #10301. This will be included in fontconfig 2.6. See
45 # freedesktop #13566.
46 if use ubuntu; then
47 epatch "${FILESDIR}"/${PN}-2.5.0-ubuntu-3.diff
48 epatch "${FILESDIR}"/${PN}-lcd-filtering.patch
49 epatch "${FILESDIR}"/${PN}-monospace-lcd-filtering.patch
50 epatch "${FILESDIR}"/${PN}-hinting-and-alising-confs.patch
51 cp "${FILESDIR}"/30-replace-bitmap-fonts.conf conf.d/
54 eautoreconf
55 epunt_cxx #74077
58 src_compile() {
59 # I'm thinking this should be removed
60 [[ ${ARCH} == alpha && ${CC} == ccc ]] && \
61 die "Dont compile fontconfig with ccc, it doesnt work very well"
63 # disable docs only disables local docs generation, they come with the tarball
64 econf $(use_enable doc docs) \
65 $(use_enable doc docbook) \
66 --localstatedir=/var \
67 --with-docdir=/usr/share/doc/${PF} \
68 --with-default-fonts=/usr/share/fonts \
69 --with-add-fonts=/usr/local/share/fonts \
70 $(use_enable xml libxml2) \
71 || die
73 emake || die
76 src_install() {
77 emake DESTDIR="${D}" install || die
79 insinto /etc/fonts
80 doins "${S}"/fonts.conf
82 newman doc/fonts-conf.5 fonts.conf.5
83 dohtml doc/fontconfig-user.html
84 dodoc doc/fontconfig-user.{txt,pdf}
86 if use doc; then
87 doman doc/Fc*.3
88 dohtml doc/fontconfig-devel.html doc
89 dohtml -r doc/fontconfig-devel
90 dodoc doc/fontconfig-devel.{txt,pdf}
93 dodoc AUTHORS ChangeLog NEWS README
95 # Changes should be made to /etc/fonts/local.conf, and as we had
96 # too much problems with broken fonts.conf, we force update it ...
97 # <azarah@gentoo.org> (11 Dec 2002)
98 echo 'CONFIG_PROTECT_MASK="/etc/fonts/fonts.conf"' > "${T}"/37fontconfig
99 doenvd "${T}"/37fontconfig
102 pkg_postinst() {
103 echo
104 ewarn "Please make fontconfig configuration changes in /etc/fonts/conf.d/"
105 ewarn "and NOT to /etc/fonts/fonts.conf, as it will be replaced!"
106 echo
108 if [[ ${ROOT} = / ]]; then
109 ebegin "Creating global font cache..."
110 /usr/bin/fc-cache -sr
111 eend $?