a3b714e5e54aec1b86b60b3351b5425ec0b8f7af
[gentoo.git] / dev-libs / nettle / nettle-3.3-r2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools multilib-build multilib-minimal multilib toolchain-funcs
7
8 DESCRIPTION="Low-level cryptographic library"
9 HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
10 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
11
12 LICENSE="|| ( LGPL-3 LGPL-2.1 )"
13 SLOT="0/6.1" # subslot = libnettle soname version, .1 as broke ABI bug#601512
14 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
16
17 DEPEND="gmp? ( >=dev-libs/gmp-5.0:0=[${MULTILIB_USEDEP}] )"
18 RDEPEND="${DEPEND}
19         abi_x86_32? (
20                 !<=app-emulation/emul-linux-x86-baselibs-20131008-r17
21                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
22         )"
23
24 MULTILIB_WRAPPED_HEADERS=(
25         /usr/include/nettle/nettle-stdint.h
26         /usr/include/nettle/version.h
27 )
28
29 DOCS=()
30 HTML_DOCS=()
31
32 PATCHES=(
33         "${FILESDIR}/${P}-ecc-add-eh.patch"
34 )
35
36 pkg_setup() {
37         use doc && DOCS+=(
38                 nettle.pdf
39         )
40         use doc && HTML_DOCS+=(
41                 nettle.html
42         )
43 }
44
45 src_prepare() {
46         default
47
48         sed -e '/CFLAGS=/s: -ggdb3::' \
49                 -e 's/solaris\*)/sunldsolaris*)/' \
50                 -i configure.ac || die
51
52         # conditionally build tests and examples required by tests
53         use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
54
55         eautoreconf
56 }
57
58 multilib_src_configure() {
59         # --disable-openssl bug #427526
60         ECONF_SOURCE="${S}" econf \
61                 --libdir="${EPREFIX}"/usr/$(get_libdir) \
62                 --disable-openssl \
63                 --disable-fat \
64                 $(use_enable gmp public-key) \
65                 $(use_enable static-libs static) \
66                 $(tc-is-static-only && echo --disable-shared) \
67                 $(use_enable doc documentation) \
68                 $(use_enable neon arm-neon) \
69                 $(use_enable cpu_flags_x86_aes x86-aesni)
70 }