www-client/chromium: add patch to fix random crash in stable channel
[gentoo.git] / dev-libs / crypto++ / crypto++-8.2.0-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic toolchain-funcs
7
8 DESCRIPTION="C++ class library of cryptographic schemes"
9 HOMEPAGE="https://cryptopp.com"
10 SRC_URI="https://www.cryptopp.com/cryptopp${PV//.}.zip"
11
12 LICENSE="Boost-1.0"
13 SLOT="0/8" # subslot is so version
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x64-macos"
15 IUSE="+asm cpu_flags_x86_aes cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_pclmul cpu_flags_x86_sha cpu_flags_x86_sse2 cpu_flags_x86_sse4_2 cpu_flags_x86_ssse3 static-libs"
16
17 BDEPEND="app-arch/unzip"
18
19 S="${WORKDIR}"
20
21 PATCHES=(
22         "${FILESDIR}/${P}-build.patch"
23 )
24
25 config_add() {
26         sed -i -e "/Important Settings/a#define $1 1" config.h || die
27 }
28
29 pkg_setup() {
30         export CXX="$(tc-getCXX)"
31         export LIBDIR="${EPREFIX}/usr/$(get_libdir)"
32         export PREFIX="${EPREFIX}/usr"
33 }
34
35 src_prepare() {
36         default
37
38         use asm || config_add CRYPTOPP_DISABLE_ASM
39         use cpu_flags_x86_aes || config_add CRYPTOPP_DISABLE_AESNI
40         use cpu_flags_x86_avx || config_add CRYPTOPP_DISABLE_AVX
41         use cpu_flags_x86_avx2 || config_add CRYPTOPP_DISABLE_AVX2
42         use cpu_flags_x86_pclmul || config_add CRYPTOPP_DISABLE_CLMUL
43         use cpu_flags_x86_sha || config_add CRYPTOPP_DISABLE_SHANI
44         use cpu_flags_x86_sse2 || config_add CRYPTOPP_DISABLE_SSE2
45         use cpu_flags_x86_sse4_2 || config_add CRYPTOPP_DISABLE_SSE4
46         use cpu_flags_x86_ssse3 || config_add CRYPTOPP_DISABLE_SSSE3
47
48         # ASM isn't Darwin/Mach-O ready, #479554, buildsys doesn't grok CPPFLAGS
49         [[ ${CHOST} == *-darwin* ]] && config_add CRYPTOPP_DISABLE_ASM
50 }
51
52 src_compile() {
53         emake -f GNUmakefile all shared libcryptopp.pc
54 }
55
56 src_install() {
57         default
58
59         use static-libs || rm -f "${ED}${EPREFIX}"/usr/$(get_libdir)/*.a
60 }