1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-libs/freetype/freetype-2.3.5-r2.ebuild,v 1.8 2008/01/10 08:44:41 vapier Exp $
5 inherit eutils flag-o-matic libtool
7 DESCRIPTION
="A high-quality and portable font engine"
8 HOMEPAGE
="http://www.freetype.org/"
9 SRC_URI
="mirror://sourceforge/freetype/${P/_/}.tar.bz2
10 utils? ( mirror://sourceforge/freetype/ft2demos-${PV}.tar.bz2 )
11 doc? ( mirror://sourceforge/freetype/${PN}-doc-${PV}.tar.bz2 )"
15 KEYWORDS
="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
16 IUSE
="X bindist debug doc utils ubuntu"
18 DEPEND
="X? ( x11-libs/libX11
22 # We also need a recent fontconfig version to prevent segfaults. #166029
23 # July 3 2007 dirtyepic
25 !<media-libs/fontconfig-2.3.2-r2"
32 sed -i -e "/#define $1/a #define $1" \
33 include
/freetype
/config
/ftoption.h \
34 || die
"unable to enable option $1"
38 sed -i -e "/#define $1/ { s:^:/*:; s:$:*/: }" \
39 include
/freetype
/config
/ftoption.h \
40 || die
"unable to disable option $1"
43 if ! use bindist
; then
44 # Bytecodes and subpixel hinting supports are patented
45 # in United States; for safety, disable them while building
46 # binaries, so that no risky code is distributed.
47 # See http://freetype.org/patents.html
49 enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING
50 enable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER
51 disable_option TT_CONFIG_OPTION_UNPATENTED_HINTING
55 enable_option FT_DEBUG_LEVEL_ERROR
56 enable_option FT_DEBUG_MEMORY
59 enable_option FT_CONFIG_OPTION_INCREMENTAL
60 disable_option FT_CONFIG_OPTION_OLD_INTERNALS
63 epatch
"${FILESDIR}"/331-hmtx-no-shorts.
diff
64 epatch
"${FILESDIR}"/${PN}-bdflib-large-encodings.
patch
67 epatch
"${FILESDIR}"/${PN}-2.3
.2-enable-valid.
patch
68 epatch
"${FILESDIR}"/${PN}-2.3
.5-crossbuild.
patch # bug #185681
71 cd "${WORKDIR}"/ft2demos-
${PV}
72 sed -i -e "s:\.\.\/freetype2$:../freetype-${PV}:" Makefile
74 # Disable tests needing X11 when USE="-X". (bug #177597)
76 sed -i -e "/EXES\ +=\ ftview/ s:^:#:" Makefile
85 append-flags
-fno-strict-aliasing
87 type -P gmake
&> /dev
/null
&& export GNUMAKE
=gmake
88 econf || die
"econf failed"
89 emake || die
"emake failed"
92 cd "${WORKDIR}"/ft2demos-
${PV}
93 emake || die
"ft2demos emake failed"
98 emake DESTDIR
="${D}" install || die
"emake install failed"
100 dodoc ChangeLog README
101 dodoc docs
/{CHANGES
,CUSTOMIZE
,DEBUG
,*.txt
,PATENTS
,TODO
}
103 use doc
&& dohtml
-r docs
/*
106 rm "${WORKDIR}"/ft2demos-
${PV}/bin
/README
107 for ft2demo
in ..
/ft2demos-
${PV}/bin
/*; do
108 .
/builds
/unix
/libtool
--mode=install $
(type -P install) -m 755 "$ft2demo" \
116 ewarn
"After upgrading to freetype-2.3.5, it is necessary to rebuild"
117 ewarn
"libXfont to avoid build errors in some packages."
119 elog
"The utilities and demos previously bundled with freetype are now"
120 elog
"optional. Enable the utils USE flag if you would like them"
121 elog
"to be installed."
123 elog
"DO NOT report bugs to Gentoo's bugzilla"
124 elog
"See http://forums.gentoo.org/viewtopic-t-511382.html for support topic on Gentoo forums."