summary refs log tree commit diff
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-11 00:39:04 +0000
committerGitHub <noreply@github.com>2017-11-11 00:39:04 +0000
commit4b6f20c56fc133a07da54fd9f80e248df7c5960d (patch)
treee79a045739169f99276ecd1ea50872cbd5edd173
parent028c1920ae9be432bd35d012237790dc0a2972b3 (diff)
parent1cff740488834d1c91328f00c727bfb15f6f3afa (diff)
downloadnixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar.gz
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar.bz2
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar.lz
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar.xz
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.tar.zst
nixlib-4b6f20c56fc133a07da54fd9f80e248df7c5960d.zip
Merge pull request #31170 from jbboehr/php-mysqlnd-m
php: add config.php.mysqlnd option
-rw-r--r--pkgs/development/interpreters/php/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index b28d5acf9786..de8ab8b71813 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -11,6 +11,8 @@ let
 
     let php7 = lib.versionAtLeast version "7.0";
         mysqlHeaders = mysql.lib.dev or mysql;
+        mysqlndSupport = config.php.mysqlnd or false;
+        mysqlBuildInputs = lib.optional (!mysqlndSupport) mysqlHeaders;
 
     in composableDerivation.composableDerivation {} (fixed: {
 
@@ -112,13 +114,13 @@ let
         };
 
         mysql = {
-          configureFlags = ["--with-mysql"];
-          buildInputs = [ mysqlHeaders ];
+          configureFlags = ["--with-mysql${if mysqlndSupport then "=mysqlnd" else ""}"];
+          buildInputs = mysqlBuildInputs;
         };
 
         mysqli = {
-          configureFlags = ["--with-mysqli=${mysqlHeaders}/bin/mysql_config"];
-          buildInputs = [ mysqlHeaders ];
+          configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysqlHeaders}/bin/mysql_config"}"];
+          buildInputs = mysqlBuildInputs;
         };
 
         mysqli_embedded = {
@@ -128,8 +130,8 @@ let
         };
 
         pdo_mysql = {
-          configureFlags = ["--with-pdo-mysql=${mysqlHeaders}"];
-          buildInputs = [ mysqlHeaders ];
+          configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysqlHeaders}"];
+          buildInputs = mysqlBuildInputs;
         };
 
         bcmath = {