blob: 8d00f169d7f45c71ae3314fa2fba56202e55affe (
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
53
54
55
56
57
|
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/ggnfs/ggnfs-0.77.1-r1.ebuild,v 1.1 2012/11/30 06:36:46 patrick Exp $
EAPI=4
DESCRIPTION="A suite of algorithms to help factoring large integers"
# inactive old homepage exists, this is a fork
HOMEPAGE="https://github.com/radii/ggnfs"
# snapshot because github makes people stupid
SRC_URI="http://dev.gentooexperimental.org/~dreeevil/${P}.zip
http://stuff.mit.edu/afs/sipb/project/pari-gp/ggnfs/Linux/src/def-par.txt"
inherit eutils
LICENSE="GPL-2"
SLOT="0"
# Need to test if it actually compiles on x86
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}
!sci-mathematics/cado-nfs" # file collisions, fixable
S=${WORKDIR}/${PN}-master
src_prepare() {
echo "#define GGNFS_VERSION \"0.77.1-$ARCH\"" > include/version.h
# fix directory symlink, add missing targets, rewrite variable used by portage internally
cd src/lasieve4 && rm -f -r asm && ln -s ppc32 asm || die
sed -i -e 's/all: liblasieve.a/all: liblasieve.a liblasieveI11.a liblasieveI15.a liblasieveI16.a/' asm/Makefile || die
cd "${S}"
sed -i -e 's/ARCH/MARCH/g' Makefile src/Makefile || die
sed -i -e 's/$(LSBINS) strip/$(LSBINS)/' src/Makefile || die #No stripping!
}
src_configure() { :; }
src_compile() {
# setting MARCH like this is fugly, but it uses -march=$ARCH - better fix welcome
# it also assumes a recent-ish compiler
cd src
HOST="generic" MARCH="native" emake -j1
}
src_install() {
mkdir -p "${D}/usr/bin/"
for i in gnfs-lasieve4I11e gnfs-lasieve4I12e gnfs-lasieve4I13e gnfs-lasieve4I14e \
gnfs-lasieve4I15e gnfs-lasieve4I16e makefb matbuild matprune matsolve pol51m0b pol51m0n \
pol51opt polyselect procrels sieve sqrt; do
cp "${S}/bin/${i}" "${D}/usr/bin/" || die
done
mkdir -p "${D}/usr/share/doc/${PN}"
cp "${DISTDIR}/def-par.txt" "${D}/usr/share/doc/${PN}" || die "FAIL"
docompress -x "/usr/share/doc/${PN}/def-par.txt" || die
# TODO: docs? File collisions?
}
|