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

59 lines
1.7 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 14:43:08 +02:00
, version, sha256, extraPatches ? [], extraPostInstall ? "", ...
2017-12-30 18:04:44 +01:00
}:
stdenv.mkDerivation rec {
pname = "percona-xtrabackup";
2020-07-05 14:43:08 +02:00
inherit version;
2017-12-30 18:04:44 +01:00
src = fetchFromGitHub {
owner = "percona";
repo = "percona-xtrabackup";
rev = "${pname}-${version}";
2020-07-05 14:43:08 +02:00
inherit sha256;
2017-12-30 18:04:44 +01:00
};
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
2017-12-30 18:04:44 +01:00
buildInputs = [
curl 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 18:04:44 +01:00
2020-07-05 14:43:08 +02:00
patches = extraPatches;
2017-12-30 18:04:44 +01:00
cmakeFlags = [
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
2017-12-30 18:04:44 +01:00
"-DBUILD_CONFIG=xtrabackup_release"
"-DINSTALL_MYSQLTESTDIR=OFF"
2018-07-12 15:08:13 +02: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 18:04:44 +01:00
"-DWITH_SSL=system"
"-DWITH_ZLIB=system"
"-DWITH_VALGRIND=ON"
2017-12-30 18:04:44 +01:00
"-DWITH_MAN_PAGES=OFF"
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # To run libmysql/libmysql_api_test during build.
2017-12-30 18:04:44 +01:00
];
2018-07-12 15:08:13 +02:00
postInstall = ''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
2018-07-12 15:08:13 +02:00
rm -r "$out"/lib/plugin/debug
2020-07-05 14:43:08 +02:00
'' + extraPostInstall;
2018-07-12 15:08:13 +02:00
meta = with lib; {
2017-12-30 18:04:44 +01:00
description = "Non-blocking backup tool for MySQL";
homepage = "http://www.percona.com/software/percona-xtrabackup";
2017-12-30 18:04:44 +01:00
license = licenses.lgpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ izorkin ];
};
}