dev-libs/kuserfeedback: x86 stable wrt bug #721452
[gentoo.git] / dev-libs / mongo-c-driver / mongo-c-driver-0.8.1-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit base flag-o-matic multilib python-any-r1 toolchain-funcs
8
9 DESCRIPTION="C Driver for MongoDB"
10 HOMEPAGE="http://www.mongodb.org/ https://github.com/mongodb/mongo-c-driver"
11 SRC_URI="https://github.com/mongodb/${PN}/tarball/v${PV/_/} -> ${P}.tar.gz"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="amd64 ~hppa ~s390 x86"
16 IUSE="doc static-libs"
17
18 # tests fails to build
19 RESTRICT="test"
20
21 RDEPEND=""
22 DEPEND="${PYTHON_DEPS}
23         doc? ( $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]') )
24 "
25 PATCHES=( "${FILESDIR}/${PV}-api-version.diff" )
26
27 python_check_deps() {
28         if use doc; then
29                 has_version "dev-python/sphinx[${PYTHON_USEDEP}]"
30         fi
31 }
32
33 src_unpack() {
34         unpack ${A}
35         mv *-${PN}-* "${S}"
36 }
37
38 src_compile() {
39         append-cflags -D_POSIX_C_SOURCE=200112L
40         tc-export CC
41         emake
42         use doc && make -C docs/source/sphinx html
43 }
44
45 src_install() {
46         emake install \
47                 INSTALL_LIBRARY_PATH="${D}/usr/$(get_libdir)" \
48                 INSTALL_INCLUDE_PATH="${D}/usr/include"
49
50         use static-libs || find "${ED}" -name '*.a' -exec rm -f {} +
51
52         use doc && dohtml -r docs/source/sphinx/build/html/*
53 }