1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
7 inherit cmake-utils prefix
9 DESCRIPTION="A validating XML parser written in a portable subset of C++"
10 HOMEPAGE="https://xerces.apache.org/xerces-c/"
12 if [[ ${PV} == *9999 ]] ; then
13 ESVN_REPO_URI="https://svn.apache.org/repos/asf/xerces/c/trunk"
16 SRC_URI="mirror://apache/xerces/c/3/sources/${P}.tar.gz"
17 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
23 IUSE="cpu_flags_x86_sse2 curl doc elibc_Darwin elibc_FreeBSD examples iconv icu static-libs test threads"
25 RDEPEND="icu? ( dev-libs/icu:0= )
26 curl? ( net-misc/curl )
29 doc? ( app-doc/doxygen )
30 test? ( dev-lang/perl )"
32 DOCS=( CREDITS KEYS NOTICE README )
34 "${FILESDIR}/${P}-fix-XERCESC-2161.patch"
35 "${FILESDIR}/${P}-fix-XERCESC-2163.patch"
39 export ICUROOT="${EPREFIX}/usr"
41 if use iconv && use icu; then
42 ewarn "This package can use iconv or icu for loading messages"
43 ewarn "and transcoding, but not both. ICU takes precedence."
48 # 'cfurl' is only available on OSX and 'socket' isn't supposed to work.
49 # But the docs aren't clear about it, so we would need some testing...
53 elif use elibc_Darwin; then
71 elif use elibc_Darwin; then
72 transcoder="macosunicodeconverter"
73 elif use elibc_FreeBSD; then
78 # for interix maybe: transcoder="windows"
81 -Dnetwork-accessor="${netaccessor}"
82 -Dmessage-loader="${msgloader}"
83 -Dtranscoder="${transcoder}"
84 -Dthreads:BOOL="$(usex threads)"
85 -Dsse2:BOOL="$(usex cpu_flags_x86_sse2)"
88 cmake-utils_src_configure
92 cmake-utils_src_compile
94 use doc && cmake-utils_src_compile doc-style createapidocs doc-xml
98 cmake-utils_src_install
100 # package provides .pc files
101 find "${D}" -name '*.la' -delete || die
103 if use examples; then
104 # clean out object files, executables, Makefiles
105 # and the like before installing examples
106 find samples/ \( -type f -executable -o -iname 'runConfigure' -o -iname '*.o' \
107 -o -iname '.libs' -o -iname 'Makefile*' \) -exec rm -rf '{}' + || die
110 docompress -x /usr/share/doc/${PF}/examples
113 # To make sure an appropriate NLS msg file is around when using
114 # the iconv msgloader ICU has the messages compiled in.
115 if use iconv && ! use icu; then
116 doenvd "$(prefixify_ro "${FILESDIR}/50xerces-c")"