x11-libs/qt: delete old extraversions, rebase to current portage ebuilds.
[gentoo-soor-overlay.git] / media-libs / freetype / freetype-2.3.5-r2.ebuild
blobd0000ed7e28f9547760e7fd43030f52b182875dd
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 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 )"
14 LICENSE="FTL GPL-2"
15 SLOT="2"
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
20 x11-libs/libXau
21 x11-libs/libXdmcp )"
23 # We also need a recent fontconfig version to prevent segfaults. #166029
24 # July 3 2007 dirtyepic
25 RDEPEND="${DEPEND}
26 !<media-libs/fontconfig-2.3.2-r2"
28 src_unpack() {
29 unpack ${A}
30 cd "${S}"
32 enable_option() {
33 sed -i -e "/#define $1/a #define $1" \
34 include/freetype/config/ftoption.h \
35 || die "unable to enable option $1"
38 disable_option() {
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
55 if use debug; then
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
63 if use ubuntu; then
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
71 if use utils; then
72 cd "${WORKDIR}"/ft2demos-${PV}
73 sed -i -e "s:\.\.\/freetype2$:../freetype-${PV}:" Makefile
75 # Disable tests needing X11 when USE="-X". (bug #177597)
76 if ! use X; then
77 sed -i -e "/EXES\ +=\ ftview/ s:^:#:" Makefile
81 elibtoolize
82 epunt_cxx
85 src_compile() {
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"
92 if use utils; then
93 cd "${WORKDIR}"/ft2demos-${PV}
94 emake || die "ft2demos emake failed"
98 src_install() {
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/*
106 if use utils; then
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" \
110 "${D}"/usr/bin
111 done
115 pkg_postinst() {
116 echo
117 ewarn "After upgrading to freetype-2.3.5, it is necessary to rebuild"
118 ewarn "libXfont to avoid build errors in some packages."
119 echo
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."
123 echo
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."