mariadb-connector-c: init at 3.1.2

This commit is contained in:
Izorkin 2019-08-17 21:25:12 +03:00
parent 329a88efa7
commit 3def2b4b6a
3 changed files with 20 additions and 4 deletions

View file

@ -0,0 +1,6 @@
{ callPackage, ... } @ args:
callPackage ./. (args // {
version = "3.1.2";
sha256 = "0pgz8m8d39mvj9wnjll6c83xvdl2h24273b3dkx0g5pxj7ga4shm";
})

View file

@ -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 = {

View file

@ -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;