| 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-r1.ebuild,v 1.1 2012/07/29 18:04:56 yngwin 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 |
infinality? ( http://dev.gentoo.org/~yngwin/distfiles/${P}-infinality-patches.tar.xz )"
|
| 15 |
|
| 16 |
LICENSE="FTL GPL-2"
|
| 17 |
SLOT="2"
|
| 18 |
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"
|
| 19 |
IUSE="X auto-hinter bindist bzip2 debug doc fontforge infinality static-libs utils"
|
| 20 |
|
| 21 |
DEPEND="sys-libs/zlib
|
| 22 |
bzip2? ( app-arch/bzip2 )
|
| 23 |
X? ( x11-libs/libX11
|
| 24 |
x11-libs/libXau
|
| 25 |
x11-libs/libXdmcp )"
|
| 26 |
RDEPEND="${DEPEND}
|
| 27 |
infinality? ( media-libs/fontconfig-infinality )"
|
| 28 |
|
| 29 |
src_prepare() {
|
| 30 |
enable_option() {
|
| 31 |
sed -i -e "/#define $1/a #define $1" \
|
| 32 |
include/freetype/config/ftoption.h \
|
| 33 |
|| die "unable to enable option $1"
|
| 34 |
}
|
| 35 |
|
| 36 |
disable_option() {
|
| 37 |
sed -i -e "/#define $1/ { s:^:/*:; s:$:*/: }" \
|
| 38 |
include/freetype/config/ftoption.h \
|
| 39 |
|| die "unable to disable option $1"
|
| 40 |
}
|
| 41 |
|
| 42 |
if ! use bindist; then
|
| 43 |
# See http://freetype.org/patents.html
|
| 44 |
# ClearType is covered by several Microsoft patents in the US
|
| 45 |
enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
| 46 |
fi
|
| 47 |
|
| 48 |
if use auto-hinter; then
|
| 49 |
disable_option TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
| 50 |
enable_option TT_CONFIG_OPTION_UNPATENTED_HINTING
|
| 51 |
fi
|
| 52 |
|
| 53 |
if use debug; then
|
| 54 |
enable_option FT_DEBUG_LEVEL_TRACE
|
| 55 |
enable_option FT_DEBUG_MEMORY
|
| 56 |
fi
|
| 57 |
|
| 58 |
disable_option FT_CONFIG_OPTION_OLD_INTERNALS
|
| 59 |
|
| 60 |
if use infinality; then
|
| 61 |
epatch "${WORKDIR}"/patches/freetype-add-subpixel-hinting-infinality.patch
|
| 62 |
epatch "${WORKDIR}"/patches/freetype-entire-infinality-patchset.patch
|
| 63 |
|
| 64 |
enable_option FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
| 65 |
enable_option TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
| 66 |
fi
|
| 67 |
|
| 68 |
epatch "${FILESDIR}"/${PN}-2.3.2-enable-valid.patch
|
| 69 |
|
| 70 |
if use utils; then
|
| 71 |
cd "${WORKDIR}/ft2demos-${PV}"
|
| 72 |
sed -i -e "s:\.\.\/freetype2$:../freetype-${PV}:" Makefile || die
|
| 73 |
# Disable tests needing X11 when USE="-X". (bug #177597)
|
| 74 |
if ! use X; then
|
| 75 |
sed -i -e "/EXES\ +=\ ftdiff/ s:^:#:" Makefile || die
|
| 76 |
fi
|
| 77 |
fi
|
| 78 |
|
| 79 |
elibtoolize
|
| 80 |
epunt_cxx
|
| 81 |
}
|
| 82 |
|
| 83 |
src_configure() {
|
| 84 |
append-flags -fno-strict-aliasing
|
| 85 |
type -P gmake &> /dev/null && export GNUMAKE=gmake
|
| 86 |
|
| 87 |
# we need non-/bin/sh to run configure
|
| 88 |
[[ -n ${CONFIG_SHELL} ]] && \
|
| 89 |
sed -i -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
|
| 90 |
"${S}"/builds/unix/configure
|
| 91 |
|
| 92 |
econf \
|
| 93 |
$(use_enable static-libs static) \
|
| 94 |
$(use_with bzip2)
|
| 95 |
}
|
| 96 |
|
| 97 |
src_compile() {
|
| 98 |
emake
|
| 99 |
|
| 100 |
if use utils; then
|
| 101 |
einfo "Building utils"
|
| 102 |
cd "${WORKDIR}/ft2demos-${PV}"
|
| 103 |
# fix for Prefix, bug #339334
|
| 104 |
emake X11_PATH="${EPREFIX}/usr/$(get_libdir)"
|
| 105 |
fi
|
| 106 |
}
|
| 107 |
|
| 108 |
src_install() {
|
| 109 |
emake DESTDIR="${D}" install
|
| 110 |
|
| 111 |
if use utils; then
|
| 112 |
einfo "Installing utils"
|
| 113 |
rm "${WORKDIR}"/ft2demos-${PV}/bin/README
|
| 114 |
for ft2demo in ../ft2demos-${PV}/bin/*; do
|
| 115 |
./builds/unix/libtool --mode=install $(type -P install) -m 755 "$ft2demo" \
|
| 116 |
"${ED}"/usr/bin
|
| 117 |
done
|
| 118 |
fi
|
| 119 |
|
| 120 |
if use fontforge; then
|
| 121 |
# Probably fontforge needs less but this way makes things simplier...
|
| 122 |
einfo "Installing internal headers required for fontforge"
|
| 123 |
find src/truetype include/freetype/internal -name '*.h' | \
|
| 124 |
while read header; do
|
| 125 |
mkdir -p "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})"
|
| 126 |
cp ${header} "${ED}/usr/include/freetype2/internal4fontforge/$(dirname ${header})"
|
| 127 |
done
|
| 128 |
fi
|
| 129 |
|
| 130 |
prune_libtool_files
|
| 131 |
|
| 132 |
dodoc ChangeLog README
|
| 133 |
dodoc docs/{CHANGES,CUSTOMIZE,DEBUG,*.txt,PROBLEMS,TODO}
|
| 134 |
|
| 135 |
use doc && dohtml -r docs/*
|
| 136 |
|
| 137 |
}
|