gnutls-3.3.27.ebuild 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools epunt-cxx libtool ltprune multilib-minimal versionator
  5. DESCRIPTION="A TLS 1.2 and SSL 3.0 implementation for the GNU project"
  6. HOMEPAGE="http://www.gnutls.org/"
  7. SRC_URI="mirror://gnupg/gnutls/v$(get_version_component_range 1-2)/${P}.tar.xz"
  8. # LGPL-3 for libgnutls library and GPL-3 for libgnutls-extra library.
  9. # soon to be relicensed as LGPL-2.1 unless heartbeat extension enabled.
  10. LICENSE="GPL-3 LGPL-3"
  11. SLOT="0"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
  13. IUSE_LINGUAS=" en cs de fi fr it ms nl pl sv uk vi zh_CN"
  14. IUSE="+cxx +crywrap dane doc examples guile nls +openssl pkcs11 static-libs test zlib ${IUSE_LINGUAS// / linguas_}"
  15. # heartbeat support is not disabled until re-licensing happens fullyf
  16. # NOTICE: sys-devel/autogen is required at runtime as we
  17. # use system libopts
  18. RDEPEND=">=dev-libs/libtasn1-4.3:=[${MULTILIB_USEDEP}]
  19. >=dev-libs/nettle-2.7:=[gmp,${MULTILIB_USEDEP}]
  20. >=dev-libs/gmp-5.1.3-r1:=[${MULTILIB_USEDEP}]
  21. sys-devel/autogen
  22. crywrap? ( net-dns/libidn )
  23. dane? ( >=net-dns/unbound-1.4.20[${MULTILIB_USEDEP}] )
  24. guile? ( >=dev-scheme/guile-1.8:=[networking] )
  25. nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
  26. pkcs11? ( >=app-crypt/p11-kit-0.20.7[${MULTILIB_USEDEP}] )
  27. zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
  28. abi_x86_32? (
  29. !<=app-emulation/emul-linux-x86-baselibs-20140508
  30. !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
  31. )"
  32. DEPEND="${RDEPEND}
  33. >=sys-devel/automake-1.11.6
  34. >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
  35. doc? (
  36. sys-apps/texinfo
  37. dev-util/gtk-doc
  38. )
  39. nls? ( sys-devel/gettext )
  40. test? ( app-misc/datefudge )"
  41. DOCS=( AUTHORS ChangeLog NEWS README THANKS doc/TODO )
  42. PATCHES=(
  43. "${FILESDIR}/${PN}-3.3.19-build-allow-installing-man-1-even-with-disable-doc.patch"
  44. )
  45. pkg_setup() {
  46. # bug#520818
  47. export TZ=UTC
  48. }
  49. src_prepare() {
  50. default
  51. sed -i \
  52. -e 's/imagesdir = $(infodir)/imagesdir = $(htmldir)/' \
  53. doc/Makefile.am || die
  54. # force regeneration of autogen-ed files
  55. local file
  56. for file in $(grep -l AutoGen-ed src/*.c) ; do
  57. rm src/$(basename ${file} .c).{c,h} || die
  58. done
  59. # force regeneration of makeinfo files
  60. # have no idea why on some system these files are not
  61. # accepted as-is, see bug#520818
  62. for file in $(grep -l "produced by makeinfo" doc/*.info) ; do
  63. rm "${file}" || die
  64. done
  65. eautoreconf
  66. # Use sane .so versioning on FreeBSD.
  67. elibtoolize
  68. # bug 497472
  69. use cxx || epunt_cxx
  70. }
  71. multilib_src_configure() {
  72. LINGUAS="${LINGUAS//en/en@boldquot en@quot}"
  73. # remove magic of library detection
  74. # bug#438222
  75. libconf=($("${S}/configure" --help | grep -- '--without-.*-prefix' | sed -e 's/^ *\([^ ]*\) .*/\1/g'))
  76. # TPM needs to be tested before being enabled
  77. # hardware-accell is disabled on OSX because the asm files force
  78. # GNU-stack (as doesn't support that) and when that's removed ld
  79. # complains about duplicate symbols
  80. ECONF_SOURCE=${S} \
  81. econf \
  82. --disable-valgrind-tests \
  83. --without-included-libtasn1 \
  84. --enable-heartbeat-support \
  85. $(use_enable cxx) \
  86. $(use_enable dane libdane) \
  87. $(multilib_native_enable manpages) \
  88. $(multilib_native_use_enable doc) \
  89. $(multilib_native_use_enable doc gtk-doc) \
  90. $(multilib_native_use_enable guile) \
  91. $(multilib_native_use_enable crywrap) \
  92. $(use_enable nls) \
  93. $(use_enable openssl openssl-compatibility) \
  94. $(use_enable static-libs static) \
  95. $(use_with pkcs11 p11-kit) \
  96. $(use_with zlib) \
  97. --without-tpm \
  98. --with-unbound-root-key-file=/etc/dnssec/root-anchors.txt \
  99. "${libconf[@]}" \
  100. $([[ ${CHOST} == *-darwin* ]] && echo --disable-hardware-acceleration)
  101. if multilib_is_native_abi; then
  102. ln -s "${S}"/doc/reference/html doc/reference/html || die
  103. fi
  104. }
  105. multilib_src_compile() {
  106. if multilib_is_native_abi; then
  107. default
  108. # symlink certtool for use in other ABIs
  109. if use test; then
  110. ln -s "${BUILD_DIR}"/src "${T}"/native-tools || die
  111. fi
  112. else
  113. emake -C gl
  114. emake -C lib
  115. emake -C extra
  116. use dane && emake -C libdane
  117. fi
  118. }
  119. multilib_src_test() {
  120. if multilib_is_native_abi; then
  121. # parallel testing often fails
  122. emake -j1 check
  123. else
  124. # use native ABI tools
  125. ln -s "${T}"/native-tools/{certtool,gnutls-{serv,cli}} \
  126. "${BUILD_DIR}"/src/ || die
  127. emake -C gl -j1 check
  128. emake -C tests -j1 check
  129. fi
  130. }
  131. multilib_src_install() {
  132. if multilib_is_native_abi; then
  133. emake DESTDIR="${D}" install
  134. else
  135. emake -C lib DESTDIR="${D}" install
  136. emake -C extra DESTDIR="${D}" install
  137. use dane && emake -C libdane DESTDIR="${D}" install
  138. fi
  139. }
  140. multilib_src_install_all() {
  141. einstalldocs
  142. prune_libtool_files --all
  143. dodoc doc/certtool.cfg
  144. if use doc; then
  145. dohtml doc/gnutls.html
  146. else
  147. rm -fr "${ED}/usr/share/doc/${PF}/html"
  148. fi
  149. if use examples; then
  150. docinto examples
  151. dodoc doc/examples/*.c
  152. fi
  153. }