1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 USE_PHP="php8-1 php8-2"
9 inherit php-ext-pecl-r3
11 DESCRIPTION="MongoDB database driver for PHP"
15 KEYWORDS="~amd64 ~x86"
19 php_targets_php8-1? ( dev-lang/php:8.1[ssl,zlib] )
20 php_targets_php8-2? ( dev-lang/php:8.2[ssl,zlib] )"
21 COMMON_DEPEND="${PHP_DEPEND}
22 >=dev-libs/libbson-1.18.0
23 >=dev-libs/mongo-c-driver-1.18.0[sasl?,ssl]
25 sasl? ( dev-libs/cyrus-sasl )"
26 DEPEND="${COMMON_DEPEND}
27 test? ( dev-db/mongodb )"
28 RDEPEND="${COMMON_DEPEND}"
29 BDEPEND="${PHP_DEPEND}
32 # No tests on x86 because tests require dev-db/mongodb which don't support
33 # x86 anymore (bug #645994)
34 RESTRICT="x86? ( test )
38 local PHP_EXT_ECONF_ARGS=(
42 --with-mongodb-sasl=$(usex sasl)
44 php-ext-source-r3_src_configure
49 mongod --port ${PORT} --bind_ip 127.0.0.1 --nounixsocket --fork \
50 --dbpath="${T}" --logpath="${T}/mongod.log" || die
51 php-ext-pecl-r3_src_test
52 kill $(<"${T}/mongod.lock")