Drop arm-linux keyword from tree.
[gentoo.git] / media-libs / harfbuzz / harfbuzz-1.8.8.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit flag-o-matic libtool multilib-minimal python-any-r1 xdg-utils
9
10 DESCRIPTION="An OpenType text shaping engine"
11 HOMEPAGE="https://www.freedesktop.org/wiki/Software/HarfBuzz"
12
13 if [[ ${PV} = 9999 ]] ; then
14         EGIT_REPO_URI="https://anongit.freedesktop.org/git/harfbuzz.git"
15         inherit git-r3 autotools
16 else
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"
19 fi
20
21 LICENSE="Old-MIT ISC icu"
22 SLOT="0/0.9.18" # 0.9.18 introduced the harfbuzz-icu split; bug #472416
23
24 IUSE="+cairo debug fontconfig +glib +graphite icu +introspection static-libs test +truetype"
25 REQUIRED_USE="introspection? ( glib )"
26
27 RDEPEND="
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}] )
35 "
36 DEPEND="${RDEPEND}
37         dev-util/gtk-doc-am
38         virtual/pkgconfig
39         test? ( ${PYTHON_DEPS} )
40 "
41 # eautoreconf requires gobject-introspection-common
42 # ragel needed if regenerating *.hh files from *.rl
43 if [[ ${PV} = 9999 ]] ; then
44         DEPEND+="
45                 >=dev-libs/gobject-introspection-common-1.34
46                 dev-util/ragel
47         "
48 fi
49
50 pkg_setup() {
51         use test && python-any-r1_pkg_setup
52         if ! use debug ; then
53                 append-cppflags -DHB_NDEBUG
54         fi
55 }
56
57 src_prepare() {
58         default
59
60         xdg_environment_reset
61
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
66                 sed -i \
67                         -e 's/\<LINK\>/CXXLINK/' \
68                         src/Makefile.am || die
69                 sed -i \
70                         -e '/libharfbuzz_la_LINK = /s/\<LINK\>/CXXLINK/' \
71                         src/Makefile.in || die
72                 sed -i \
73                         -e '/AM_V_CCLD/s/\<LINK\>/CXXLINK/' \
74                         test/api/Makefile.in || die
75         fi
76
77         [[ ${PV} == 9999 ]] && eautoreconf
78         elibtoolize # for Solaris
79
80         # bug 618772
81         append-cxxflags -std=c++14
82 }
83
84 multilib_src_configure() {
85         # harfbuzz-gobject only used for instrospection, bug #535852
86         local myeconfargs=(
87                 --without-coretext
88                 --without-uniscribe
89                 $(use_enable static-libs static)
90                 $(multilib_native_use_with cairo)
91                 $(use_with fontconfig)
92                 $(use_with glib)
93                 $(use_with introspection gobject)
94                 $(use_with graphite graphite2)
95                 $(use_with icu)
96                 $(multilib_native_use_enable introspection)
97                 $(use_with truetype freetype)
98         )
99         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
100
101         if multilib_is_native_abi; then
102                 ln -s "${S}"/docs/html docs/html || die
103         fi
104 }
105
106 multilib_src_install_all() {
107         einstalldocs
108         find "${ED}" -name "*.la" -delete || die
109 }