bc8c3cb23df20020d9eee7ffde1c48fd45e3e2a7
[gentoo.git] / dev-libs / crypto++ / crypto++-8.2.0.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 static-libs"
16
17 BDEPEND="app-arch/unzip"
18
19 S="${WORKDIR}"
20
21 config_uncomment() {
22         sed -i -e "s://\s*\(#define\s*$1\):\1:" config.h || die
23 }
24
25 pkg_setup() {
26         export CXX="$(tc-getCXX)"
27         export LIBDIR="${EPREFIX}/usr/$(get_libdir)"
28         export PREFIX="${EPREFIX}/usr"
29 }
30
31 src_prepare() {
32         default
33
34         use asm || config_uncomment CRYPTOPP_DISABLE_ASM
35
36         # ASM isn't Darwin/Mach-O ready, #479554, buildsys doesn't grok CPPFLAGS
37         [[ ${CHOST} == *-darwin* ]] && config_uncomment CRYPTOPP_DISABLE_ASM
38 }
39
40 src_compile() {
41         emake -f GNUmakefile all shared libcryptopp.pc
42 }
43
44 src_install() {
45         default
46
47         use static-libs || rm -f "${ED}${EPREFIX}"/usr/$(get_libdir)/*.a
48 }