dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / dev-libs / ntl / ntl-11.4.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit toolchain-funcs
6
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"
10
11 LICENSE="LGPL-2.1+"
12 SLOT="0/43"
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"
15
16 BDEPEND="dev-lang/perl"
17 DEPEND="dev-libs/gmp:0=
18         dev-libs/gf2x
19         threads? ( >=dev-libs/gf2x-1.2 )"
20 RDEPEND="${DEPEND}"
21
22 S="${WORKDIR}/${P}/src"
23
24 REQUIRED_USE="bindist? ( !cpu_flags_x86_avx2 )"
25
26 DOCS=( "${WORKDIR}/${P}"/README )
27
28 src_configure() {
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.
32         perl DoConfig \
33                 PREFIX="${EPREFIX}"/usr \
34                 LIBDIR="${EPREFIX}"/usr/$(get_libdir) \
35                 CXXFLAGS="${CXXFLAGS}" \
36                 CPPFLAGS="${CPPFLAGS}" \
37                 LDFLAGS="${LDFLAGS}" \
38                 CXX="$(tc-getCXX)" \
39                 AR="$(tc-getAR)" \
40                 RANLIB="$(tc-getRANLIB)" \
41                 SHARED=on \
42                 NTL_GMP_LIP=on \
43                 NTL_GF2X_LIB=on \
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"
48
49         if use doc; then
50                 DOCS+=( "${WORKDIR}/${P}"/doc/*.txt )
51                 HTML_DOCS=( "${WORKDIR}/${P}"/doc/*.html "${WORKDIR}/${P}"/doc/*.gif )
52         fi
53 }
54
55 src_install() {
56         default
57         if ! use static-libs; then
58                 rm "${ED}/usr/$(get_libdir)"/libntl.{la,a} || die
59         fi
60
61         rm -r "${ED}"/usr/share/doc/NTL || die
62 }