From 3def2b4b6a550ca02c36f2f2eefc899921dc5e9b Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sat, 17 Aug 2019 21:25:12 +0300 Subject: [PATCH] mariadb-connector-c: init at 3.1.2 --- pkgs/servers/sql/mariadb/connector-c/3_1.nix | 6 ++++++ .../servers/sql/mariadb/connector-c/default.nix | 17 +++++++++++++---- pkgs/top-level/all-packages.nix | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 pkgs/servers/sql/mariadb/connector-c/3_1.nix 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;