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