1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit flag-o-matic libtool multilib-minimal python-any-r1 xdg-utils
10 DESCRIPTION="An OpenType text shaping engine"
11 HOMEPAGE="https://www.freedesktop.org/wiki/Software/HarfBuzz"
13 if [[ ${PV} = 9999 ]] ; then
14 EGIT_REPO_URI="https://anongit.freedesktop.org/git/harfbuzz.git"
15 inherit git-r3 autotools
17 SRC_URI="https://www.freedesktop.org/software/${PN}/release/${P}.tar.bz2"
18 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris"
21 LICENSE="Old-MIT ISC icu"
22 SLOT="0/0.9.18" # 0.9.18 introduced the harfbuzz-icu split; bug #472416
24 IUSE="+cairo debug fontconfig +glib +graphite icu +introspection static-libs test +truetype"
25 REQUIRED_USE="introspection? ( glib )"
28 cairo? ( x11-libs/cairo:= )
29 fontconfig? ( media-libs/fontconfig:1.0[${MULTILIB_USEDEP}] )
30 glib? ( >=dev-libs/glib-2.38:2[${MULTILIB_USEDEP}] )
31 graphite? ( >=media-gfx/graphite2-1.2.1:=[${MULTILIB_USEDEP}] )
32 icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
33 introspection? ( >=dev-libs/gobject-introspection-1.34:= )
34 truetype? ( >=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}] )
39 test? ( ${PYTHON_DEPS} )
41 # eautoreconf requires gobject-introspection-common
42 # ragel needed if regenerating *.hh files from *.rl
43 if [[ ${PV} = 9999 ]] ; then
45 >=dev-libs/gobject-introspection-common-1.34
51 use test && python-any-r1_pkg_setup
53 append-cppflags -DHB_NDEBUG
62 if [[ ${CHOST} == *-darwin* || ${CHOST} == *-solaris* ]] ; then
63 # on Darwin/Solaris we need to link with g++, like automake defaults
64 # to, but overridden by upstream because on Linux this is not
65 # necessary, bug #449126
67 -e 's/\<LINK\>/CXXLINK/' \
68 src/Makefile.am || die
70 -e '/libharfbuzz_la_LINK = /s/\<LINK\>/CXXLINK/' \
71 src/Makefile.in || die
73 -e '/AM_V_CCLD/s/\<LINK\>/CXXLINK/' \
74 test/api/Makefile.in || die
77 [[ ${PV} == 9999 ]] && eautoreconf
78 elibtoolize # for Solaris
81 append-cxxflags -std=c++14
84 multilib_src_configure() {
85 # harfbuzz-gobject only used for instrospection, bug #535852
89 $(use_enable static-libs static)
90 $(multilib_native_use_with cairo)
91 $(use_with fontconfig)
93 $(use_with introspection gobject)
94 $(use_with graphite graphite2)
96 $(multilib_native_use_enable introspection)
97 $(use_with truetype freetype)
99 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
101 if multilib_is_native_abi; then
102 ln -s "${S}"/docs/html docs/html || die
106 multilib_src_install_all() {
108 find "${ED}" -name "*.la" -delete || die