dev-php/pecl-mongodb: bump to 1.7.4
[gentoo.git] / dev-php / pecl-mongodb / pecl-mongodb-1.7.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PHP_EXT_NAME="mongodb"
7 USE_PHP="php7-2 php7-3 php7-4"
8
9 inherit php-ext-pecl-r3
10
11 DESCRIPTION="MongoDB database driver for PHP"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="libressl sasl test"
17
18 PHP_DEPEND="
19         php_targets_php7-2? ( dev-lang/php:7.2[json,ssl,zlib] )
20         php_targets_php7-3? ( dev-lang/php:7.3[json,ssl,zlib] )
21         php_targets_php7-4? ( dev-lang/php:7.4[json,ssl,zlib] )"
22 COMMON_DEPEND="${PHP_DEPEND}
23         >=dev-libs/libbson-1.16.2
24         >=dev-libs/mongo-c-driver-1.16.2[sasl?,ssl]
25         !libressl? ( dev-libs/openssl:0= )
26         libressl? ( dev-libs/libressl:0= )
27         sasl? ( dev-libs/cyrus-sasl )"
28 DEPEND="${COMMON_DEPEND}
29         test? ( dev-db/mongodb )"
30 RDEPEND="${COMMON_DEPEND}"
31 BDEPEND="${PHP_DEPEND}
32         virtual/pkgconfig"
33
34 # No tests on x86 because tests require dev-db/mongodb which don't support
35 # x86 anymore (bug #645994)
36 RESTRICT="x86? ( test )
37         !test? ( test )"
38
39 src_configure() {
40         local PHP_EXT_ECONF_ARGS=(
41                 --enable-mongodb
42                 --with-libbson
43                 --with-libmongoc
44                 --with-mongodb-sasl=$(usex sasl)
45         )
46         php-ext-source-r3_src_configure
47 }
48
49 src_test() {
50         local PORT=27017
51         mongod --port ${PORT} --bind_ip 127.0.0.1 --nounixsocket --fork \
52                 --dbpath="${T}" --logpath="${T}/mongod.log" || die
53         php-ext-pecl-r3_src_test
54         kill $(<"${T}/mongod.lock")
55 }