flint-2.4.3.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils multilib toolchain-funcs
  5. DESCRIPTION="Fast Library for Number Theory"
  6. HOMEPAGE="http://www.flintlib.org/"
  7. SRC_URI="http://www.flintlib.org/${P}.tar.gz"
  8. RESTRICT="mirror"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="doc gc ntl static-libs test"
  13. RDEPEND="dev-libs/gmp:0=
  14. dev-libs/mpfr:0
  15. gc? ( dev-libs/boehm-gc )
  16. ntl? ( dev-libs/ntl )"
  17. DEPEND="${RDEPEND}
  18. doc? ( app-text/texlive-core )"
  19. src_prepare() {
  20. epatch "${FILESDIR}"/${PN}-2.4.3-libdir.patch \
  21. "${FILESDIR}"/${PN}-2.4.3-whitespaces.patch \
  22. "${FILESDIR}"/${PN}-2.4.3-cflags-ldflags.patch
  23. }
  24. src_configure() {
  25. ./configure \
  26. --prefix="${EPREFIX}/usr" \
  27. --with-gmp="${EPREFIX}/usr" \
  28. --with-mpfr="${EPREFIX}/usr" \
  29. $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
  30. $(use_enable static-libs static) \
  31. $(usex gc "--with-gc=${EPREFIX}/usr" "") \
  32. CC=$(tc-getCC) \
  33. CXX=$(tc-getCXX) \
  34. AR=$(tc-getAR) \
  35. || die
  36. }
  37. src_compile() {
  38. emake verbose
  39. if use doc ; then
  40. emake -C doc/latex
  41. fi
  42. }
  43. src_test() {
  44. emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
  45. }
  46. src_install() {
  47. emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
  48. einstalldocs
  49. use doc && dodoc doc/latex/flint-manual.pdf
  50. }