1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{5,6,7} )
7 inherit autotools flag-o-matic multilib-minimal python-any-r1 toolchain-funcs
9 DESCRIPTION="International Components for Unicode"
10 HOMEPAGE="http://www.icu-project.org/"
11 SRC_URI="http://download.icu-project.org/files/icu4c/${PV/_/}/icu4c-${PV//./_}-src.tgz"
17 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
18 IUSE="debug doc examples static-libs"
20 BDEPEND="${PYTHON_DEPS}
22 doc? ( app-doc/doxygen[dot] )
25 S="${WORKDIR}/${PN}/source"
27 MULTILIB_CHOST_TOOLS=(
32 "${FILESDIR}/${PN}-58.1-remove-bashisms.patch"
33 "${FILESDIR}/${PN}-64.2-darwin.patch"
34 "${FILESDIR}/${PN}-64.1-data_archive_generation.patch"
39 eapply -p3 "${FILESDIR}/${PN}-64.2-extern_c.patch"
43 # Disable renaming as it is stupid thing to do
45 -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \
46 common/unicode/uconfig.h || die
48 # Fix linking of icudata
50 -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \
51 config/mh-linux || die
53 # Append doxygen configuration to configure
55 -e 's:icudefs.mk:icudefs.mk Doxyfile:' \
62 append-cxxflags -std=c++14
64 if tc-is-cross-compiler; then
65 mkdir "${WORKDIR}"/host || die
66 pushd "${WORKDIR}"/host >/dev/null || die
68 CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \
69 CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" AR="$(tc-getBUILD_AR)" \
70 RANLIB="$(tc-getBUILD_RANLIB)" LD="$(tc-getBUILD_LD)" \
71 "${S}"/configure --disable-renaming --disable-debug \
72 --disable-samples --enable-static || die
75 popd >/dev/null || die
78 multilib-minimal_src_configure
81 multilib_src_configure() {
87 $(use_enable static-libs static)
88 $(multilib_native_use_enable examples samples)
91 tc-is-cross-compiler && myeconfargs+=(
92 --with-cross-build="${WORKDIR}"/host
95 # icu tries to use clang by default
98 # make sure we configure with the same shell as we run icu-config
99 # with, or ECHO_N, ECHO_T and ECHO_C will be wrongly defined
100 export CONFIG_SHELL="${EPREFIX}/bin/sh"
101 # probably have no /bin/sh in prefix-chain
102 [[ -x ${CONFIG_SHELL} ]] || CONFIG_SHELL="${BASH}"
104 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
107 multilib_src_compile() {
110 if multilib_is_native_abi && use doc; then
111 doxygen -u Doxyfile || die
112 doxygen Doxyfile || die
116 multilib_src_test() {
117 # INTLTEST_OPTS: intltest options
118 # -e: Exhaustive testing
119 # -l: Reporting of memory leaks
120 # -v: Increased verbosity
121 # IOTEST_OPTS: iotest options
122 # -e: Exhaustive testing
123 # -v: Increased verbosity
124 # CINTLTST_OPTS: cintltst options
125 # -e: Exhaustive testing
126 # -v: Increased verbosity
127 emake -j1 VERBOSE="1" check
130 multilib_src_install() {
133 if multilib_is_native_abi && use doc; then
139 multilib_src_install_all() {