xsb-3.6.0.ebuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. MY_P="XSB${PV//./}"
  5. PATCHSET_VER="2"
  6. inherit eutils autotools java-pkg-opt-2
  7. DESCRIPTION="XSB is a logic programming and deductive database system"
  8. HOMEPAGE="http://xsb.sourceforge.net"
  9. SRC_URI="http://xsb.sourceforge.net/downloads/${MY_P}.tar.gz
  10. mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
  11. LICENSE="GPL-2 LGPL-2"
  12. SLOT="0"
  13. KEYWORDS="amd64 x86"
  14. IUSE="curl debug iodbc java mysql odbc pcre threads xml"
  15. RDEPEND="curl? ( net-misc/curl )
  16. iodbc? ( dev-db/libiodbc )
  17. java? ( >=virtual/jdk-1.4:= )
  18. mysql? ( virtual/mysql )
  19. odbc? ( dev-db/unixODBC )
  20. pcre? ( dev-libs/libpcre )
  21. xml? ( dev-libs/libxml2 )"
  22. DEPEND="${RDEPEND}"
  23. S="${WORKDIR}"/XSB
  24. src_prepare() {
  25. EPATCH_FORCE=yes
  26. EPATCH_SUFFIX=patch
  27. epatch "${WORKDIR}"/${PV}
  28. cd "${S}"/build
  29. eautoconf
  30. }
  31. src_configure() {
  32. cd "${S}"/build
  33. econf \
  34. --prefix=/usr/$(get_libdir) \
  35. --disable-optimization \
  36. --without-smodels \
  37. $(use_with odbc) \
  38. $(use_with iodbc) \
  39. $(use_enable threads mt) \
  40. $(use_enable debug)
  41. if use curl ; then
  42. cd "${S}"/packages/curl
  43. econf
  44. fi
  45. if use mysql ; then
  46. cd "${S}"/packages/dbdrivers/mysql
  47. econf
  48. fi
  49. if use odbc ; then
  50. cd "${S}"/packages/dbdrivers/odbc
  51. econf
  52. fi
  53. if use pcre ; then
  54. cd "${S}"/packages/pcre
  55. econf
  56. fi
  57. if use xml ; then
  58. cd "${S}"/packages/xpath
  59. econf
  60. fi
  61. }
  62. src_compile() {
  63. cd "${S}"/build
  64. emake || die "emake failed"
  65. # All XSB Packages are compiled using a single Prolog engine.
  66. # Consequently they must all be compiled using a single make job.
  67. cd "${S}"/packages
  68. rm -f *.xwam
  69. emake -j1 || die "emake packages failed"
  70. if use curl ; then
  71. emake -j1 curl || die "emake curl package failed"
  72. emake -j1 sgml || die "emake sgml package failed"
  73. if use xml ; then
  74. emake -j1 xpath || die "emake xpath package failed"
  75. fi
  76. fi
  77. if use mysql ; then
  78. emake -j1 mysql || die "emake mysql package failed"
  79. fi
  80. if use odbc ; then
  81. emake -j1 odbc || die "emake odbc package failed"
  82. fi
  83. if use pcre ; then
  84. emake -j1 pcre || die "emake pcre package failed"
  85. fi
  86. }
  87. src_install() {
  88. cd "${S}"/build
  89. emake DESTDIR="${D}" install || die "make install failed"
  90. local XSB_INSTALL_DIR=/usr/$(get_libdir)/xsb-${PV}
  91. dosym ${XSB_INSTALL_DIR}/bin/xsb /usr/bin/xsb || die
  92. cd "${S}"/packages
  93. local PACKAGES=${XSB_INSTALL_DIR}/packages
  94. insinto ${PACKAGES}
  95. doins *.xwam || die
  96. insinto ${PACKAGES}/chr
  97. doins chr/*.xwam || die
  98. insinto ${PACKAGES}/clpqr
  99. doins clpqr/*.xwam || die
  100. insinto ${PACKAGES}/gap
  101. doins gap/*.xwam || die
  102. insinto ${PACKAGES}/justify
  103. doins justify/*.xwam || die
  104. doins justify/*.H || die
  105. insinto ${PACKAGES}/regmatch
  106. doins regmatch/*.xwam || die
  107. insinto ${PACKAGES}/regmatch/cc
  108. doins regmatch/cc/*.H || die
  109. insinto ${PACKAGES}/slx
  110. doins slx/*.xwam || die
  111. insinto ${PACKAGES}/wildmatch
  112. doins wildmatch/*.xwam || die
  113. insinto ${PACKAGES}/wildmatch/cc
  114. doins wildmatch/cc/*.H || die
  115. if use curl ; then
  116. insinto ${PACKAGES}/curl
  117. doins curl/*.xwam || die
  118. insinto ${PACKAGES}/curl/cc
  119. doins curl/cc/*.H || die
  120. insinto ${PACKAGES}/sgml
  121. doins sgml/*.xwam || die
  122. insinto ${PACKAGES}/sgml/cc
  123. doins sgml/cc/*.H || die
  124. insinto ${PACKAGES}/sgml/cc/dtd
  125. doins sgml/cc/dtd/* || die
  126. if use xml ; then
  127. insinto ${PACKAGES}/xpath
  128. doins xpath/*xwam || die
  129. insinto ${PACKAGES}/xpath/cc
  130. doins xpath/cc/*.H || die
  131. fi
  132. fi
  133. if use mysql || use odbc ; then
  134. insinto ${PACKAGES}/dbdrivers
  135. doins dbdrivers/*.xwam || die
  136. doins dbdrivers/*.H || die
  137. insinto ${PACKAGES}/dbdrivers/cc
  138. doins dbdrivers/cc/*.H || die
  139. if use mysql ; then
  140. insinto ${PACKAGES}/dbdrivers/mysql
  141. doins dbdrivers/mysql/*.xwam || die
  142. insinto ${PACKAGES}/dbdrivers/mysql/cc
  143. doins dbdrivers/mysql/cc/*.H || die
  144. fi
  145. if use odbc ; then
  146. insinto ${PACKAGES}/dbdrivers/odbc
  147. doins dbdrivers/odbc/*.xwam || die
  148. insinto ${PACKAGES}/dbdrivers/odbc/cc
  149. doins dbdrivers/odbc/cc/*.H || die
  150. fi
  151. fi
  152. if use pcre ; then
  153. insinto ${PACKAGES}/pcre
  154. doins pcre/*.xwam || die
  155. insinto ${PACKAGES}/pcre/cc
  156. doins pcre/cc/*.H || die
  157. fi
  158. cd "${S}"
  159. dodoc FAQ README || die
  160. }