dev-libs/nettle: amd64 stable wrt bug #613846
[gentoo.git] / dev-libs / nettle / nettle-3.3-r1.ebuild
1 # Copyright 1999-2017 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 pkg_setup() {
33         use doc && DOCS+=(
34                 nettle.pdf
35         )
36         use doc && HTML_DOCS+=(
37                 nettle.html
38         )
39 }
40
41 src_prepare() {
42         default
43
44         sed -e '/CFLAGS=/s: -ggdb3::' \
45                 -e 's/solaris\*)/sunldsolaris*)/' \
46                 -i configure.ac || die
47
48         # conditionally build tests and examples required by tests
49         use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
50
51         eautoreconf
52 }
53
54 multilib_src_configure() {
55         # --disable-openssl bug #427526
56         ECONF_SOURCE="${S}" econf \
57                 --libdir="${EPREFIX}"/usr/$(get_libdir) \
58                 --disable-openssl \
59                 --disable-fat \
60                 $(use_enable gmp public-key) \
61                 $(use_enable static-libs static) \
62                 $(tc-is-static-only && echo --disable-shared) \
63                 $(use_enable doc documentation) \
64                 $(use_enable neon arm-neon) \
65                 $(use_enable cpu_flags_x86_aes x86-aesni)
66 }