xerces-c-3.1.4-r1.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools
  5. DESCRIPTION="A validating XML parser written in a portable subset of C++"
  6. HOMEPAGE="http://xerces.apache.org/xerces-c/"
  7. SRC_URI="mirror://apache/xerces/c/3/sources/${P}.tar.gz"
  8. LICENSE="Apache-2.0"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm hppa ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos"
  11. IUSE="cpu_flags_x86_sse2 curl doc elibc_Darwin elibc_FreeBSD examples iconv icu static-libs test threads"
  12. RDEPEND="icu? ( dev-libs/icu:0= )
  13. curl? ( net-misc/curl )
  14. virtual/libiconv"
  15. DEPEND="${RDEPEND}
  16. doc? ( app-doc/doxygen )
  17. test? ( dev-lang/perl )"
  18. DOCS=( CREDITS KEYS NOTICE README version.incl )
  19. PATCHES=( "${FILESDIR}/${PN}-3.1.4-fix-build-system.patch" )
  20. pkg_setup() {
  21. export ICUROOT="/usr"
  22. if use iconv && use icu; then
  23. ewarn "This package can use iconv or icu for loading messages"
  24. ewarn "and transcoding, but not both. ICU takes precedence."
  25. fi
  26. }
  27. src_prepare() {
  28. default
  29. eautoreconf
  30. }
  31. src_configure() {
  32. local msgloader
  33. if use icu; then
  34. msgloader="icu"
  35. elif use iconv; then
  36. msgloader="iconv"
  37. else
  38. msgloader="inmemory"
  39. fi
  40. local transcoder
  41. if use icu; then
  42. transcoder="icu"
  43. elif use elibc_Darwin; then
  44. transcoder="macosunicodeconverter"
  45. elif use elibc_FreeBSD; then
  46. transcoder="iconv"
  47. else
  48. transcoder="gnuiconv"
  49. fi
  50. # for interix maybe: transcoder="windows"
  51. # 'cfurl' is only available on OSX and 'socket' isn't supposed to work.
  52. # But the docs aren't clear about it, so we would need some testing...
  53. local netaccessor
  54. if use curl; then
  55. netaccessor="curl"
  56. elif use elibc_Darwin; then
  57. netaccessor="cfurl"
  58. else
  59. netaccessor="socket"
  60. fi
  61. econf \
  62. --disable-pretty-make \
  63. --enable-msgloader-${msgloader} \
  64. --enable-transcoder-${transcoder} \
  65. --enable-netaccessor-${netaccessor} \
  66. $(use_enable cpu_flags_x86_sse2 sse2) \
  67. $(use_enable threads) \
  68. $(use_enable static-libs static)
  69. }
  70. src_compile() {
  71. default
  72. if use doc; then
  73. cd doc || die
  74. doxygen || die "making docs failed"
  75. HTML_DOCS=( doc/html/. )
  76. fi
  77. }
  78. src_install () {
  79. default
  80. # package provides .pc files
  81. find "${D}" -name '*.la' -delete || die
  82. if use examples; then
  83. # clean out object files, executables, Makefiles
  84. # and the like before installing examples
  85. find samples/ \( -type f -executable -o -iname 'runConfigure' -o -iname '*.o' \
  86. -o -iname '.libs' -o -iname 'Makefile*' \) -exec rm -rf '{}' + || die
  87. docinto examples
  88. dodoc -r samples/.
  89. docompress -x /usr/share/doc/${PF}/examples
  90. fi
  91. # To make sure an appropriate NLS msg file is around when using
  92. # the iconv msgloader ICU has the messages compiled in.
  93. if use iconv && ! use icu; then
  94. doenvd "${FILESDIR}/50xerces-c"
  95. fi
  96. }