1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils toolchain-funcs
8 DESCRIPTION="A C library implementing a suite of algorithms to factor large integers"
9 HOMEPAGE="https://sourceforge.net/projects/msieve/"
10 SRC_URI="mirror://sourceforge/${PN}/${PN}/Msieve%20v${PV}/${PN}${PV/./}.tar.gz"
12 LICENSE="public-domain"
14 KEYWORDS="~amd64 ~x86"
18 ecm? ( sci-mathematics/gmp-ecm )
20 zlib? ( sys-libs/zlib )"
24 # TODO: Integrate ggnfs properly
26 "${FILESDIR}"/${P}-reduce-printf.patch \
27 "${FILESDIR}"/fix-version.patch \
28 "${FILESDIR}"/fix-version2.patch
29 sed -i -e 's/-march=k8//' Makefile || die
30 sed -i -e 's/CC =/#CC =/' Makefile || die
31 sed -i -e 's/CFLAGS =/CFLAGS +=/' Makefile || die
32 sed -i -e 's/LIBS += -lecm/LIBS += -lecm -lgomp/' Makefile || die
36 use ecm && export "ECM=1"
37 use mpi && export "MPI=1"
38 use zlib && export "ZLIB=1"
42 OPT_FLAGS="${CFLAGS}" \
47 mkdir -p "${D}/usr/include/msieve"
48 mkdir -p "${D}/usr/lib/"
49 mkdir -p "${D}/usr/share/doc/${P}/"
50 cp include/* "${D}/usr/include/msieve" || die "Failed to install"
51 cp libmsieve.a "${D}/usr/lib/" || die "Failed to install"
52 dobin msieve || die "Failed to install"
53 cp Readme* "${D}/usr/share/doc/${P}/" || die "Failed to install"