yap-6.3.3.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic java-pkg-opt-2 multilib
  5. PATCHSET_VER="9"
  6. DESCRIPTION="YAP is a high-performance Prolog compiler"
  7. HOMEPAGE="http://www.dcc.fc.up.pt/~vsc/Yap/"
  8. SRC_URI="http://www.dcc.fc.up.pt/~vsc/Yap/${P}.tar.gz
  9. mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
  10. LICENSE="Artistic LGPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 ppc x86"
  13. IUSE="R debug doc examples gmp java mpi mysql odbc readline static threads"
  14. RDEPEND="sys-libs/zlib
  15. gmp? ( dev-libs/gmp:0 )
  16. java? ( >=virtual/jdk-1.4:= )
  17. mpi? ( virtual/mpi )
  18. mysql? ( virtual/mysql )
  19. odbc? ( dev-db/unixODBC )
  20. readline? ( sys-libs/readline:= sys-libs/ncurses:= )
  21. R? ( dev-lang/R )"
  22. DEPEND="${RDEPEND}
  23. doc? ( app-text/texi2html )"
  24. src_prepare() {
  25. cd "${WORKDIR}"
  26. EPATCH_FORCE=yes
  27. EPATCH_SUFFIX=patch
  28. epatch "${WORKDIR}"/${PV}
  29. rm -rf "${S}"/yap || die "failed to remove yap xcode project"
  30. }
  31. src_configure() {
  32. append-flags -fno-strict-aliasing
  33. local myddas_conf
  34. if use mysql || use odbc; then
  35. myddas_conf="--enable-myddas"
  36. else
  37. myddas_conf="--disable-myddas"
  38. fi
  39. if use mysql; then
  40. myddas_conf="$myddas_conf yap_with_mysql=yes"
  41. fi
  42. if use odbc; then
  43. myddas_conf="$myddas_conf yap_with_odbc=yes"
  44. fi
  45. econf \
  46. --libdir=/usr/$(get_libdir) \
  47. --disable-prism \
  48. --disable-gecode \
  49. $(use_enable !static dynamic-loading) \
  50. $(use_enable threads) \
  51. $(use_enable threads pthread-locking) \
  52. $(use_enable debug debug-yap) \
  53. $(use_enable debug low-level-tracer) \
  54. $(use_with gmp) \
  55. $(use_with readline) \
  56. $(use_with mpi) \
  57. $(use_with mpi mpe) \
  58. $(use_with java) \
  59. $(use_with R) \
  60. ${myddas_conf}
  61. }
  62. src_compile() {
  63. emake || die "emake failed"
  64. if use doc ; then
  65. emake html || die "emake html failed"
  66. fi
  67. }
  68. src_test() {
  69. # libtai package contains check.c which confuses the default
  70. # src_test() function
  71. true
  72. }
  73. src_install() {
  74. emake DESTDIR="${D}" install || die "make install failed."
  75. dodoc changes*.html README || die
  76. if use doc ; then
  77. dodoc yap.html || die
  78. fi
  79. if use examples ; then
  80. insinto /usr/share/doc/${PF}/examples/chr
  81. doins packages/chr/Examples/* || die
  82. insinto /usr/share/doc/${PF}/examples/clib
  83. doins packages/clib/demo/* || die
  84. insinto /usr/share/doc/${PF}/examples/http
  85. doins -r packages/http/examples/* || die
  86. insinto /usr/share/doc/${PF}/examples/plunit
  87. doins packages/plunit/examples/* || die
  88. if use java ; then
  89. insinto /usr/share/doc/${PF}/examples/jpl/prolog
  90. doins packages/jpl/examples/prolog/* || die
  91. insinto /usr/share/doc/${PF}/examples/jpl/java
  92. doins packages/jpl/examples/java/README || die
  93. doins -r packages/jpl/examples/java/*/*.{java,pl} || die
  94. fi
  95. if use mpi ; then
  96. insinto /usr/share/doc/${PF}/examples/mpi
  97. doins library/mpi/examples/*.pl || die
  98. fi
  99. fi
  100. }