Merge remote-tracking branch 'github/pr/536'.
[gentoo.git] / media-libs / harfbuzz / harfbuzz-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 EGIT_REPO_URI="git://anongit.freedesktop.org/harfbuzz"
8 [[ ${PV} == 9999 ]] && inherit git-r3 autotools
9
10 PYTHON_COMPAT=( python2_7 )
11
12 inherit eutils libtool multilib-minimal python-any-r1
13
14 DESCRIPTION="An OpenType text shaping engine"
15 HOMEPAGE="http://www.freedesktop.org/wiki/Software/HarfBuzz"
16 [[ ${PV} == 9999 ]] || SRC_URI="http://www.freedesktop.org/software/${PN}/release/${P}.tar.bz2"
17
18 LICENSE="Old-MIT ISC icu"
19 SLOT="0/0.9.18" # 0.9.18 introduced the harfbuzz-icu split; bug #472416
20 [[ ${PV} == 9999 ]] || \
21 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris"
22
23 IUSE="+cairo fontconfig +glib +graphite icu +introspection static-libs test +truetype"
24 REQUIRED_USE="introspection? ( glib )"
25
26 RDEPEND="
27         cairo? ( x11-libs/cairo:= )
28         fontconfig? ( media-libs/fontconfig:1.0[${MULTILIB_USEDEP}] )
29         glib? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
30         graphite? ( >=media-gfx/graphite2-1.2.1:=[${MULTILIB_USEDEP}] )
31         icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
32         introspection? ( >=dev-libs/gobject-introspection-1.34:= )
33         truetype? ( >=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}] )
34 "
35 DEPEND="${RDEPEND}
36         dev-util/gtk-doc-am
37         virtual/pkgconfig
38         test? ( ${PYTHON_DEPS} )
39 "
40 # eautoreconf requires gobject-introspection-common
41 # ragel needed if regenerating *.hh files from *.rl
42 [[ ${PV} = 9999 ]] && DEPEND="${DEPEND}
43         >=dev-libs/gobject-introspection-common-1.34
44         dev-util/ragel
45 "
46
47 pkg_setup() {
48         use test && python-any-r1_pkg_setup
49 }
50
51 src_prepare() {
52         if [[ ${CHOST} == *-darwin* || ${CHOST} == *-solaris* ]] ; then
53                 # on Darwin/Solaris we need to link with g++, like automake defaults
54                 # to, but overridden by upstream because on Linux this is not
55                 # necessary, bug #449126
56                 sed -i \
57                         -e 's/\<LINK\>/CXXLINK/' \
58                         src/Makefile.am || die
59                 sed -i \
60                         -e '/libharfbuzz_la_LINK = /s/\<LINK\>/CXXLINK/' \
61                         src/Makefile.in || die
62                 sed -i \
63                         -e '/AM_V_CCLD/s/\<LINK\>/CXXLINK/' \
64                         test/api/Makefile.in || die
65         fi
66
67         [[ ${PV} == 9999 ]] && eautoreconf
68         elibtoolize # for Solaris
69
70         # failing test, https://bugs.freedesktop.org/show_bug.cgi?id=89190
71         sed -e 's#tests/arabic-fallback-shaping.tests##' -i test/shaping/Makefile.in || die "sed failed"
72 }
73
74 multilib_src_configure() {
75         ECONF_SOURCE="${S}" \
76         # harfbuzz-gobject only used for instrospection, bug #535852
77         econf \
78                 --without-coretext \
79                 --without-uniscribe \
80                 $(use_enable static-libs static) \
81                 $(multilib_native_use_with cairo) \
82                 $(use_with fontconfig) \
83                 $(use_with glib) \
84                 $(use_with introspection gobject) \
85                 $(use_with graphite graphite2) \
86                 $(use_with icu) \
87                 $(multilib_native_use_enable introspection) \
88                 $(use_with truetype freetype)
89
90         if multilib_is_native_abi; then
91                 ln -s "${S}"/docs/html docs/html || die
92         fi
93 }
94
95 multilib_src_install_all() {
96         einstalldocs
97         prune_libtool_files --modules
98 }