dev-libs/crypto++: rename to force bump
[gentoo.git] / dev-libs / crypto++ / crypto++-5.6.2-r3.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit eutils flag-o-matic multilib toolchain-funcs autotools
8
9 DESCRIPTION="C++ class library of cryptographic schemes"
10 HOMEPAGE="http://cryptopp.com"
11 SRC_URI="mirror://sourceforge/cryptopp/cryptopp${PV//.}.zip"
12
13 LICENSE="Boost-1.0"
14 SLOT="0"
15 KEYWORDS="alpha amd64 ~arm hppa ppc ppc64 sparc x86 ~x64-macos"
16 IUSE="static-libs"
17
18 DEPEND="app-arch/unzip
19         sys-devel/libtool"
20
21 S="${WORKDIR}"
22
23 src_prepare() {
24         epatch "${FILESDIR}"/${P}-r1-make.patch
25         epatch "${FILESDIR}"/${P}-cve-2015-2141.patch
26
27         # Generate our own libtool script for building.
28         cat <<-EOF > configure.ac
29         AC_INIT(lt, 0)
30         AM_INIT_AUTOMAKE
31         AC_PROG_CXX
32         LT_INIT
33         AC_CONFIG_FILES(Makefile)
34         AC_OUTPUT
35         EOF
36         touch NEWS README AUTHORS ChangeLog Makefile.am
37         eautoreconf
38 }
39
40 src_configure() {
41         econf $(use_enable static-libs static)
42 }
43
44 src_compile() {
45         # higher optimizations cause problems
46         replace-flags -O? -O1
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
50
51         emake -f GNUmakefile CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" LIBTOOL="./libtool"
52 }
53
54 src_test() {
55         # ensure that all test vectors have Unix line endings
56         local file
57         for file in TestVectors/* ; do
58                 edos2unix ${file}
59         done
60
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"
65         fi
66 }
67
68 src_install() {
69         emake DESTDIR="${D}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" LIBTOOL="./libtool" install
70         use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.la
71 }