gprolog-1.4.4.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils flag-o-matic multilib
  5. DESCRIPTION="GNU Prolog is a native Prolog compiler with constraint solving over finite domains (FD)"
  6. HOMEPAGE="http://www.gprolog.org/"
  7. SRC_URI="mirror://gnu/gprolog/${P}.tar.gz"
  8. S="${WORKDIR}"/${P}
  9. LICENSE="GPL-2 LGPL-3"
  10. SLOT="0"
  11. KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
  12. IUSE="debug doc examples"
  13. DEPEND=""
  14. RDEPEND=""
  15. src_prepare() {
  16. epatch "${FILESDIR}"/${P}-ldflags.patch
  17. epatch "${FILESDIR}"/${P}-links.patch
  18. epatch "${FILESDIR}"/${P}-nodocs.patch
  19. epatch "${FILESDIR}"/${P}-txt-file.patch
  20. }
  21. src_configure() {
  22. CFLAGS_MACHINE="`get-flag -march` `get-flag -mcpu` `get-flag -mtune`"
  23. append-flags -fno-strict-aliasing
  24. use debug && append-flags -DDEBUG
  25. if gcc-specs-pie ; then
  26. # gplc generates its own native ASM; disable PIE
  27. append-ldflags -nopie
  28. fi
  29. cd "${S}"/src
  30. econf \
  31. CFLAGS_MACHINE="${CFLAGS_MACHINE}" \
  32. --with-c-flags="${CFLAGS}" \
  33. --with-install-dir="${EPREFIX}"/usr/$(get_libdir)/${P} \
  34. --with-links-dir="${EPREFIX}"/usr/bin \
  35. $(use_with doc doc-dir ${EPREFIX}/usr/share/doc/${PF}) \
  36. $(use_with doc html-dir ${EPREFIX}/usr/share/doc/${PF}/html) \
  37. $(use_with examples examples-dir ${EPREFIX}/usr/share/doc/${PF}/examples)
  38. }
  39. src_compile() {
  40. cd "${S}"/src
  41. # gprolog is compiled using gplc which cannot be run in parallel
  42. emake -j1
  43. }
  44. src_test() {
  45. cd "${S}"/src
  46. emake -j1 check
  47. }
  48. src_install() {
  49. cd "${S}"/src
  50. emake DESTDIR="${D}" install
  51. cd "${S}"
  52. dodoc ChangeLog NEWS PROBLEMS README VERSION
  53. }