php: clean up mysql/mariadb handling

This commit is contained in:
Robin Gloster 2017-12-28 17:50:27 +01:00
parent 1f4c02fc9e
commit 48464d620d

View File

@ -12,9 +12,8 @@ let
{ version, sha256 }: { version, sha256 }:
let php7 = lib.versionAtLeast version "7.0"; let php7 = lib.versionAtLeast version "7.0";
mysqlHeaders = mysql.connector-c or mysql;
mysqlndSupport = config.php.mysqlnd or false; mysqlndSupport = config.php.mysqlnd or false;
mysqlBuildInputs = lib.optional (!mysqlndSupport) mysqlHeaders; mysqlBuildInputs = lib.optional (!mysqlndSupport) mysql.connector-c;
in composableDerivation.composableDerivation {} (fixed: { in composableDerivation.composableDerivation {} (fixed: {
@ -121,7 +120,7 @@ let
}; };
mysqli = { mysqli = {
configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysqlHeaders}/bin/mysql_config"}"]; configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysql.connector-c}/bin/mysql_config"}"];
buildInputs = mysqlBuildInputs; buildInputs = mysqlBuildInputs;
}; };
@ -132,7 +131,7 @@ let
}; };
pdo_mysql = { pdo_mysql = {
configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysqlHeaders}"]; configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysql.connector-c}"];
buildInputs = mysqlBuildInputs; buildInputs = mysqlBuildInputs;
}; };