dev-libs/icu-layoutex-63.1: ppc64 stable, bug 670456
[gentoo.git] / dev-libs / icu-layoutex / icu-layoutex-58.2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils flag-o-matic toolchain-funcs autotools multilib-minimal
7
8 DESCRIPTION="External layout part of International Components for Unicode"
9 HOMEPAGE="http://www.icu-project.org/"
10 SRC_URI="http://download.icu-project.org/files/icu4c/${PV/_/}/icu4c-${PV//./_}-src.tgz"
11
12 LICENSE="BSD"
13
14 SLOT="0/${PV}"
15
16 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 x86"
17 IUSE="debug static-libs"
18
19 RDEPEND="
20         ~dev-libs/icu-${PV}[${MULTILIB_USEDEP}]
21         dev-libs/icu-le-hb[${MULTILIB_USEDEP}]
22 "
23
24 DEPEND="
25         virtual/pkgconfig[${MULTILIB_USEDEP}]
26         ${RDEPEND}
27 "
28
29 S="${WORKDIR}/${PN/-layoutex}/source"
30
31 PATCHES=(
32         "${FILESDIR}/${PN}-58.1-remove-bashisms.patch"
33 )
34
35 src_prepare() {
36         # apply patches
37         default
38
39         local variable
40
41         # Disable renaming as it is stupid thing to do
42         sed -i \
43                 -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \
44                 common/unicode/uconfig.h || die
45
46         # Fix linking of icudata
47         sed -i \
48                 -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \
49                 config/mh-linux || die
50
51         eautoreconf
52 }
53
54 src_configure() {
55         # Use C++14
56         append-cxxflags -std=c++14
57
58         if tc-is-cross-compiler; then
59                 mkdir "${WORKDIR}"/host || die
60                 pushd "${WORKDIR}"/host >/dev/null || die
61
62                 CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \
63                 CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" AR="$(tc-getBUILD_AR)" \
64                 RANLIB="$(tc-getBUILD_RANLIB)" LD="$(tc-getBUILD_LD)" \
65                 "${S}"/configure --disable-renaming --disable-debug \
66                         --disable-samples --enable-static || die
67                 emake
68
69                 popd >/dev/null || die
70         fi
71
72         multilib-minimal_src_configure
73 }
74
75 multilib_src_configure() {
76         local myeconfargs=(
77                 --disable-renaming
78                 --disable-samples
79                 --enable-layoutex
80                 $(use_enable debug)
81                 $(use_enable static-libs static)
82         )
83
84         tc-is-cross-compiler && myeconfargs+=(
85                 --with-cross-build="${WORKDIR}"/host
86         )
87
88         # icu tries to use clang by default
89         tc-export CC CXX
90
91         ECONF_SOURCE=${S} \
92         econf "${myeconfargs[@]}"
93 }
94
95 multilib_src_test() {
96         # INTLTEST_OPTS: intltest options
97         #   -e: Exhaustive testing
98         #   -l: Reporting of memory leaks
99         #   -v: Increased verbosity
100         # IOTEST_OPTS: iotest options
101         #   -e: Exhaustive testing
102         #   -v: Increased verbosity
103         # CINTLTST_OPTS: cintltst options
104         #   -e: Exhaustive testing
105         #   -v: Increased verbosity
106         pushd layoutex &>/dev/null || die
107         emake -j1 VERBOSE="1" check
108         popd &>/dev/null || die
109 }
110
111 multilib_src_install() {
112         pushd layoutex &>/dev/null || die
113         default
114         popd &>/dev/null || die
115 }