2021-01-17 09:17:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config
|
2020-07-05 10:09:36 +01:00
|
|
|
, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpgerror, lz4
|
|
|
|
, ncurses, numactl, openssl, protobuf, valgrind, xxd, zlib
|
|
|
|
, perlPackages
|
2020-07-05 13:43:08 +01:00
|
|
|
, version, sha256, extraPatches ? [], extraPostInstall ? "", ...
|
2017-12-30 17:04:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "percona-xtrabackup";
|
2020-07-05 13:43:08 +01:00
|
|
|
inherit version;
|
2017-12-30 17:04:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "percona";
|
|
|
|
repo = "percona-xtrabackup";
|
2019-08-15 13:41:18 +01:00
|
|
|
rev = "${pname}-${version}";
|
2020-07-05 13:43:08 +01:00
|
|
|
inherit sha256;
|
2017-12-30 17:04:44 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
|
2017-12-30 17:04:44 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-07-05 10:09:36 +01:00
|
|
|
curl cyrus_sasl libaio libedit libev libevent libgcrypt libgpgerror lz4
|
|
|
|
ncurses numactl openssl protobuf valgrind xxd zlib
|
|
|
|
] ++ (with perlPackages; [ perl DBI DBDmysql ]);
|
2017-12-30 17:04:44 +00:00
|
|
|
|
2020-07-05 13:43:08 +01:00
|
|
|
patches = extraPatches;
|
|
|
|
|
2017-12-30 17:04:44 +00:00
|
|
|
cmakeFlags = [
|
2020-07-05 10:09:36 +01:00
|
|
|
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
|
2017-12-30 17:04:44 +00:00
|
|
|
"-DBUILD_CONFIG=xtrabackup_release"
|
|
|
|
"-DINSTALL_MYSQLTESTDIR=OFF"
|
2018-07-12 14:08:13 +01:00
|
|
|
"-DWITH_BOOST=system"
|
2020-07-05 10:09:36 +01:00
|
|
|
"-DWITH_CURL=system"
|
|
|
|
"-DWITH_EDITLINE=system"
|
|
|
|
"-DWITH_LIBEVENT=system"
|
|
|
|
"-DWITH_LZ4=system"
|
|
|
|
"-DWITH_PROTOBUF=system"
|
|
|
|
"-DWITH_SASL=system"
|
2017-12-30 17:04:44 +00:00
|
|
|
"-DWITH_SSL=system"
|
|
|
|
"-DWITH_ZLIB=system"
|
2020-07-05 10:09:36 +01:00
|
|
|
"-DWITH_VALGRIND=ON"
|
2017-12-30 17:04:44 +00:00
|
|
|
"-DWITH_MAN_PAGES=OFF"
|
2020-07-05 10:09:36 +01:00
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # To run libmysql/libmysql_api_test during build.
|
2017-12-30 17:04:44 +00:00
|
|
|
];
|
|
|
|
|
2018-07-12 14:08:13 +01:00
|
|
|
postInstall = ''
|
2020-07-05 10:09:36 +01:00
|
|
|
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
|
2018-07-12 14:08:13 +01:00
|
|
|
rm -r "$out"/lib/plugin/debug
|
2020-07-05 13:43:08 +01:00
|
|
|
'' + extraPostInstall;
|
2018-07-12 14:08:13 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-12-30 17:04:44 +00:00
|
|
|
description = "Non-blocking backup tool for MySQL";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.percona.com/software/percona-xtrabackup";
|
2017-12-30 17:04:44 +00:00
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|