net-libs/gnutls: arm stable wrt bug #715602
[gentoo.git] / net-libs / gnutls / gnutls-3.6.13.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit libtool multilib-minimal
7
8 DESCRIPTION="A TLS 1.2 and SSL 3.0 implementation for the GNU project"
9 HOMEPAGE="http://www.gnutls.org/"
10 SRC_URI="mirror://gnupg/gnutls/v$(ver_cut 1-2)/${P}.tar.xz"
11
12 LICENSE="GPL-3 LGPL-2.1+"
13 SLOT="0/30" # libgnutls.so number
14 KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="+cxx dane doc examples guile +idn nls +openssl pkcs11 seccomp sslv2 sslv3 static-libs test test-full +tls-heartbeat tools valgrind"
16
17 REQUIRED_USE="
18         test-full? ( cxx dane doc examples guile idn nls openssl pkcs11 seccomp tls-heartbeat tools )"
19 RESTRICT="!test? ( test )"
20
21 # NOTICE: sys-devel/autogen is required at runtime as we
22 # use system libopts
23 RDEPEND=">=dev-libs/libtasn1-4.9:=[${MULTILIB_USEDEP}]
24         dev-libs/libunistring:=[${MULTILIB_USEDEP}]
25         >=dev-libs/nettle-3.4.1:=[gmp,${MULTILIB_USEDEP}]
26         >=dev-libs/gmp-5.1.3-r1:=[${MULTILIB_USEDEP}]
27         tools? ( sys-devel/autogen:= )
28         dane? ( >=net-dns/unbound-1.4.20:=[${MULTILIB_USEDEP}] )
29         guile? ( >=dev-scheme/guile-2:=[networking] )
30         nls? ( >=virtual/libintl-0-r1:=[${MULTILIB_USEDEP}] )
31         pkcs11? ( >=app-crypt/p11-kit-0.23.1:=[${MULTILIB_USEDEP}] )
32         idn? ( >=net-dns/libidn2-0.16-r1:=[${MULTILIB_USEDEP}] )"
33 DEPEND="${RDEPEND}
34         test? (
35                 seccomp? ( sys-libs/libseccomp )
36         )"
37 BDEPEND=">=virtual/pkgconfig-0-r1
38         doc? ( dev-util/gtk-doc )
39         nls? ( sys-devel/gettext )
40         tools? ( sys-devel/autogen )
41         valgrind? ( dev-util/valgrind )
42         test-full? (
43                 app-crypt/dieharder
44                 >=app-misc/datefudge-1.22
45                 dev-libs/softhsm:2[-bindist]
46                 net-dialup/ppp
47                 net-misc/socat
48         )"
49
50 DOCS=(
51         README.md
52         doc/certtool.cfg
53 )
54
55 HTML_DOCS=()
56
57 pkg_setup() {
58         # bug#520818
59         export TZ=UTC
60
61         use doc && HTML_DOCS+=(
62                 doc/gnutls.html
63         )
64 }
65
66 src_prepare() {
67         default
68
69         # force regeneration of autogen-ed files
70         local file
71         for file in $(grep -l AutoGen-ed src/*.c) ; do
72                 rm src/$(basename ${file} .c).{c,h} || die
73         done
74
75         # Use sane .so versioning on FreeBSD.
76         elibtoolize
77 }
78
79 multilib_src_configure() {
80         LINGUAS="${LINGUAS//en/en@boldquot en@quot}"
81
82         local libconf=()
83
84         # TPM needs to be tested before being enabled
85         libconf+=( --without-tpm )
86
87         # hardware-accell is disabled on OSX because the asm files force
88         #   GNU-stack (as doesn't support that) and when that's removed ld
89         #   complains about duplicate symbols
90         [[ ${CHOST} == *-darwin* ]] && libconf+=( --disable-hardware-acceleration )
91
92         # Cygwin as does not understand these asm files at all
93         [[ ${CHOST} == *-cygwin* ]] && libconf+=( --disable-hardware-acceleration )
94
95         local myeconfargs=(
96                 $(multilib_native_enable manpages)
97                 $(multilib_native_use_enable doc gtk-doc)
98                 $(multilib_native_use_enable doc)
99                 $(multilib_native_use_enable guile)
100                 $(multilib_native_use_enable seccomp seccomp-tests)
101                 $(multilib_native_use_enable test tests)
102                 $(multilib_native_use_enable test-full full-test-suite)
103                 $(multilib_native_use_enable tools)
104                 $(multilib_native_use_enable valgrind valgrind-tests)
105                 $(use_enable cxx)
106                 $(use_enable dane libdane)
107                 $(use_enable nls)
108                 $(use_enable openssl openssl-compatibility)
109                 $(use_enable sslv2 ssl2-support)
110                 $(use_enable sslv3 ssl3-support)
111                 $(use_enable static-libs static)
112                 $(use_enable tls-heartbeat heartbeat-support)
113                 $(use_with idn)
114                 $(use_with pkcs11 p11-kit)
115                 --disable-rpath
116                 --with-default-trust-store-file="${EPREFIX}/etc/ssl/certs/ca-certificates.crt"
117                 --with-unbound-root-key-file="${EPREFIX}/etc/dnssec/root-anchors.txt"
118                 --without-included-libtasn1
119                 $("${S}/configure" --help | grep -o -- '--without-.*-prefix')
120         )
121         ECONF_SOURCE="${S}" econf "${libconf[@]}" "${myeconfargs[@]}"
122 }
123
124 multilib_src_install_all() {
125         einstalldocs
126         find "${ED}" -type f -name '*.la' -delete || die
127
128         if use examples; then
129                 docinto examples
130                 dodoc doc/examples/*.c
131         fi
132 }