1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs
8 DESCRIPTION="C++ class library of cryptographic schemes"
9 HOMEPAGE="http://cryptopp.com"
10 SRC_URI="https://www.cryptopp.com/cryptopp${PV//.}.zip"
13 SLOT="0/5.6" # subslot is so version
14 KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ppc ppc64 sparc x86 ~x64-macos"
17 DEPEND="app-arch/unzip"
22 "${FILESDIR}/${PN}-5.6.4-nonative.patch"
26 export CXX="$(tc-getCXX)"
27 export LIBDIR="${EPREFIX}/usr/$(get_libdir)"
28 export PREFIX="${EPREFIX}/usr"
32 # higher optimizations cause problems
34 # ASM isn't Darwin/Mach-O ready, #479554, buildsys doesn't grok CPPFLAGS
35 [[ ${CHOST} == *-darwin* ]] && append-cxxflags -DCRYPTOPP_DISABLE_ASM
37 emake -f GNUmakefile all shared
43 # remove leftovers as build system sucks
44 rm -fr "${ED}"/usr/bin "${ED}"/usr/share/cryptopp
45 use static-libs || rm -f "${ED}${EPREFIX}"/usr/$(get_libdir)/*.a
48 dosym cryptopp "${EPREFIX}"/usr/include/crypto++
49 for f in "${ED}${EPREFIX}"/usr/$(get_libdir)/*; do
50 ln -s "$(basename "${f}")" "$(echo "${f}" | sed 's/cryptopp/crypto++/')" || die
55 # we switched directory to symlink
56 # make sure portage digests that
57 rm -fr "${EROOT}/usr/include/crypto++"
58 rm -fr "${EROOT}/usr/include/cryptopp"