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

View File

@ -1,17 +1,20 @@
{ callPackage, ... } @ args: { callPackage, ... }@args:
callPackage ./generic.nix (args // { callPackage ./generic.nix (
version = "8.0.35-31"; args
hash = "sha256-KHfgSi9bQlqsi5aDRBlSpdZgMfOrAwHK51k8KhQ9Udg="; // {
version = "8.0.35-31";
hash = "sha256-KHfgSi9bQlqsi5aDRBlSpdZgMfOrAwHK51k8KhQ9Udg=";
# includes https://github.com/Percona-Lab/libkmip.git # includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true; fetchSubmodules = true;
extraPatches = [ extraPatches = [
./abi-check.patch ./abi-check.patch
]; ];
extraPostInstall = '' extraPostInstall = ''
rm -r "$out"/docs 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 lib,
, ncurses, numactl, openssl, procps, protobuf, valgrind, xxd, zlib stdenv,
, perlPackages fetchFromGitHub,
, version, hash, fetchSubmodules ? false, extraPatches ? [], extraPostInstall ? "", ... 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: { stdenv.mkDerivation (finalAttrs: {
@ -16,12 +44,39 @@ stdenv.mkDerivation (finalAttrs: {
inherit hash fetchSubmodules; inherit hash fetchSubmodules;
}; };
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ]; nativeBuildInputs = [
bison
boost
cmake
makeWrapper
pkg-config
];
buildInputs = [ buildInputs =
(curl.override { inherit openssl; }) cyrus_sasl libaio libedit libevent libev libgcrypt libgpg-error lz4 [
ncurses numactl openssl procps protobuf valgrind xxd zlib (curl.override { inherit openssl; })
] ++ (with perlPackages; [ perl DBI DBDmysql ]); 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; patches = extraPatches;
@ -42,10 +97,12 @@ stdenv.mkDerivation (finalAttrs: {
"-DWITH_MAN_PAGES=OFF" "-DWITH_MAN_PAGES=OFF"
]; ];
postInstall = '' postInstall =
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB ''
rm -r "$out"/lib/plugin/debug wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
'' + extraPostInstall; rm -r "$out"/lib/plugin/debug
''
+ extraPostInstall;
passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version; passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version;