[dev-libs/mongo-c-driver] prepare version for tree

This commit is contained in:
Robert Förster 2024-07-13 01:59:29 +02:00
parent 0ece479d4b
commit d7904ebfdb
2 changed files with 40 additions and 20 deletions

View File

@ -3,7 +3,9 @@
EAPI=8
inherit cmake
PYTHON_COMPAT=( python3_{10..13} )
inherit cmake python-any-r1
DESCRIPTION="Client library written in C for MongoDB"
HOMEPAGE="https://github.com/mongodb/mongo-c-driver"
@ -12,17 +14,14 @@ SRC_URI="https://github.com/mongodb/mongo-c-driver/releases/download/${PV}/${P}.
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86"
IUSE="debug examples icu sasl ssl static-libs test"
IUSE="debug examples icu sasl ssl static-libs test +test-full"
REQUIRED_USE="test? ( static-libs )"
# No tests on x86 because tests require dev-db/mongodb which don't support
# x86 anymore (bug #645994)
RESTRICT="x86? ( test )
!test? ( test )"
RESTRICT="!test? ( test )"
RDEPEND="app-arch/snappy:=
app-arch/zstd:=
>=dev-libs/libbson-${PV}[static-libs?]
~dev-libs/libbson-${PV}[static-libs?]
dev-python/sphinx
sys-libs/zlib:=
icu? ( dev-libs/icu:= )
@ -30,11 +29,25 @@ RDEPEND="app-arch/snappy:=
ssl? (
dev-libs/openssl:=
)"
DEPEND="${RDEPEND}
DEPEND="
${RDEPEND}
test? (
dev-db/mongodb
dev-libs/libbson[static-libs]
)"
test-full? (
dev-db/mongodb
)
)
"
BDEPEND="
$(python_gen_any_dep '
dev-python/sphinx[${PYTHON_USEDEP}]
')
"
python_check_deps() {
python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
src_prepare() {
cmake_src_prepare
@ -77,15 +90,22 @@ src_configure() {
cmake_src_configure
}
# FEATURES="test -network-sandbox" USE="static-libs" emerge dev-libs/mongo-c-driver
src_test() {
local PORT=27099
mongod --port ${PORT} --bind_ip 127.0.0.1 --nounixsocket --fork \
--setParameter enableTestCommands=1 --dbpath="${T}" \
--logpath="${T}/mongod.log" || die
MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}" \
MONGOC_ENABLE_MAJORITY_READ_CONCERN=off \
../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc || die
export MONGOC_TEST_OFFLINE=on
if ! use test-full; then
export MONGOC_TEST_SKIP_LIVE=on
else
local PORT=27099
export MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}"
export MONGOC_ENABLE_MAJORITY_READ_CONCERN=on
LC_ALL=C \
mongod --setParameter enableTestCommands=1 \
--port ${PORT} --bind_ip 127.0.0.1 --nounixsocket \
--fork --dbpath="${T}"\
--logpath="${T}/mongod.log" || die
fi
../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc || die
kill $(<"${T}/mongod.lock")
}

View File

@ -3,7 +3,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
PYTHON_COMPAT=( python3_{10..13} )
inherit cmake python-any-r1
@ -24,7 +24,7 @@ RESTRICT="!test? ( test )"
RDEPEND="
app-arch/snappy:=
app-arch/zstd:=
>=dev-libs/libbson-${PV}[static-libs?]
~dev-libs/libbson-${PV}[static-libs?]
>=dev-libs/libmongocrypt-1.10.1
>=dev-libs/libutf8proc-2.8.0:=[static-libs?]
sys-libs/zlib:=