swi-prolog-7.3.35.ebuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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="0"
  6. DESCRIPTION="free, small, and standard compliant Prolog compiler"
  7. HOMEPAGE="http://www.swi-prolog.org/"
  8. SRC_URI="http://www.swi-prolog.org/download/devel/src/swipl-${PV}.tar.gz"
  9. LICENSE="BSD-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
  12. IUSE="archive berkdb debug doc +gmp hardened java +libedit libressl minimal odbc readline ssl static-libs test uuid zlib X"
  13. RDEPEND="sys-libs/ncurses:=
  14. archive? ( app-arch/libarchive )
  15. berkdb? ( >=sys-libs/db-4:= )
  16. zlib? ( sys-libs/zlib )
  17. odbc? ( dev-db/unixODBC )
  18. readline? ( sys-libs/readline:= )
  19. libedit? ( dev-libs/libedit )
  20. gmp? ( dev-libs/gmp:0 )
  21. ssl? (
  22. !libressl? ( dev-libs/openssl:0 )
  23. libressl? ( dev-libs/libressl )
  24. )
  25. java? ( >=virtual/jdk-1.5:= )
  26. uuid? ( dev-libs/ossp-uuid )
  27. X? (
  28. virtual/jpeg:0
  29. x11-libs/libX11
  30. x11-libs/libXft
  31. x11-libs/libXpm
  32. x11-libs/libXt
  33. x11-libs/libICE
  34. x11-libs/libSM )"
  35. DEPEND="${RDEPEND}
  36. X? ( x11-proto/xproto )
  37. java? ( test? ( =dev-java/junit-3.8* ) )"
  38. S="${WORKDIR}/swipl-${PV}"
  39. src_prepare() {
  40. EPATCH_FORCE=yes
  41. EPATCH_SUFFIX=patch
  42. if [[ -d "${WORKDIR}"/${PV} ]] ; then
  43. epatch "${WORKDIR}"/${PV}
  44. fi
  45. if ! use uuid; then
  46. mv packages/clib/uuid.pl packages/clib/uuid.pl.unused || die
  47. fi
  48. # OSX/Intel ld doesn't like an archive without table of contents
  49. sed -i -e 's/-cru/-scru/' packages/nlp/libstemmer_c/Makefile.pl || die
  50. }
  51. src_configure() {
  52. append-flags -fno-strict-aliasing
  53. use ppc && append-flags -mno-altivec
  54. use hardened && append-flags -fno-unit-at-a-time
  55. use debug && append-flags -DO_DEBUG
  56. # ARCH is used in the configure script to figure out host and target
  57. # specific stuff
  58. export ARCH=${CHOST}
  59. export CC_FOR_BUILD=$(tc-getBUILD_CC)
  60. cd "${S}"/src || die
  61. econf \
  62. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  63. $(use_enable gmp) \
  64. $(use_enable static-libs static) \
  65. --enable-shared \
  66. --enable-custom-flags COFLAGS="${CFLAGS}"
  67. if ! use minimal ; then
  68. local jpltestconf
  69. if use java && use test ; then
  70. jpltestconf="--with-junit=$(java-config --classpath junit)"
  71. fi
  72. cd "${S}/packages" || die
  73. econf \
  74. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  75. $(use_with archive) \
  76. $(use_with berkdb bdb ) \
  77. $(use_with java jpl) \
  78. ${jpltestconf} \
  79. $(use_with libedit) \
  80. $(use_with odbc) \
  81. $(use_with readline) \
  82. $(use_with ssl) \
  83. $(use_with X xpce) \
  84. $(use_with zlib) \
  85. COFLAGS='"${CFLAGS}"'
  86. fi
  87. }
  88. src_compile() {
  89. cd "${S}"/src || die
  90. emake
  91. if ! use minimal ; then
  92. cd "${S}/packages" || die
  93. emake
  94. ./report-failed || die "Cannot report failed packages"
  95. fi
  96. }
  97. src_test() {
  98. cd "${S}/src" || die
  99. emake check
  100. if ! use minimal ; then
  101. unset DISPLAY
  102. cd "${S}/packages" || die
  103. emake \
  104. USE_PUBLIC_NETWORK_TESTS=false \
  105. USE_ODBC_TESTS=false \
  106. check
  107. ./report-failed || die
  108. fi
  109. }
  110. src_install() {
  111. emake -C src DESTDIR="${D}" install
  112. if ! use minimal ; then
  113. emake -C packages DESTDIR="${D}" install
  114. if use doc ; then
  115. emake -C packages DESTDIR="${D}" html-install
  116. fi
  117. ./packages/report-failed || die "Cannot report failed packages"
  118. fi
  119. dodoc ReleaseNotes/relnotes-5.10 INSTALL README.md VERSION
  120. }