summaryrefslogtreecommitdiff
blob: a7936e1d8eabf2805aabb1ab80b19de84628d63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="Elliptic Curve Method for Integer Factorization"
HOMEPAGE="http://ecm.gforge.inria.fr/"
#SRC_URI="https://gforge.inria.fr/frs/download.php/30965/${P}.tar.gz"
ESVN_REPO_URI="svn://scm.gforge.inria.fr/svnroot/ecm/trunk"

inherit autotools eutils flag-o-matic subversion

LICENSE="GPL-3 LGPL-3"
SLOT="0"
KEYWORDS=""
IUSE="blas gwnum -openmp test"

DEPEND="
	dev-libs/gmp:0=
	blas? ( sci-libs/gsl )
	gwnum? ( sci-mathematics/gwnum )
	openmp? ( sys-devel/gcc:*[openmp] )"
RDEPEND="${DEPEND}"

# can't be both enabled
REQUIRED_USE="gwnum? ( !openmp )"

S=${WORKDIR}/ecm-${PV}

MAKEOPTS+=" -j1"

src_prepare() {
	eautoreconf
}

src_configure() {
	if use gwnum; then myconf="--with-gwnum=/usr/lib"; fi
	# --enable-shellcmd is broken
	econf $(use_enable openmp) $myconf
}

src_compile() {
	append-ldflags "-Wl,-z,noexecstack"
	# the custom-tune bits are obsoleted with sane defaults
	default
}

src_install() {
	default
	mkdir -p "${D}/usr/include/${PN}/"
	cp "${S}"/*.h "${D}/usr/include/${PN}" || die "Failed to copy headers" # needed by other apps like YAFU
}