3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/backup/percona-xtrabackup/generic.nix

59 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkgconfig
, 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 {
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";
rev = "${pname}-${version}";
2020-07-05 13:43:08 +01:00
inherit sha256;
2017-12-30 17:04:44 +00:00
};
nativeBuildInputs = [ bison boost cmake makeWrapper pkgconfig ];
2017-12-30 17:04:44 +00:00
buildInputs = [
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 = [
"-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"
"-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"
"-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 = ''
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
2017-12-30 17:04:44 +00:00
meta = with stdenv.lib; {
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 ];
};
}