/[gentoo-x86]/media-libs/freetype/freetype-2.4.9-r1.ebuild
Gentoo

Contents of /media-libs/freetype/freetype-2.4.9-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Tue Apr 17 21:44:08 2012 UTC (2 years, 5 months ago) by ranger
Branch: MAIN
Changes since 1.7: +2 -2 lines
Marking freetype-2.4.9-r1 ppc64 for bug 410983

(Portage version: 2.1.10.11/cvs/Linux ppc64)

1 dirtyepic 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ranger 1.8 # $Header: /var/cvsroot/gentoo-x86/media-libs/freetype/freetype-2.4.9-r1.ebuild,v 1.7 2012/04/16 19:29:28 ranger Exp $
4 dirtyepic 1.1
5     EAPI="4"
6    
7     inherit autotools eutils flag-o-matic libtool multilib
8    
9     DESCRIPTION="A high-quality and portable font engine"
10     HOMEPAGE="http://www.freetype.org/"
11     SRC_URI="mirror://sourceforge/freetype/${P/_/}.tar.bz2
12     utils? ( mirror://sourceforge/freetype/ft2demos-${PV}.tar.bz2 )
13     doc? ( mirror://sourceforge/freetype/${PN}-doc-${PV}.tar.bz2 )"
14    
15     LICENSE="FTL GPL-2"
16     SLOT="2"
17 ranger 1.8 KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
18 dirtyepic 1.1 IUSE="X auto-hinter bindist bzip2 debug doc fontforge static-libs utils"
19    
20     DEPEND="sys-libs/zlib
21     bzip2? ( app-arch/bzip2 )
22     X? ( x11-libs/libX11
23     x11-libs/libXau
24     x11-libs/libXdmcp )"
25    
26     RDEPEND="${DEPEND}"
27    
28     src_prepare() {
29     enable_option() {
30     sed -i -e "/#define $1/a #define $1" \
31     include/freetype/config/ftoption.h \
32     || die "unable to enable option $1"
33     }
34    
35     disable_option() {
36     sed -i -e "/#define $1/ { s:^:/*:; s:$:*/: }" \
37     include/freetype/config/ftoption.h \
38     || die "unable to disable option $1"
39     }
40    
41     if ! use bindist; then
42     # See http://freetype.org/patents.html
43     # ClearType is covered by several Microsoft patents in the US
44     enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING
45     fi
46    
47     if use auto-hinter; then
48     disable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER
49     enable_option TT_CONFIG_OPTION_UNPATENTED_HINTING
50     fi
51    
52     if use debug; then
53     enable_option FT_DEBUG_LEVEL_TRACE
54     enable_option FT_DEBUG_MEMORY
55     fi
56    
57     disable_option FT_CONFIG_OPTION_OLD_INTERNALS
58    
59     epatch "${FILESDIR}"/${PN}-2.3.2-enable-valid.patch
60    
61     # Fixed upstream for next version
62     epatch "${FILESDIR}"/${P}-type1-incremental.patch
63    
64     if use utils; then
65     cd "${WORKDIR}/ft2demos-${PV}"
66     sed -i -e "s:\.\.\/freetype2$:../freetype-${PV}:" Makefile || die
67     # Disable tests needing X11 when USE="-X". (bug #177597)
68     if ! use X; then
69     sed -i -e "/EXES\ +=\ ftdiff/ s:^:#:" Makefile || die
70     fi
71     fi
72    
73     if use prefix; then
74     cd "${S}"/builds/unix
75     eautoreconf
76     else
77     elibtoolize
78     fi
79     epunt_cxx
80     }
81    
82     src_configure() {
83     append-flags -fno-strict-aliasing
84     type -P gmake &> /dev/null && export GNUMAKE=gmake
85    
86     # we need non-/bin/sh to run configure
87     [[ -n ${CONFIG_SHELL} ]] && \
88     sed -i -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
89     "${S}"/builds/unix/configure
90    
91     econf \
92     $(use_enable static-libs static) \
93     $(use_with bzip2)
94     }
95    
96     src_compile() {
97     emake
98    
99     if use utils; then
100     cd "${WORKDIR}/ft2demos-${PV}"
101     # fix for Prefix, bug #339334
102     emake X11_PATH="${EPREFIX}/usr/$(get_libdir)"
103     fi
104     }
105    
106     src_install() {
107     emake DESTDIR="${D}" install
108    
109 ssuominen 1.2 # This is replaced by Libs.private: from freetype2.pc for static linking:
110     # pkg-config --static --libs freetype2
111     rm -f "${ED}"/usr/lib*/libfreetype.la
112    
113 dirtyepic 1.1 dodoc ChangeLog README
114     dodoc docs/{CHANGES,CUSTOMIZE,DEBUG,*.txt,PROBLEMS,TODO}
115    
116     use doc && dohtml -r docs/*
117    
118     if use utils; then
119     rm "${WORKDIR}"/ft2demos-${PV}/bin/README
120     for ft2demo in ../ft2demos-${PV}/bin/*; do
121     ./builds/unix/libtool --mode=install $(type -P install) -m 755 "$ft2demo" \
122     "${ED}"/usr/bin
123     done
124     fi
125    
126     if use fontforge; then
127     # Probably fontforge needs less but this way makes things simplier...
128     einfo "Installing internal headers required for fontforge"
129     find src/truetype include/freetype/internal -name '*.h' | \
130     while read header; do
131     mkdir -p "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})"
132     cp ${header} "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})"
133     done
134     fi
135     }
136    
137     pkg_postinst() {
138     elog "The TrueType bytecode interpreter is no longer patented and thus no"
139     elog "longer controlled by the bindist USE flag. Enable the auto-hinter"
140     elog "USE flag if you want the old USE="bindist" hinting behavior."
141     }

  ViewVC Help
Powered by ViewVC 1.1.20