1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools eutils
8 DESCRIPTION="A high-performance MongoDB driver for C"
9 HOMEPAGE="https://github.com/mongodb/mongo-c-driver"
10 SRC_URI="https://github.com/mongodb/${PN}/releases/download/${PV}/${P}.tar.gz"
14 KEYWORDS="~amd64 ~hppa ~s390 ~x86"
15 IUSE="debug examples libressl sasl ssl static-libs test"
17 RDEPEND=">=dev-libs/libbson-0.98.0
18 sasl? ( dev-libs/cyrus-sasl )
20 !libressl? ( dev-libs/openssl:0= )
21 libressl? ( dev-libs/libressl:0= )
24 test? ( dev-db/mongodb )"
26 DOCS=( NEWS README.rst TUTORIAL.md )
28 # No tests on x86 because tests require dev-db/mongodb which don't support
29 # x86 anymore (bug #645994)
30 RESTRICT="!test? ( test ) x86? ( test )"
33 # https://github.com/mongodb/mongo-c-driver/issues/54
34 sed -i -e "s/PTHREAD_LIBS/PTHREAD_CFLAGS/g" src/Makefile.am \
35 tests/Makefile.am || die
40 econf --disable-hardening \
41 --disable-optimizations \
46 $(use_enable static-libs static)
50 emake DESTDIR="${D}" install
53 use static-libs || find "${D}" -name '*.la' -delete
56 insinto /usr/share/${PF}/examples
57 doins -r examples/*.c examples/aggregation examples/bulk
62 # Avoid allocating too much disk space by using server.smallFiles = 1
63 echo -e "storage:\n smallFiles: true" > "${T}/mongod.conf"
65 mongod --port ${PORT} --bind_ip 127.0.0.1 --nounixsocket --fork \
66 -f "${T}/mongod.conf" --dbpath="${T}" \
67 --logpath="${T}/mongod.log" || die
68 MONGOC_TEST_HOST="127.0.0.1:${PORT}" emake test
69 kill `cat "${T}/mongod.lock"`