1 |
1 |
# Copyright 1999-2023 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
6 |
inherit cmake
|
7 |
7 |
|
... | ... | |
11 |
11 |
|
12 |
12 |
LICENSE="Apache-2.0"
|
13 |
13 |
SLOT="0"
|
14 |
|
KEYWORDS="amd64 ~arm64 ~hppa ~riscv x86"
|
|
14 |
KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86"
|
15 |
15 |
IUSE="debug examples icu sasl ssl static-libs test"
|
16 |
16 |
REQUIRED_USE="test? ( static-libs )"
|
17 |
17 |
|
... | ... | |
23 |
23 |
RDEPEND="app-arch/snappy:=
|
24 |
24 |
app-arch/zstd:=
|
25 |
25 |
>=dev-libs/libbson-${PV}[static-libs?]
|
|
26 |
dev-python/sphinx
|
26 |
27 |
sys-libs/zlib:=
|
27 |
28 |
icu? ( dev-libs/icu:= )
|
28 |
29 |
sasl? ( dev-libs/cyrus-sasl:= )
|
29 |
30 |
ssl? (
|
30 |
|
dev-libs/openssl:0=
|
|
31 |
dev-libs/openssl:=
|
31 |
32 |
)"
|
32 |
33 |
DEPEND="${RDEPEND}
|
33 |
34 |
test? (
|
34 |
35 |
dev-db/mongodb
|
35 |
36 |
dev-libs/libbson[static-libs]
|
36 |
37 |
)"
|
37 |
|
BDEPEND="
|
38 |
|
dev-python/sphinx
|
39 |
|
"
|
40 |
|
|
41 |
|
PATCHES=(
|
42 |
|
"${FILESDIR}/${PN}-1.14.0-no-docs.patch"
|
43 |
|
"${FILESDIR}/${PN}-1.16.2-enable-tests.patch" # enable tests with system libbson
|
44 |
|
)
|
45 |
38 |
|
46 |
39 |
src_prepare() {
|
47 |
40 |
cmake_src_prepare
|
48 |
41 |
|
49 |
|
# sphinx's -Werror
|
50 |
|
sed -i -e 's:-qEW:-qE:' build/cmake/SphinxBuild.cmake || die
|
51 |
|
|
52 |
42 |
# copy private headers for tests since we don't build libbson
|
53 |
43 |
if use test; then
|
54 |
44 |
mkdir -p src/libbson/tests/bson || die
|
55 |
45 |
cp src/libbson/src/bson/bson-*.h src/libbson/tests/bson/ || die
|
56 |
46 |
fi
|
|
47 |
|
|
48 |
# remove doc files
|
|
49 |
sed -i '/^\s*install\s*(FILES COPYING NEWS/,/^\s*)/{d}' CMakeLists.txt || die
|
|
50 |
|
|
51 |
# enable tests
|
|
52 |
sed -i '/message ("-- disabling test-libmongoc since using system libbson")/{d}' CMakeLists.txt || die
|
|
53 |
sed -i '/SET (ENABLE_TESTS OFF)/{d}' CMakeLists.txt || die
|
|
54 |
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
|
|
55 |
sed -i 's#<bson/bson-private.h>#"bson/bson-private.h"#' src/libbson/tests/test-bson.c || die
|
57 |
56 |
}
|
58 |
57 |
|
59 |
58 |
src_configure() {
|
60 |
59 |
local mycmakeargs=(
|
61 |
60 |
-DCMAKE_SKIP_RPATH=ON # mongoc-stat insecure runpath
|
62 |
|
-DENABLE_BSON=SYSTEM
|
|
61 |
-DUSE_SYSTEM_LIBBSON=ON
|
63 |
62 |
-DENABLE_EXAMPLES=OFF
|
64 |
63 |
-DENABLE_ICU="$(usex icu ON OFF)"
|
65 |
64 |
-DENABLE_MAN_PAGES=ON
|
66 |
65 |
-DENABLE_MONGOC=ON
|
67 |
|
-DENABLE_SNAPPY=SYSTEM
|
|
66 |
-DENABLE_SNAPPY=AUTO
|
68 |
67 |
-DENABLE_ZLIB=SYSTEM
|
69 |
68 |
-DENABLE_SASL="$(usex sasl CYRUS OFF)"
|
70 |
|
-DENABLE_SSL="$(usex ssl OPENSSL OFF )"
|
|
69 |
-DENABLE_SSL="$(usex ssl $(usex ssl OPENSSL) OFF)"
|
71 |
70 |
-DENABLE_STATIC="$(usex static-libs ON OFF)"
|
72 |
71 |
-DENABLE_TESTS="$(usex test ON OFF)"
|
73 |
72 |
-DENABLE_TRACING="$(usex debug ON OFF)"
|