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="https://github.com/unicode-org/icu/releases/download/release-${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}-65.1-remove-bashisms.patch"
33 "${FILESDIR}/${PN}-64.2-darwin.patch"
34 "${FILESDIR}/${PN}-64.1-data_archive_generation.patch"
42 # Disable renaming as it is stupid thing to do
44 -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \
45 common/unicode/uconfig.h || die
47 # Fix linking of icudata
49 -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \
50 config/mh-linux || die
52 # Append doxygen configuration to configure
54 -e 's:icudefs.mk:icudefs.mk Doxyfile:' \
61 append-cxxflags -std=c++14
63 if tc-is-cross-compiler; then
64 mkdir "${WORKDIR}"/host || die
65 pushd "${WORKDIR}"/host >/dev/null || die
67 CFLAGS="" CXXFLAGS="" ASFLAGS="" LDFLAGS="" \
68 CC="$(tc-getBUILD_CC)" CXX="$(tc-getBUILD_CXX)" AR="$(tc-getBUILD_AR)" \
69 RANLIB="$(tc-getBUILD_RANLIB)" LD="$(tc-getBUILD_LD)" \
70 "${S}"/configure --disable-renaming --disable-debug \
71 --disable-samples --enable-static || die
74 popd >/dev/null || die
77 multilib-minimal_src_configure
80 multilib_src_configure() {
86 $(use_enable static-libs static)
87 $(multilib_native_use_enable examples samples)
90 tc-is-cross-compiler && myeconfargs+=(
91 --with-cross-build="${WORKDIR}"/host
94 # icu tries to use clang by default
97 # make sure we configure with the same shell as we run icu-config
98 # with, or ECHO_N, ECHO_T and ECHO_C will be wrongly defined
99 export CONFIG_SHELL="${EPREFIX}/bin/sh"
100 # probably have no /bin/sh in prefix-chain
101 [[ -x ${CONFIG_SHELL} ]] || CONFIG_SHELL="${BASH}"
103 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
106 multilib_src_compile() {
109 if multilib_is_native_abi && use doc; then
110 doxygen -u Doxyfile || die
111 doxygen Doxyfile || die
115 multilib_src_test() {
116 # INTLTEST_OPTS: intltest options
117 # -e: Exhaustive testing
118 # -l: Reporting of memory leaks
119 # -v: Increased verbosity
120 # IOTEST_OPTS: iotest options
121 # -e: Exhaustive testing
122 # -v: Increased verbosity
123 # CINTLTST_OPTS: cintltst options
124 # -e: Exhaustive testing
125 # -v: Increased verbosity
126 emake -j1 VERBOSE="1" check
129 multilib_src_install() {
132 if multilib_is_native_abi && use doc; then
138 multilib_src_install_all() {