1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit flag-o-matic toolchain-funcs
9 DESCRIPTION="C++ class library of cryptographic schemes"
10 HOMEPAGE="http://cryptopp.com"
11 SRC_URI="mirror://sourceforge/cryptopp/cryptopp${PV//.}.zip"
14 SLOT="0/5.6" # subslot is so version
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x64-macos"
18 DEPEND="app-arch/unzip"
23 "${FILESDIR}/${P}-nonative.patch"
27 export CXX="$(tc-getCXX)"
28 export LIBDIR="${EPREFIX}/usr/$(get_libdir)"
29 export PREFIX="${EPREFIX}/usr"
34 cp config.recommend config.h || die
38 # higher optimizations cause problems
40 # ASM isn't Darwin/Mach-O ready, #479554, buildsys doesn't grok CPPFLAGS
41 [[ ${CHOST} == *-darwin* ]] && append-flags -DCRYPTOPP_DISABLE_X86ASM
43 emake -f GNUmakefile all shared
47 # ensure that all test vectors have Unix line endings
49 for file in TestVectors/* ; do
54 eerror "Crypto++ self-tests failed."
55 eerror "Try to remove some optimization flags and reemerge Crypto++."
56 die "emake test failed"
63 # remove leftovers as build system sucks
64 rm -fr "${ED}"/usr/bin "${ED}"/usr/share/cryptopp
65 use static-libs || rm -f "${ED}${EPREFIX}"/usr/$(get_libdir)/*.a
68 dosym cryptopp "${EPREFIX}"/usr/include/crypto++
69 for f in "${ED}${EPREFIX}"/usr/$(get_libdir)/*; do
70 ln -s "$(basename "${f}")" "$(echo "${f}" | sed 's/cryptopp/crypto++/')" || die
75 # we switched directory to symlink
76 # make sure portage digests that
77 rm -fr "${EROOT}/usr/include/crypto++"
78 rm -fr "${EROOT}/usr/include/cryptopp"