1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic java-pkg-opt-2 multilib
11 DESCRIPTION="free, small, and standard compliant Prolog compiler"
12 HOMEPAGE="http://www.swi-prolog.org/"
13 SRC_URI="http://www.swi-prolog.org/download/devel/src/swipl-${PV}.tar.gz
14 mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
18 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
19 IUSE="archive berkdb debug doc +gmp hardened java libressl minimal odbc +readline ssl static-libs test uuid zlib X"
21 RDEPEND="sys-libs/ncurses:=
22 archive? ( app-arch/libarchive )
23 berkdb? ( >=sys-libs/db-4:= )
24 zlib? ( sys-libs/zlib )
25 odbc? ( dev-db/unixODBC )
26 readline? ( sys-libs/readline:= )
27 gmp? ( dev-libs/gmp:0 )
29 !libressl? ( dev-libs/openssl:0 )
30 libressl? ( dev-libs/libressl )
32 java? ( >=virtual/jdk-1.5:= )
33 uuid? ( dev-libs/ossp-uuid )
44 X? ( x11-proto/xproto )
45 java? ( test? ( =dev-java/junit-3.8* ) )"
47 S="${WORKDIR}/swipl-${PV}"
52 epatch "${WORKDIR}"/${PV}
55 mv packages/clib/uuid.pl packages/clib/uuid.pl.unused || die
58 # OSX/Intel ld doesn't like an archive without table of contents
59 sed -i -e 's/-cru/-scru/' packages/nlp/libstemmer_c/Makefile.pl || die
63 append-flags -fno-strict-aliasing
64 use ppc && append-flags -mno-altivec
65 use hardened && append-flags -fno-unit-at-a-time
66 use debug && append-flags -DO_DEBUG
68 # ARCH is used in the configure script to figure out host and target
72 export CC_FOR_BUILD=$(tc-getBUILD_CC)
76 --libdir="${EPREFIX}"/usr/$(get_libdir) \
78 $(use_enable readline) \
79 $(use_enable static-libs static) \
81 --enable-custom-flags COFLAGS="${CFLAGS}"
83 if ! use minimal ; then
85 if use java && use test ; then
86 jpltestconf="--with-junit=$(java-config --classpath junit)"
89 cd "${S}/packages" || die
91 --libdir="${EPREFIX}"/usr/$(get_libdir) \
93 $(use_with berkdb bdb ) \
94 $(use_with java jpl) \
100 COFLAGS='"${CFLAGS}"'
108 if ! use minimal ; then
109 cd "${S}/packages" || die
111 ./report-failed || die "Cannot report failed packages"
119 if ! use minimal ; then
121 cd "${S}/packages" || die
123 USE_PUBLIC_NETWORK_TESTS=false \
124 USE_ODBC_TESTS=false \
126 ./report-failed || die
131 emake -C src DESTDIR="${D}" install
133 if ! use minimal ; then
134 emake -C packages DESTDIR="${D}" install
136 emake -C packages DESTDIR="${D}" html-install
138 ./packages/report-failed || die "Cannot report failed packages"
141 dodoc ReleaseNotes/relnotes-5.10 INSTALL README VERSION