dev-libs/libsodium: fix AES-NI support
[gentoo.git] / dev-libs / libsodium / libsodium-1.0.16-r2.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools multilib-minimal
7
8 DESCRIPTION="A portable fork of NaCl, a higher-level cryptographic library"
9 HOMEPAGE="https://github.com/jedisct1/libsodium"
10 SRC_URI="http://download.libsodium.org/${PN}/releases/${P}.tar.gz"
11
12 LICENSE="ISC"
13 SLOT="0/23"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
15 IUSE="+asm minimal static-libs +urandom cpu_flags_x86_sse4_1 cpu_flags_x86_aes"
16
17 PATCHES=( "${FILESDIR}"/${PN}-1.0.10-cpuflags.patch )
18
19 src_prepare() {
20         default
21         eautoreconf
22 }
23
24 multilib_src_configure() {
25         local ECONF_SOURCE="${S}"
26         local myconf
27
28         # --disable-pie is needed on x86, see bug #512734
29         if [[ "${MULTILIB_ABI_FLAG}" == "abi_x86_32" ]]; then
30                 myconf="${myconf} --disable-pie"
31         fi
32
33         econf \
34                 $(use_enable asm) \
35                 $(use_enable minimal) \
36                 $(use_enable !urandom blocking-random) \
37                 $(use_enable static-libs static) \
38                 $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
39                 $(use_enable cpu_flags_x86_aes aesni) \
40                 ${myconf}
41 }
42
43 multilib_src_install_all() {
44         einstalldocs
45         find "${D}" -name "*.la" -delete || die
46 }