diff --git a/pkgs/development/interpreters/php/builder.sh b/pkgs/development/interpreters/php/builder.sh index 3fd315a533d2..a8e36aac9bf6 100644 --- a/pkgs/development/interpreters/php/builder.sh +++ b/pkgs/development/interpreters/php/builder.sh @@ -2,7 +2,15 @@ source $stdenv/setup alias lex=flex -configureFlags="--with-libxml-dir=$libxml2 --with-apxs2=$apacheHttpd/bin/apxs --with-apr-util=$apacheHttpd" +configureFlags="$configureFlags \ + --with-libxml-dir=$libxml2 \ + --with-apxs2=$apacheHttpd/bin/apxs \ + --with-apr-util=$apacheHttpd" + +if test -n "$unixODBC"; then + configureFlags="$configureFlags --with-unixODBC=$unixODBC" +fi + makeFlags="APXS_LIBEXECDIR=$out/modules $makeFlags" genericBuild diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index c81d253741f9..d60b130fce0b 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, flex, bison, libxml2, apacheHttpd}: +{stdenv, fetchurl, flex, bison, libxml2, apacheHttpd, unixODBC ? null}: assert libxml2 != null; @@ -11,8 +11,13 @@ stdenv.mkDerivation { inherit flex bison libxml2 apacheHttpd; - buildInputs = [flex bison libxml2 apacheHttpd]; builder = ./builder.sh; + buildInputs = [flex bison libxml2 apacheHttpd]; + + inherit unixODBC; + + odbcSupport = unixODBC != null; + patches = [./fix.patch]; } diff --git a/pkgs/development/libraries/mysql-connector-odbc/builder.sh b/pkgs/development/libraries/mysql-connector-odbc/builder.sh new file mode 100644 index 000000000000..7bf6f996bbce --- /dev/null +++ b/pkgs/development/libraries/mysql-connector-odbc/builder.sh @@ -0,0 +1,7 @@ +source $stdenv/setup + +configureFlags="$configureFlags \ + --with-mysql-path=$mysql \ + --with-unixODBC=$unixODBC" + +genericBuild \ No newline at end of file diff --git a/pkgs/development/libraries/mysql-connector-odbc/default.nix b/pkgs/development/libraries/mysql-connector-odbc/default.nix new file mode 100644 index 000000000000..47c14a4d793d --- /dev/null +++ b/pkgs/development/libraries/mysql-connector-odbc/default.nix @@ -0,0 +1,13 @@ +{stdenv, fetchurl, mysql, libtool, zlib, unixODBC}: + +stdenv.mkDerivation { + name = "mysql-connector-odbc-3.51.12"; + builder = ./builder.sh; + src = fetchurl { + url = http://ftp.snt.utwente.nl/pub/software/mysql/Downloads/MyODBC3/mysql-connector-odbc-3.51.12.tar.gz; + md5 = "a484f590464fb823a8f821b2f1fd7fef"; + }; + configureFlags = "--disable-gui"; + buildInputs = [libtool zlib]; + inherit mysql unixODBC; +} diff --git a/pkgs/servers/sql/mysql/default.nix b/pkgs/servers/sql/mysql/default.nix index a74b16b3836b..a736b421f390 100644 --- a/pkgs/servers/sql/mysql/default.nix +++ b/pkgs/servers/sql/mysql/default.nix @@ -11,4 +11,6 @@ stdenv.mkDerivation { }; buildInputs = [ps ncurses zlib perl]; + + configureFlags = "--enable-thread-safe-client"; } diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 3bbcfe4d3c03..8c255d215608 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -808,7 +808,7 @@ rec { }; php = (import ../development/interpreters/php) { - inherit stdenv fetchurl flex bison libxml2 apacheHttpd; + inherit stdenv fetchurl flex bison libxml2 apacheHttpd unixODBC; }; guile = (import ../development/interpreters/guile) { @@ -1252,6 +1252,10 @@ rec { inherit fetchurl stdenv; }; + mysqlConnectorODBC = import ../development/libraries/mysql-connector-odbc { + inherit fetchurl stdenv mysql libtool zlib unixODBC; + }; + ### DEVELOPMENT / LIBRARIES / JAVA saxon = (import ../development/libraries/java/saxon) {