1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic multilib toolchain-funcs autotools
9 DESCRIPTION="C++ class library of cryptographic schemes"
10 HOMEPAGE="http://cryptopp.com"
11 SRC_URI="mirror://sourceforge/cryptopp/cryptopp${PV//.}.zip"
15 KEYWORDS="alpha amd64 ~arm hppa ppc ppc64 sparc x86 ~x64-macos"
18 DEPEND="app-arch/unzip
24 epatch "${FILESDIR}"/${P}-r1-make.patch
25 epatch "${FILESDIR}"/${P}-cve-2015-2141.patch
27 # Generate our own libtool script for building.
28 cat <<-EOF > configure.ac
33 AC_CONFIG_FILES(Makefile)
36 touch NEWS README AUTHORS ChangeLog Makefile.am
41 econf $(use_enable static-libs static)
45 # higher optimizations cause problems
47 filter-flags -fomit-frame-pointer
48 # ASM isn't Darwin/Mach-O ready, #479554, buildsys doesn't grok CPPFLAGS
49 [[ ${CHOST} == *-darwin* ]] && append-flags -DCRYPTOPP_DISABLE_X86ASM
51 emake -f GNUmakefile CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" LIBTOOL="./libtool"
55 # ensure that all test vectors have Unix line endings
57 for file in TestVectors/* ; do
61 if ! emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" test ; then
62 eerror "Crypto++ self-tests failed."
63 eerror "Try to remove some optimization flags and reemerge Crypto++."
64 die "emake test failed"
69 emake DESTDIR="${D}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" LIBTOOL="./libtool" install
70 use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.la