2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config
|
2021-10-08 15:17:17 +00:00
|
|
|
, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpg-error, lz4
|
2020-07-18 16:06:22 +00:00
|
|
|
, ncurses, numactl, openssl, protobuf, valgrind, xxd, zlib
|
|
|
|
, perlPackages
|
|
|
|
, version, sha256, extraPatches ? [], extraPostInstall ? "", ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "percona-xtrabackup";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "percona";
|
|
|
|
repo = "percona-xtrabackup";
|
|
|
|
rev = "${pname}-${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-09-14 18:05:37 +00:00
|
|
|
(curl.override { inherit openssl; }) cyrus_sasl libaio libedit libev libevent libgcrypt libgpg-error lz4
|
2020-07-18 16:06:22 +00:00
|
|
|
ncurses numactl openssl protobuf valgrind xxd zlib
|
|
|
|
] ++ (with perlPackages; [ perl DBI DBDmysql ]);
|
|
|
|
|
|
|
|
patches = extraPatches;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: xbstream.c.o:(.bss+0x0): multiple definition of
|
|
|
|
# `datasink_buffer'; ds_buffer.c.o:(.data.rel.local+0x0): first defined here
|
|
|
|
NIX_CFLAGS_COMPILE = "-fcommon";
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
|
|
|
|
"-DBUILD_CONFIG=xtrabackup_release"
|
|
|
|
"-DINSTALL_MYSQLTESTDIR=OFF"
|
|
|
|
"-DWITH_BOOST=system"
|
|
|
|
"-DWITH_CURL=system"
|
|
|
|
"-DWITH_EDITLINE=system"
|
|
|
|
"-DWITH_LIBEVENT=system"
|
|
|
|
"-DWITH_LZ4=system"
|
|
|
|
"-DWITH_PROTOBUF=system"
|
|
|
|
"-DWITH_SASL=system"
|
|
|
|
"-DWITH_SSL=system"
|
|
|
|
"-DWITH_ZLIB=system"
|
|
|
|
"-DWITH_VALGRIND=ON"
|
|
|
|
"-DWITH_MAN_PAGES=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
|
|
|
|
rm -r "$out"/lib/plugin/debug
|
|
|
|
'' + extraPostInstall;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Non-blocking backup tool for MySQL";
|
|
|
|
homepage = "http://www.percona.com/software/percona-xtrabackup";
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|