mariadb-connector-c: move to external package
This commit is contained in:
parent
be098bacad
commit
cfb909229d
4 changed files with 58 additions and 42 deletions
6
pkgs/servers/sql/mariadb/connector-c/2_3.nix
Normal file
6
pkgs/servers/sql/mariadb/connector-c/2_3.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ callPackage, ... } @ args:
|
||||
|
||||
callPackage ./. (args // {
|
||||
version = "2.3.7";
|
||||
sha256 = "13izi35vvxhiwl2dsnqrz75ciisy2s2k30giv7hrm01qlwnmiycl";
|
||||
})
|
49
pkgs/servers/sql/mariadb/connector-c/default.nix
Normal file
49
pkgs/servers/sql/mariadb/connector-c/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ stdenv, fetchurl, cmake
|
||||
, openssl, zlib
|
||||
, libiconv
|
||||
, version, sha256, ...
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "mariadb-connector-c";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"https://downloads.mariadb.org/f/connector-c-${version}/mariadb-connector-c-${version}-src.tar.gz"
|
||||
"https://downloads.mariadb.com/Connectors/c/connector-c-${version}/mariadb-connector-c-${version}-src.tar.gz"
|
||||
];
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
cmakeFlags = [
|
||||
"-DWITH_EXTERNAL_ZLIB=ON"
|
||||
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
|
||||
];
|
||||
|
||||
# The cmake setup-hook uses $out/lib by default, this is not the case here.
|
||||
preConfigure = optionalString stdenv.isDarwin ''
|
||||
cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$out/lib/mariadb")
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
propagatedBuildInputs = [ openssl zlib ];
|
||||
buildInputs = [ libiconv ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postFixup = ''
|
||||
ln -sv mariadb_config $out/bin/mysql_config
|
||||
ln -sv mariadb $out/lib/mysql
|
||||
ln -sv mariadb $out/include/mysql
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Client library that can be used to connect to MySQL or MariaDB";
|
||||
license = licenses.lgpl21;
|
||||
maintainers = with maintainers; [ globin ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
|
@ -18,7 +18,6 @@ mytopEnv = perl.withPackages (p: with p; [ DataDumper DBDmysql DBI TermReadKey ]
|
|||
mariadb = server // {
|
||||
inherit client; # MariaDB Client
|
||||
server = server; # MariaDB Server
|
||||
inherit connector-c; # libmysqlclient.so
|
||||
inherit galera;
|
||||
};
|
||||
|
||||
|
@ -217,47 +216,6 @@ server = stdenv.mkDerivation (common // {
|
|||
CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
|
||||
});
|
||||
|
||||
connector-c = stdenv.mkDerivation rec {
|
||||
pname = "mariadb-connector-c";
|
||||
version = "2.3.7";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.mariadb.org/interstitial/connector-c-${version}/mariadb-connector-c-${version}-src.tar.gz/from/http%3A//nyc2.mirrors.digitalocean.com/mariadb/";
|
||||
sha256 = "13izi35vvxhiwl2dsnqrz75ciisy2s2k30giv7hrm01qlwnmiycl";
|
||||
name = "mariadb-connector-c-${version}-src.tar.gz";
|
||||
};
|
||||
|
||||
# outputs = [ "dev" "out" ]; FIXME: cmake variables don't allow that < 3.0
|
||||
cmakeFlags = [
|
||||
"-DWITH_EXTERNAL_ZLIB=ON"
|
||||
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
|
||||
];
|
||||
|
||||
# The cmake setup-hook uses $out/lib by default, this is not the case here.
|
||||
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
cmakeFlagsArray+=("-DCMAKE_INSTALL_NAME_DIR=$out/lib/mariadb")
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
propagatedBuildInputs = [ openssl zlib ];
|
||||
buildInputs = [ libiconv ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postFixup = ''
|
||||
ln -sv mariadb_config $out/bin/mysql_config
|
||||
ln -sv mariadb $out/lib/mysql
|
||||
ln -sv mariadb $out/include/mysql
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Client library that can be used to connect to MySQL or MariaDB";
|
||||
license = licenses.lgpl21;
|
||||
maintainers = with maintainers; [ globin ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
|
||||
galera = stdenv.mkDerivation rec {
|
||||
pname = "mariadb-galera";
|
||||
version = "25.3.26";
|
||||
|
|
|
@ -14886,6 +14886,9 @@ in
|
|||
|
||||
rpcbind = callPackage ../servers/rpcbind { };
|
||||
|
||||
mariadb-connector-c = mariadb-connector-c_2_3;
|
||||
mariadb-connector-c_2_3 = callPackage ../servers/sql/mariadb/connector-c/2_3.nix { };
|
||||
|
||||
mariadb = callPackage ../servers/sql/mariadb {
|
||||
asio = asio_1_10;
|
||||
# As per mariadb's cmake, "static jemalloc_pic.a can only be used up to jemalloc 4".
|
||||
|
|
Loading…
Reference in a new issue