1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit toolchain-funcs
7 DESCRIPTION="High-performance and portable C++ number theory library"
8 HOMEPAGE="https://www.shoup.net/ntl/"
9 SRC_URI="https://www.shoup.net/ntl/${P}.tar.gz"
13 KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
14 IUSE="bindist doc static-libs threads cpu_flags_x86_avx2"
16 BDEPEND="dev-lang/perl"
17 DEPEND="dev-libs/gmp:0=
19 threads? ( >=dev-libs/gf2x-1.2 )"
22 S="${WORKDIR}/${P}/src"
24 REQUIRED_USE="bindist? ( !cpu_flags_x86_avx2 )"
26 DOCS=( "${WORKDIR}/${P}"/README )
29 # Currently the build system can build a static library or both
30 # static and shared libraries, but not only shared libraries. The
31 # name NTL_GMP_LIP is *not* a typo.
33 PREFIX="${EPREFIX}"/usr \
34 LIBDIR="${EPREFIX}"/usr/$(get_libdir) \
35 CXXFLAGS="${CXXFLAGS}" \
36 CPPFLAGS="${CPPFLAGS}" \
37 LDFLAGS="${LDFLAGS}" \
40 RANLIB="$(tc-getRANLIB)" \
44 NTL_THREADS=$(usex threads on off) \
45 NTL_ENABLE_AVX_FFT=$(usex cpu_flags_x86_avx2 on off) \
46 NATIVE=$(usex bindist off on) \
47 || die "DoConfig failed"
50 DOCS+=( "${WORKDIR}/${P}"/doc/*.txt )
51 HTML_DOCS=( "${WORKDIR}/${P}"/doc/*.html "${WORKDIR}/${P}"/doc/*.gif )
57 if ! use static-libs; then
58 rm "${ED}/usr/$(get_libdir)"/libntl.{la,a} || die
61 rm -r "${ED}"/usr/share/doc/NTL || die