From 8d14fa2886fec877690c6d28cfcdba4503dbbcea Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Wed, 2 Oct 2024 18:46:14 +0200 Subject: [PATCH] percona: apply nixfmt --- pkgs/servers/sql/percona-server/8_0.nix | 136 +++++++++++++++--- pkgs/tools/backup/percona-xtrabackup/8_0.nix | 29 ++-- .../backup/percona-xtrabackup/generic.nix | 85 +++++++++-- 3 files changed, 201 insertions(+), 49 deletions(-) diff --git a/pkgs/servers/sql/percona-server/8_0.nix b/pkgs/servers/sql/percona-server/8_0.nix index af3925fc5813..a82a4fe8d7a7 100644 --- a/pkgs/servers/sql/percona-server/8_0.nix +++ b/pkgs/servers/sql/percona-server/8_0.nix @@ -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 = { diff --git a/pkgs/tools/backup/percona-xtrabackup/8_0.nix b/pkgs/tools/backup/percona-xtrabackup/8_0.nix index 04d026ce87d2..c9822f1ec84c 100644 --- a/pkgs/tools/backup/percona-xtrabackup/8_0.nix +++ b/pkgs/tools/backup/percona-xtrabackup/8_0.nix @@ -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 + ''; + } +) diff --git a/pkgs/tools/backup/percona-xtrabackup/generic.nix b/pkgs/tools/backup/percona-xtrabackup/generic.nix index d81dee6f97f6..fdb5d9f701f4 100644 --- a/pkgs/tools/backup/percona-xtrabackup/generic.nix +++ b/pkgs/tools/backup/percona-xtrabackup/generic.nix @@ -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;