swi-prolog-7.3.33.ebuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 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. gmp? ( dev-libs/gmp:0 )
  20. ssl? (
  21. !libressl? ( dev-libs/openssl:0 )
  22. libressl? ( dev-libs/libressl )
  23. )
  24. java? ( >=virtual/jdk-1.5:= )
  25. uuid? ( dev-libs/ossp-uuid )
  26. X? (
  27. virtual/jpeg:0
  28. x11-libs/libX11
  29. x11-libs/libXft
  30. x11-libs/libXpm
  31. x11-libs/libXt
  32. x11-libs/libICE
  33. x11-libs/libSM )"
  34. DEPEND="${RDEPEND}
  35. X? ( x11-proto/xproto )
  36. java? ( test? ( =dev-java/junit-3.8* ) )"
  37. S="${WORKDIR}/swipl-${PV}"
  38. src_prepare() {
  39. EPATCH_FORCE=yes
  40. EPATCH_SUFFIX=patch
  41. if [[ -d "${WORKDIR}"/${PV} ]] ; then
  42. epatch "${WORKDIR}"/${PV}
  43. fi
  44. if ! use uuid; then
  45. mv packages/clib/uuid.pl packages/clib/uuid.pl.unused || die
  46. fi
  47. # OSX/Intel ld doesn't like an archive without table of contents
  48. sed -i -e 's/-cru/-scru/' packages/nlp/libstemmer_c/Makefile.pl || die
  49. }
  50. src_configure() {
  51. append-flags -fno-strict-aliasing
  52. use ppc && append-flags -mno-altivec
  53. use hardened && append-flags -fno-unit-at-a-time
  54. use debug && append-flags -DO_DEBUG
  55. # ARCH is used in the configure script to figure out host and target
  56. # specific stuff
  57. export ARCH=${CHOST}
  58. export CC_FOR_BUILD=$(tc-getBUILD_CC)
  59. cd "${S}"/src || die
  60. econf \
  61. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  62. $(use_enable gmp) \
  63. $(use_enable readline) \
  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 odbc) \
  80. $(use_with ssl) \
  81. $(use_with X xpce) \
  82. $(use_with zlib) \
  83. COFLAGS='"${CFLAGS}"'
  84. fi
  85. }
  86. src_compile() {
  87. cd "${S}"/src || die
  88. emake
  89. if ! use minimal ; then
  90. cd "${S}/packages" || die
  91. emake
  92. ./report-failed || die "Cannot report failed packages"
  93. fi
  94. }
  95. src_test() {
  96. cd "${S}/src" || die
  97. emake check
  98. if ! use minimal ; then
  99. unset DISPLAY
  100. cd "${S}/packages" || die
  101. emake \
  102. USE_PUBLIC_NETWORK_TESTS=false \
  103. USE_ODBC_TESTS=false \
  104. check
  105. ./report-failed || die
  106. fi
  107. }
  108. src_install() {
  109. emake -C src DESTDIR="${D}" install
  110. if ! use minimal ; then
  111. emake -C packages DESTDIR="${D}" install
  112. if use doc ; then
  113. emake -C packages DESTDIR="${D}" html-install
  114. fi
  115. ./packages/report-failed || die "Cannot report failed packages"
  116. fi
  117. dodoc ReleaseNotes/relnotes-5.10 INSTALL README.md VERSION
  118. }