swi-prolog-7.2.3-r1.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Copyright 1999-2015 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="1"
  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/stable/src/swipl-${PV}.tar.gz
  9. mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
  10. LICENSE="LGPL-2.1"
  11. SLOT="0"
  12. KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
  13. IUSE="archive debug doc +gmp hardened java libressl minimal odbc +readline ssl static-libs test uuid zlib X"
  14. RDEPEND="sys-libs/ncurses:=
  15. archive? ( app-arch/libarchive )
  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. epatch "${WORKDIR}"/${PV}
  42. if ! use uuid; then
  43. mv packages/clib/uuid.pl packages/clib/uuid.pl.unused || die
  44. fi
  45. # OSX/Intel ld doesn't like an archive without table of contents
  46. sed -i -e 's/-cru/-scru/' packages/nlp/libstemmer_c/Makefile.pl || die
  47. }
  48. src_configure() {
  49. append-flags -fno-strict-aliasing
  50. use ppc && append-flags -mno-altivec
  51. use hardened && append-flags -fno-unit-at-a-time
  52. use debug && append-flags -DO_DEBUG
  53. # ARCH is used in the configure script to figure out host and target
  54. # specific stuff
  55. export ARCH=${CHOST}
  56. export CC_FOR_BUILD=$(tc-getBUILD_CC)
  57. cd "${S}"/src || die
  58. econf \
  59. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  60. $(use_enable gmp) \
  61. $(use_enable readline) \
  62. $(use_enable static-libs static) \
  63. --enable-shared \
  64. --enable-custom-flags COFLAGS="${CFLAGS}"
  65. if ! use minimal ; then
  66. local jpltestconf
  67. if use java && use test ; then
  68. jpltestconf="--with-junit=$(java-config --classpath junit)"
  69. fi
  70. cd "${S}/packages" || die
  71. econf \
  72. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  73. $(use_with archive) \
  74. $(use_with java jpl) \
  75. ${jpltestconf} \
  76. $(use_with odbc) \
  77. $(use_with ssl) \
  78. $(use_with X xpce) \
  79. $(use_with zlib) \
  80. COFLAGS='"${CFLAGS}"'
  81. fi
  82. }
  83. src_compile() {
  84. cd "${S}"/src || die
  85. emake
  86. if ! use minimal ; then
  87. cd "${S}/packages" || die
  88. emake
  89. ./report-failed || die "Cannot report failed packages"
  90. fi
  91. }
  92. src_test() {
  93. cd "${S}/src" || die
  94. emake check
  95. if ! use minimal ; then
  96. cd "${S}/packages" || die
  97. emake check
  98. ./report-failed || die "Cannot report failed packages"
  99. fi
  100. }
  101. src_install() {
  102. emake -C src DESTDIR="${D}" install
  103. if ! use minimal ; then
  104. emake -C packages DESTDIR="${D}" install
  105. if use doc ; then
  106. emake -C packages DESTDIR="${D}" html-install
  107. fi
  108. ./packages/report-failed || die "Cannot report failed packages"
  109. fi
  110. dodoc ReleaseNotes/relnotes-5.10 INSTALL README VERSION
  111. }