nixpkgs/pkgs/tools/backup/percona-xtrabackup/generic.nix

63 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config
, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpg-error, lz4
, ncurses, numactl, openssl, protobuf, valgrind, xxd, zlib
, perlPackages
2020-07-05 12:43:08 +00:00
, version, sha256, extraPatches ? [], extraPostInstall ? "", ...
2017-12-30 17:04:44 +00:00
}:
stdenv.mkDerivation rec {
pname = "percona-xtrabackup";
2020-07-05 12:43:08 +00:00
inherit version;
2017-12-30 17:04:44 +00:00
src = fetchFromGitHub {
owner = "percona";
repo = "percona-xtrabackup";
rev = "${pname}-${version}";
2020-07-05 12:43:08 +00:00
inherit sha256;
2017-12-30 17:04:44 +00:00
};
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
2017-12-30 17:04:44 +00:00
buildInputs = [
(curl.override { inherit openssl; }) cyrus_sasl libaio libedit libev libevent libgcrypt libgpg-error lz4
ncurses numactl openssl protobuf valgrind xxd zlib
] ++ (with perlPackages; [ perl DBI DBDmysql ]);
2017-12-30 17:04:44 +00:00
2020-07-05 12:43:08 +00:00
patches = extraPatches;
# 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";
2017-12-30 17:04:44 +00:00
cmakeFlags = [
"-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 13:08:13 +00:00
"-DWITH_BOOST=system"
"-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"
"-DWITH_VALGRIND=ON"
2017-12-30 17:04:44 +00:00
"-DWITH_MAN_PAGES=OFF"
];
2018-07-12 13:08:13 +00:00
postInstall = ''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
2018-07-12 13:08:13 +00:00
rm -r "$out"/lib/plugin/debug
2020-07-05 12:43:08 +00:00
'' + extraPostInstall;
2018-07-12 13:08:13 +00:00
meta = with lib; {
2017-12-30 17:04:44 +00:00
description = "Non-blocking backup tool for MySQL";
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 ];
};
}