msieve-9999.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils subversion toolchain-funcs
  5. DESCRIPTION="A C library implementing a suite of algorithms to factor large integers"
  6. HOMEPAGE="https://sourceforge.net/projects/msieve/"
  7. #SRC_URI="mirror://sourceforge/${PN}/${PN}/Msieve%20v${PV}/${PN}${PV/./}src.tar.gz"
  8. ESVN_REPO_URI="https://svn.code.sf.net/p/msieve/code/trunk"
  9. LICENSE="public-domain"
  10. SLOT="0"
  11. KEYWORDS=""
  12. IUSE="zlib +ecm mpi"
  13. # some linking troubles with gwnum
  14. DEPEND="
  15. ecm? ( sci-mathematics/gmp-ecm[-gwnum] )
  16. mpi? ( virtual/mpi )
  17. zlib? ( sys-libs/zlib )"
  18. RDEPEND="${DEPEND}"
  19. src_prepare() {
  20. # TODO: Integrate ggnfs properly
  21. sed -i -e 's/-march=k8//' Makefile || die
  22. sed -i -e 's/CC =/#CC =/' Makefile || die
  23. sed -i -e 's/CFLAGS =/CFLAGS +=/' Makefile || die
  24. }
  25. src_compile() {
  26. use ecm && export "ECM=1"
  27. use mpi && export "MPI=1"
  28. use zlib && export "ZLIB=1"
  29. emake \
  30. CC=$(tc-getCC) \
  31. AR=$(tc-getAR) \
  32. OPT_FLAGS="${CFLAGS}" \
  33. all
  34. }
  35. src_install() {
  36. mkdir -p "${D}/usr/include/msieve"
  37. mkdir -p "${D}/usr/lib/"
  38. mkdir -p "${D}/usr/share/doc/${P}/"
  39. cp include/* "${D}/usr/include/msieve" || die "Failed to install"
  40. cp libmsieve.a "${D}/usr/lib/" || die "Failed to install"
  41. dobin msieve || die "Failed to install"
  42. cp Readme* "${D}/usr/share/doc/${P}/" || die "Failed to install"
  43. }