dev-libs/xapian: amd64 stable wrt bug #689520
[gentoo.git] / dev-libs / xapian / xapian-1.4.11.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit eutils multilib-minimal
7
8 MY_P="${PN}-core-${PV}"
9
10 DESCRIPTION="Xapian Probabilistic Information Retrieval library"
11 HOMEPAGE="https://www.xapian.org/"
12 SRC_URI="https://oligarchy.co.uk/xapian/${PV}/${MY_P}.tar.xz"
13
14 LICENSE="GPL-2"
15 SLOT="0/30" # ABI version of libxapian.so
16 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~x64-solaris"
17 IUSE="doc static-libs -cpu_flags_x86_sse +cpu_flags_x86_sse2 +glass +inmemory +remote"
18
19 DEPEND="sys-libs/zlib"
20 RDEPEND="${DEPEND}"
21
22 S="${WORKDIR}/${MY_P}"
23
24 multilib_src_configure() {
25         local myconf=""
26
27         if use cpu_flags_x86_sse2; then
28                 myconf="${myconf} --enable-sse=sse2"
29         else
30                 if use cpu_flags_x86_sse; then
31                         myconf="${myconf} --enable-sse=sse"
32                 else
33                         myconf="${myconf} --disable-sse"
34                 fi
35         fi
36
37         myconf="${myconf} $(use_enable static-libs static)"
38
39         use glass || myconf="${myconf} --disable-backend-glass"
40         use inmemory || myconf="${myconf} --disable-backend-inmemory"
41         use remote || myconf="${myconf} --disable-backend-remote"
42
43         myconf="${myconf} --enable-backend-chert --program-suffix="
44
45         ECONF_SOURCE=${S} econf $myconf
46 }
47
48 MULTILIB_WRAPPED_HEADERS=(
49         /usr/include/xapian/postingsource.h
50         /usr/include/xapian/attributes.h
51         /usr/include/xapian/valuesetmatchdecider.h
52         /usr/include/xapian/version.h
53         /usr/include/xapian/version.h
54         /usr/include/xapian/types.h
55         /usr/include/xapian/positioniterator.h
56         /usr/include/xapian/registry.h
57 )
58
59 multilib_src_install() {
60         emake DESTDIR="${D}" install
61 }
62
63 multilib_src_install_all() {
64         # bug #573466
65         ln -sf "${D}usr/bin/xapian-config" "${D}usr/bin/xapian-config-1.3"
66
67         use doc || rm -rf "${D}usr/share/doc/xapian-core-${PV}"
68
69         dodoc AUTHORS HACKING PLATFORMS README NEWS
70
71         find "${D}" -name "*.la" -type f -delete || die
72 }
73
74 multilib_src_test() {
75         emake check VALGRIND=
76 }