diff --git a/pkgs/servers/sql/mariadb/connector-c/3_1.nix b/pkgs/servers/sql/mariadb/connector-c/3_1.nix new file mode 100644 index 000000000000..c8bc4858f719 --- /dev/null +++ b/pkgs/servers/sql/mariadb/connector-c/3_1.nix @@ -0,0 +1,6 @@ +{ callPackage, ... } @ args: + +callPackage ./. (args // { + version = "3.1.2"; + sha256 = "0pgz8m8d39mvj9wnjll6c83xvdl2h24273b3dkx0g5pxj7ga4shm"; +}) diff --git a/pkgs/servers/sql/mariadb/connector-c/default.nix b/pkgs/servers/sql/mariadb/connector-c/default.nix index ed49d40180fd..e8430b01eb60 100644 --- a/pkgs/servers/sql/mariadb/connector-c/default.nix +++ b/pkgs/servers/sql/mariadb/connector-c/default.nix @@ -1,12 +1,15 @@ { stdenv, fetchurl, cmake -, openssl, zlib +, curl, openssl, zlib , libiconv , version, sha256, ... }: with stdenv.lib; -stdenv.mkDerivation { +let + isVer3 = versionAtLeast version "3.0"; + +in stdenv.mkDerivation { pname = "mariadb-connector-c"; inherit version; @@ -21,7 +24,7 @@ stdenv.mkDerivation { cmakeFlags = [ "-DWITH_EXTERNAL_ZLIB=ON" "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" - ]; + ] ++ optional isVer3 "-DWITH_CURL=ON"; # The cmake setup-hook uses $out/lib by default, this is not the case here. preConfigure = optionalString stdenv.isDarwin '' @@ -29,7 +32,7 @@ stdenv.mkDerivation { ''; nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = [ openssl zlib ]; + propagatedBuildInputs = [ openssl zlib ] ++ optional isVer3 curl; buildInputs = [ libiconv ]; enableParallelBuilding = true; @@ -38,6 +41,12 @@ stdenv.mkDerivation { ln -sv mariadb_config $out/bin/mysql_config ln -sv mariadb $out/lib/mysql ln -sv mariadb $out/include/mysql + ${optionalString isVer3 '' + ln -sv libmariadbclient.a $out/lib/mariadb/libmysqlclient.a + ln -sv libmariadbclient.a $out/lib/mariadb/libmysqlclient_r.a + ln -sv libmariadb.so $out/lib/mariadb/libmysqlclient.so + ln -sv libmariadb.so $out/lib/mariadb/libmysqlclient_r.so + ''} ''; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2cdb0043052c..12c549983219 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14889,6 +14889,7 @@ in libmysqlclient = mariadb-connector-c; mariadb-connector-c = mariadb-connector-c_2_3; mariadb-connector-c_2_3 = callPackage ../servers/sql/mariadb/connector-c/2_3.nix { }; + mariadb-connector-c_3_1 = callPackage ../servers/sql/mariadb/connector-c/3_1.nix { }; mariadb = callPackage ../servers/sql/mariadb { asio = asio_1_10;