percona: apply nixfmt

This commit is contained in:
Oliver Schmidt 2024-10-02 18:46:14 +02:00
parent 8315d06e99
commit 8d14fa2886
3 changed files with 201 additions and 49 deletions

View File

@ -1,9 +1,43 @@
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, boost, icu, libedit, libevent, lz4, ncurses, openssl, perl, protobuf, re2, readline, zlib, zstd, libfido2
, numactl, cctools, CoreServices, developer_cmds, libtirpc, rpcsvc-proto, curl, DarwinTools, nixosTests
, coreutils, procps, gnused, gnugrep, hostname, makeWrapper
# Percona-specific deps
, cyrus_sasl, gnumake, openldap
{
lib,
stdenv,
fetchurl,
bison,
cmake,
pkg-config,
boost,
icu,
libedit,
libevent,
lz4,
ncurses,
openssl,
perl,
protobuf,
re2,
readline,
zlib,
zstd,
libfido2,
numactl,
cctools,
CoreServices,
developer_cmds,
libtirpc,
rpcsvc-proto,
curl,
DarwinTools,
nixosTests,
coreutils,
procps,
gnused,
gnugrep,
hostname,
makeWrapper,
# Percona-specific deps
cyrus_sasl,
gnumake,
openldap,
}:
stdenv.mkDerivation (finalAttrs: {
@ -16,9 +50,14 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [
bison cmake pkg-config makeWrapper
bison
cmake
pkg-config
makeWrapper
# required for scripts/CMakeLists.txt
coreutils gnugrep procps
coreutils
gnugrep
procps
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ];
patches = [
@ -36,16 +75,41 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --"
'';
buildInputs = [
boost (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
zstd libfido2 openldap perl cyrus_sasl
] ++ lib.optionals stdenv.hostPlatform.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools CoreServices developer_cmds DarwinTools
];
buildInputs =
[
boost
(curl.override { inherit openssl; })
icu
libedit
libevent
lz4
ncurses
openssl
protobuf
re2
readline
zlib
zstd
libfido2
openldap
perl
cyrus_sasl
]
++ lib.optionals stdenv.hostPlatform.isLinux [
numactl
libtirpc
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
CoreServices
developer_cmds
DarwinTools
];
outputs = [ "out" "static" ];
outputs = [
"out"
"static"
];
cmakeFlags = [
# Percona-specific flags.
@ -78,11 +142,39 @@ stdenv.mkDerivation (finalAttrs: {
so=${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
wrapProgram $out/bin/mysqld_safe --prefix PATH : ${lib.makeBinPath [ coreutils procps gnugrep gnused hostname ]}
wrapProgram $out/bin/mysql_config --prefix PATH : ${lib.makeBinPath [ coreutils gnused ]}
wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${lib.makeBinPath [ coreutils gnugrep ]}
wrapProgram $out/bin/ps-admin --prefix PATH : ${lib.makeBinPath [ coreutils gnugrep ]}
wrapProgram $out/bin/mysqld_multi --prefix PATH : ${lib.makeBinPath [ coreutils gnugrep ]}
wrapProgram $out/bin/mysqld_safe --prefix PATH : ${
lib.makeBinPath [
coreutils
procps
gnugrep
gnused
hostname
]
}
wrapProgram $out/bin/mysql_config --prefix PATH : ${
lib.makeBinPath [
coreutils
gnused
]
}
wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
wrapProgram $out/bin/ps-admin --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
'';
passthru = {

View File

@ -1,17 +1,20 @@
{ callPackage, ... } @ args:
{ callPackage, ... }@args:
callPackage ./generic.nix (args // {
version = "8.0.35-31";
hash = "sha256-KHfgSi9bQlqsi5aDRBlSpdZgMfOrAwHK51k8KhQ9Udg=";
callPackage ./generic.nix (
args
// {
version = "8.0.35-31";
hash = "sha256-KHfgSi9bQlqsi5aDRBlSpdZgMfOrAwHK51k8KhQ9Udg=";
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
extraPatches = [
./abi-check.patch
];
extraPatches = [
./abi-check.patch
];
extraPostInstall = ''
rm -r "$out"/docs
'';
})
extraPostInstall = ''
rm -r "$out"/docs
'';
}
)

View File

@ -1,8 +1,36 @@
{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config
, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpg-error, lz4
, ncurses, numactl, openssl, procps, protobuf, valgrind, xxd, zlib
, perlPackages
, version, hash, fetchSubmodules ? false, extraPatches ? [], extraPostInstall ? "", ...
{
lib,
stdenv,
fetchFromGitHub,
bison,
boost,
cmake,
makeWrapper,
pkg-config,
curl,
cyrus_sasl,
libaio,
libedit,
libev,
libevent,
libgcrypt,
libgpg-error,
lz4,
ncurses,
numactl,
openssl,
procps,
protobuf,
valgrind,
xxd,
zlib,
perlPackages,
version,
hash,
fetchSubmodules ? false,
extraPatches ? [ ],
extraPostInstall ? "",
...
}:
stdenv.mkDerivation (finalAttrs: {
@ -16,12 +44,39 @@ stdenv.mkDerivation (finalAttrs: {
inherit hash fetchSubmodules;
};
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
nativeBuildInputs = [
bison
boost
cmake
makeWrapper
pkg-config
];
buildInputs = [
(curl.override { inherit openssl; }) cyrus_sasl libaio libedit libevent libev libgcrypt libgpg-error lz4
ncurses numactl openssl procps protobuf valgrind xxd zlib
] ++ (with perlPackages; [ perl DBI DBDmysql ]);
buildInputs =
[
(curl.override { inherit openssl; })
cyrus_sasl
libaio
libedit
libevent
libev
libgcrypt
libgpg-error
lz4
ncurses
numactl
openssl
procps
protobuf
valgrind
xxd
zlib
]
++ (with perlPackages; [
perl
DBI
DBDmysql
]);
patches = extraPatches;
@ -42,10 +97,12 @@ stdenv.mkDerivation (finalAttrs: {
"-DWITH_MAN_PAGES=OFF"
];
postInstall = ''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
rm -r "$out"/lib/plugin/debug
'' + extraPostInstall;
postInstall =
''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
rm -r "$out"/lib/plugin/debug
''
+ extraPostInstall;
passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version;