1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_4,3_5} )
7 PYTHON_REQ_USE="threads(+)"
13 PHP_EXT_OPTIONAL_USE="php"
15 inherit distutils-r1 libtool java-pkg-opt-2 mono-env php-ext-source-r2 toolchain-funcs
17 DESCRIPTION="SWIG and JNI bindings for Xapian"
18 HOMEPAGE="http://www.xapian.org/"
19 SRC_URI="http://oligarchy.co.uk/xapian/${PV}/${P}.tar.xz"
23 KEYWORDS="alpha amd64 arm ia64 ~mips ~ppc ~ppc64 ~sparc x86"
24 IUSE="java lua mono perl php python ruby tcl"
25 REQUIRED_USE="|| ( java lua mono perl php python ruby tcl )"
27 COMMONDEPEND="dev-libs/xapian:0/30
28 lua? ( dev-lang/lua:= )
29 perl? ( dev-lang/perl:= )
31 dev-python/sphinx[${PYTHON_USEDEP}]
34 ruby? ( dev-lang/ruby:= )
35 tcl? ( dev-lang/tcl:= )
36 mono? ( dev-lang/mono )"
37 DEPEND="${COMMONDEPEND}
39 java? ( >=virtual/jdk-1.6 )"
40 RDEPEND="${COMMONDEPEND}
41 java? ( >=virtual/jre-1.6 )"
44 use mono && mono-env_pkg_setup
45 use java && java-pkg-opt-2_pkg_setup
49 use java && java-pkg-opt-2_src_prepare
51 # http://trac.xapian.org/ticket/702
52 export XAPIAN_CONFIG="/usr/bin/xapian-config"
54 # Accept ruby 2.0 - patch configure directly to avoid autoreconf
55 epatch "${FILESDIR}"/${PN}-1.3.6-allow-ruby-2.0.patch
64 --disable-documentation
71 export CXXFLAGS="${CXXFLAGS} $(java-pkg_get-jni-cflags)"
76 export PERL_ARCH="$(perl -MConfig -e 'print $Config{installvendorarch}')"
77 export PERL_LIB="$(perl -MConfig -e 'print $Config{installvendorlib}')"
82 export LUA_LIB="$($(tc-getPKG_CONFIG) --variable=INSTALL_CMOD lua)"
87 if has_version "=dev-lang/php-7*"; then
94 use ruby && conf+=( --with-ruby )
95 use tcl && conf+=( --with-tcl )
96 use mono && conf+=( --with-csharp )
102 --disable-documentation
111 if python_is_python3; then
112 myconf+=( --with-python3 )
114 myconf+=( --with-python )
117 # Avoid sandbox failures when compiling modules
118 addpredict "$(python_get_sitedir)"
124 python_foreach_impl run_in_build_dir python_configure
131 unset PYTHONDONTWRITEBYTECODE
132 python_foreach_impl run_in_build_dir emake
137 emake DESTDIR="${D}" install
140 java-pkg_dojar java/built/xapian_jni.jar
141 # TODO: make the build system not install this...
142 java-pkg_doso java/.libs/libxapian_jni.so
143 rm -rf "${D}var" || die "could not remove java cruft!"
146 use php && php-ext-source-r2_createinifiles
149 python_foreach_impl run_in_build_dir emake DESTDIR="${D}" install
152 # For some USE combinations this directory is not created
153 if [[ -d "${D}/usr/share/doc/xapian-bindings" ]]; then
154 mv "${D}/usr/share/doc/xapian-bindings" "${D}/usr/share/doc/${PF}" || die
157 dodoc AUTHORS HACKING NEWS TODO README