dev-libs/libxml2: arm64 stable (bug #701020)
[gentoo.git] / dev-libs / icu / icu-65.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{5,6,7} )
7 inherit autotools flag-o-matic multilib-minimal python-any-r1 toolchain-funcs
8
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"
12
13 LICENSE="BSD"
14
15 SLOT="0/${PV}"
16
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"
19
20 BDEPEND="${PYTHON_DEPS}
21         virtual/pkgconfig
22         doc? ( app-doc/doxygen[dot] )
23 "
24
25 S="${WORKDIR}/${PN}/source"
26
27 MULTILIB_CHOST_TOOLS=(
28         /usr/bin/icu-config
29 )
30
31 PATCHES=(
32         "${FILESDIR}/${PN}-65.1-remove-bashisms.patch"
33         "${FILESDIR}/${PN}-64.2-darwin.patch"
34         "${FILESDIR}/${PN}-64.1-data_archive_generation.patch"
35 )
36
37 src_prepare() {
38         default
39
40         local variable
41
42         # Disable renaming as it is stupid thing to do
43         sed -i \
44                 -e "s/#define U_DISABLE_RENAMING 0/#define U_DISABLE_RENAMING 1/" \
45                 common/unicode/uconfig.h || die
46
47         # Fix linking of icudata
48         sed -i \
49                 -e "s:LDFLAGSICUDT=-nodefaultlibs -nostdlib:LDFLAGSICUDT=:" \
50                 config/mh-linux || die
51
52         # Append doxygen configuration to configure
53         sed -i \
54                 -e 's:icudefs.mk:icudefs.mk Doxyfile:' \
55                 configure.ac || die
56
57         eautoreconf
58 }
59
60 src_configure() {
61         append-cxxflags -std=c++14
62
63         if tc-is-cross-compiler; then
64                 mkdir "${WORKDIR}"/host || die
65                 pushd "${WORKDIR}"/host >/dev/null || die
66
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
72                 emake
73
74                 popd >/dev/null || die
75         fi
76
77         multilib-minimal_src_configure
78 }
79
80 multilib_src_configure() {
81         local myeconfargs=(
82                 --disable-renaming
83                 --disable-samples
84                 --disable-layoutex
85                 $(use_enable debug)
86                 $(use_enable static-libs static)
87                 $(multilib_native_use_enable examples samples)
88         )
89
90         tc-is-cross-compiler && myeconfargs+=(
91                 --with-cross-build="${WORKDIR}"/host
92         )
93
94         # icu tries to use clang by default
95         tc-export CC CXX
96
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}"
102
103         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
104 }
105
106 multilib_src_compile() {
107         default
108
109         if multilib_is_native_abi && use doc; then
110                 doxygen -u Doxyfile || die
111                 doxygen Doxyfile || die
112         fi
113 }
114
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
127 }
128
129 multilib_src_install() {
130         default
131
132         if multilib_is_native_abi && use doc; then
133                 docinto html
134                 dodoc -r doc/html/*
135         fi
136 }
137
138 multilib_src_install_all() {
139         einstalldocs
140         docinto html
141         dodoc ../readme.html
142 }