Skip to content

Commit

Permalink
percona: apply nixfmt
Browse files Browse the repository at this point in the history
(cherry picked from commit 8d14fa2)
  • Loading branch information
osnyx committed Oct 13, 2024
1 parent b2709f1 commit 691f133
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 43 deletions.
134 changes: 118 additions & 16 deletions pkgs/servers/sql/percona-server/8_0.nix
Original file line number Diff line number Diff line change
@@ -1,8 +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
# Percona-specific deps
, coreutils, 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: {
Expand All @@ -14,8 +49,16 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-zZgq3AxCRYdte3dTUJiuMvVGdl9U01s8jxcAqDxZiNM=";
};

nativeBuildInputs = [ bison cmake pkg-config ]
++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
nativeBuildInputs = [
bison
cmake
pkg-config
makeWrapper
# required for scripts/CMakeLists.txt
coreutils
gnugrep
procps
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ];

patches = [
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
Expand All @@ -32,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.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.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.
Expand Down Expand Up @@ -73,6 +141,40 @@ stdenv.mkDerivation (finalAttrs: {
moveToOutput "lib/*.a" $static
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
]
}
'';

passthru = {
Expand Down
29 changes: 16 additions & 13 deletions pkgs/tools/backup/percona-xtrabackup/8_0.nix
Original file line number Diff line number Diff line change
@@ -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
'';
}
)
85 changes: 71 additions & 14 deletions pkgs/tools/backup/percona-xtrabackup/generic.nix
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 691f133

Please sign in to comment.