flint-2.4.5.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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? (
  19. app-text/texlive-core
  20. dev-texlive/texlive-latex
  21. dev-texlive/texlive-latexextra
  22. )"
  23. src_prepare() {
  24. epatch "${FILESDIR}"/${PN}-2.4.3-libdir.patch \
  25. "${FILESDIR}"/${PN}-2.4.3-whitespaces.patch \
  26. "${FILESDIR}"/${PN}-2.4.3-cflags-ldflags.patch \
  27. "${FILESDIR}"/${PN}-2.4.4-test.patch \
  28. "${FILESDIR}"/${PN}-2.4.5-gmp6-compat.patch \
  29. "${FILESDIR}"/${PN}-2.4.5-ntl62.patch
  30. }
  31. src_configure() {
  32. ./configure \
  33. --prefix="${EPREFIX}/usr" \
  34. --with-gmp="${EPREFIX}/usr" \
  35. --with-mpfr="${EPREFIX}/usr" \
  36. $(usex ntl "--with-ntl=${EPREFIX}/usr" "") \
  37. $(use_enable static-libs static) \
  38. $(usex gc "--with-gc=${EPREFIX}/usr" "") \
  39. CC=$(tc-getCC) \
  40. CXX=$(tc-getCXX) \
  41. AR=$(tc-getAR) \
  42. || die
  43. }
  44. src_compile() {
  45. emake verbose
  46. if use doc ; then
  47. emake -C doc/latex
  48. fi
  49. }
  50. src_test() {
  51. emake AT= QUIET_CC= QUIET_CXX= QUIET_AR= check
  52. }
  53. src_install() {
  54. emake DESTDIR="${D}" LIBDIR="$(get_libdir)" install
  55. einstalldocs
  56. use doc && dodoc doc/latex/flint-manual.pdf
  57. }