# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit cmake DESCRIPTION="C library for Client Side and Queryable Encryption in MongoDB" HOMEPAGE="https://github.com/mongodb/libmongocrypt" SRC_URI="https://github.com/mongodb/libmongocrypt/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" IUSE="static-libs test" 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 )" RDEPEND=" >=dev-libs/libbson-1.17.0[static-libs?] dev-libs/openssl:= " DEPEND="${RDEPEND} test? ( dev-db/mongodb dev-libs/libbson[static-libs] )" #PATCHES=( # "${FILESDIR}/inteldfp.patch" #) src_prepare() { cmake_src_prepare # remove doc files # sed -i '/^\s*install\s*(FILES COPYING NEWS/,/^\s*)/{d}' CMakeLists.txt || die # enable tests # sed -i '/message (STATUS "disabling test-libmongoc since using system libbson")/{d}' CMakeLists.txt || die # sed -i '/SET (ENABLE_TESTS OFF)/{d}' CMakeLists.txt || die # sed -i 's/message (FATAL_ERROR "System libbson built without static library target")/message (STATUS "System libbson built without static library target")/' CMakeLists.txt || die # sed -i 's##"bson/bson-private.h"#' src/libbson/tests/test-bson.c || die } src_configure() { local mycmakeargs=( -DCMAKE_SKIP_RPATH=ON # mongoc-stat insecure runpath -DUSE_SHARED_LIBBSON=ON -DMONGOCRYPT_MONGOC_DIR=USE-SYSTEM -DENABLE_ONLINE_TESTS=OFF -DBUILD_VERSION=${PV} -DMONGOCRYPT_ENABLE_DECIMAL128=OFF -DENABLE_STATIC="$(usex static-libs ON OFF)" ) cmake_src_configure } # FEATURES="test -network-sandbox" USE="static-libs" emerge dev-libs/mongo-c-driver #src_test() { # local PORT=27099 # mongod --setParameter enableTestCommands=1 --enableMajorityReadConcern \ # --port ${PORT} --bind_ip 127.0.0.1 --nounixsocket --fork \ # --dbpath="${T}" --logpath="${T}/mongod.log" || die # MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}" \ # MONGOC_ENABLE_MAJORITY_READ_CONCERN=on \ # ../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc \ # --skip-tests "${FILESDIR}/skip-tests.txt" || die # kill $(<"${T}/mongod.lock") #}