| 1 |
# Copyright 1999-2012 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.4.10.ebuild,v 1.1 2012/06/24 03:34:36 dirtyepic Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
|
| 7 |
inherit 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 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~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 |
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 |
if use utils; then |
| 62 |
cd "${WORKDIR}/ft2demos-${PV}" |
| 63 |
sed -i -e "s:\.\.\/freetype2$:../freetype-${PV}:" Makefile || die |
| 64 |
# Disable tests needing X11 when USE="-X". (bug #177597) |
| 65 |
if ! use X; then |
| 66 |
sed -i -e "/EXES\ +=\ ftdiff/ s:^:#:" Makefile || die |
| 67 |
fi |
| 68 |
fi |
| 69 |
|
| 70 |
elibtoolize |
| 71 |
epunt_cxx |
| 72 |
} |
| 73 |
|
| 74 |
src_configure() { |
| 75 |
append-flags -fno-strict-aliasing |
| 76 |
type -P gmake &> /dev/null && export GNUMAKE=gmake |
| 77 |
|
| 78 |
# we need non-/bin/sh to run configure |
| 79 |
[[ -n ${CONFIG_SHELL} ]] && \ |
| 80 |
sed -i -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \ |
| 81 |
"${S}"/builds/unix/configure |
| 82 |
|
| 83 |
econf \ |
| 84 |
$(use_enable static-libs static) \ |
| 85 |
$(use_with bzip2) |
| 86 |
} |
| 87 |
|
| 88 |
src_compile() { |
| 89 |
emake |
| 90 |
|
| 91 |
if use utils; then |
| 92 |
einfo "Building utils" |
| 93 |
cd "${WORKDIR}/ft2demos-${PV}" |
| 94 |
# fix for Prefix, bug #339334 |
| 95 |
emake X11_PATH="${EPREFIX}/usr/$(get_libdir)" |
| 96 |
fi |
| 97 |
} |
| 98 |
|
| 99 |
src_install() { |
| 100 |
emake DESTDIR="${D}" install |
| 101 |
|
| 102 |
if use utils; then |
| 103 |
einfo "Installing utils" |
| 104 |
rm "${WORKDIR}"/ft2demos-${PV}/bin/README |
| 105 |
for ft2demo in ../ft2demos-${PV}/bin/*; do |
| 106 |
./builds/unix/libtool --mode=install $(type -P install) -m 755 "$ft2demo" \ |
| 107 |
"${ED}"/usr/bin |
| 108 |
done |
| 109 |
fi |
| 110 |
|
| 111 |
if use fontforge; then |
| 112 |
# Probably fontforge needs less but this way makes things simplier... |
| 113 |
einfo "Installing internal headers required for fontforge" |
| 114 |
find src/truetype include/freetype/internal -name '*.h' | \ |
| 115 |
while read header; do |
| 116 |
mkdir -p "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})" |
| 117 |
cp ${header} "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})" |
| 118 |
done |
| 119 |
fi |
| 120 |
|
| 121 |
prune_libtool_files |
| 122 |
|
| 123 |
dodoc ChangeLog README |
| 124 |
dodoc docs/{CHANGES,CUSTOMIZE,DEBUG,*.txt,PROBLEMS,TODO} |
| 125 |
|
| 126 |
use doc && dohtml -r docs/* |
| 127 |
|
| 128 |
} |