summaryrefslogtreecommitdiff
blob: 8ab11a1c5fe96bfeb87f31298d4ea53ee729c952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

PHP_EXT_NAME="mysqlnd_qc"
PHP_EXT_INI="yes"
PHP_EXT_ZENDEXT="no"

USE_PHP="php5-6"

inherit php-ext-pecl-r3 flag-o-matic

KEYWORDS="~amd64"

DESCRIPTION="A query cache plugin for the mysqlnd library"
LICENSE="PHP-3"
SLOT="0"
IUSE="memcached sqlite"

# Specifying targets due to USE flag transition
DEPEND="
	memcached? ( dev-libs/libmemcached )
	sqlite? ( dev-db/sqlite:3 )
	php_targets_php5-6? ( || (
				 dev-lang/php:5.6[-libmysqlclient,mysql]
				 dev-lang/php:5.6[-libmysqlclient,mysqli]
				)
			    )
"
RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}/${P}-php56.patch" )

src_configure() {
	local PHP_EXT_ECONF_ARGS=()
	if use memcached ; then
		# configure does not find pthreads when memcache is enabled
		append-flags -pthread
		PHP_EXT_ECONF_ARGS+=( --enable-mysqlnd_qc_memcache --with-libmemcached-dir="${ROOT}usr" )
	else
		PHP_EXT_ECONF_ARGS+=( --disable-mysqlnd_qc_memcache )
	fi
	if use sqlite ; then
		PHP_EXT_ECONF_ARGS+=( --enable-mysqlnd_qc_sqlite --with-sqlite-dir="${ROOT}usr" )
	else
		PHP_EXT_ECONF_ARGS+=( --disable-mysqlnd_qc_sqlite )
	fi
	php-ext-source-r3_src_configure
}