Skip to content

Commit

Permalink
Merge: [Backport release-24.05] percona: update packages, init 8.4 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma27 authored Oct 16, 2024
2 parents 0e51ff7 + faa0c49 commit 9ec6dcc
Show file tree
Hide file tree
Showing 14 changed files with 470 additions and 186 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ fb0e5be84331188a69b3edd31679ca6576edb75a

# python3Packages: format with nixfmt
59b1aef59071cae6e87859dc65de973d2cc595c0

# percona: apply nixfmt
369350afcba8e6a231dd25b6a010c4e9dec713b9
2 changes: 1 addition & 1 deletion nixos/tests/mysql/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
inherit (pkgs) mysql80;
};
perconaPackages = {
inherit (pkgs) percona-server_lts percona-server_innovation;
inherit (pkgs) percona-server_8_0 percona-server_8_4;
};
mkTestName = pkg: "mariadb_${builtins.replaceStrings ["."] [""] (lib.versions.majorMinor pkg.version)}";
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,64 @@
{ 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: {
pname = "percona-server_lts";
version = "8.0.36-28";
pname = "percona-server";
version = "8.0.37-29";

src = fetchurl {
url = "https://www.percona.com/downloads/Percona-Server-8.0/Percona-Server-${finalAttrs.version}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
hash = "sha256-iktEvZz3mjjmJ16PX51OjSwwiFS3H9W/XRco//Q6aEQ=";
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.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.isLinux [
numactl
libtirpc
]
++ lib.optionals stdenv.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 All @@ -88,6 +190,7 @@ stdenv.mkDerivation (finalAttrs: {
description = ''
A free, fully compatible, enhanced, open source drop-in replacement for
MySQL® that provides superior performance, scalability and instrumentation.
Long-term support release.
'';
license = licenses.gpl2;
maintainers = teams.flyingcircus.members;
Expand Down
Loading

0 comments on commit 9ec6dcc

Please sign in to comment.