Commit 712028ec authored by Oliver Schmidt's avatar Oliver Schmidt
Browse files

percona-server_8_4: init at 8.4.0-1

This is a new LTS release as well.
parent 188b5df7
Loading
Loading
Loading
Loading
+221 −0
Original line number Diff line number Diff line
{ 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
, systemd
{
  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,
  systemd,
  # Percona-specific deps
, cyrus_sasl, gnumake, openldap
  cyrus_sasl,
  gnumake,
  openldap,
  # optional: different malloc implementations
, withJemalloc ? false, withTcmalloc ? false, jemalloc, gperftools
  withJemalloc ? false,
  withTcmalloc ? false,
  jemalloc,
  gperftools,
}:

assert !(withJemalloc && withTcmalloc);


stdenv.mkDerivation (finalAttrs: {
  pname = "percona-server_innovation";
  version = "8.3.0-1";
  pname = "percona-server";
  version = "8.4.0-1";

  src = fetchurl {
    url = "https://downloads.percona.com/downloads/percona-distribution-mysql-ps/percona-distribution-mysql-ps-${builtins.head (lib.strings.split "-" finalAttrs.version)}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
    hash = "sha256-GeuifzqCkStmb4qYa8147XBHvMogYwfsn0FyHdO4WEg";
    url = "https://downloads.percona.com/downloads/Percona-Server-${lib.versions.majorMinor finalAttrs.version}/Percona-Server-${finalAttrs.version}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
    hash = "sha256-76PXXqTNBVsD7RX2vhp7RyESiFpJL0h0zG9ucNfy3uQ=";
  };

  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 = [
@@ -42,20 +83,47 @@ 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 systemd
  ] ++ 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
      systemd
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      cctools
      CoreServices
      developer_cmds
      DarwinTools
    ]
    ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) jemalloc
    ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) gperftools;

  outputs = [ "out" "static" ];
  outputs = [
    "out"
    "static"
  ];

  cmakeFlags = [
  cmakeFlags =
    [
      # Percona-specific flags.
      "-DPORTABLE=1"
      "-DWITH_LDAP=system"
@@ -80,25 +148,55 @@ stdenv.mkDerivation (finalAttrs: {
      "-DINSTALL_DOCDIR=share/mysql/docs"
      "-DINSTALL_SHAREDIR=share/mysql"


  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      "-DWITH_SYSTEMD=1"
      "-DWITH_SYSTEMD_DEBUG=1"
    ]
    ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) "-DWITH_JEMALLOC=1"
    ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) "-DWITH_TCMALLOC=1";

  postInstall = ''
  postInstall =
    ''
      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 ]}
  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
    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
        ]
      }
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
        lib.makeBinPath [
          coreutils
          gnugrep
        ]
      }
    '';

  passthru = {
@@ -109,12 +207,12 @@ stdenv.mkDerivation (finalAttrs: {
    tests = nixosTests.mysql.percona-server_innovation;
  };


  meta = with lib; {
    homepage = "https://www.percona.com/software/mysql-database/percona-server";
    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;
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ pkgs: {
    # newer versions cause linking failures against `libabsl_spinlock_wait`
    protobuf = pkgs.protobuf_21;
  };
  percona-server_8_3 = pkgs.callPackage ./8_3.nix {
  percona-server_8_4 = pkgs.callPackage ./8_4.nix {
    inherit (pkgs.darwin) developer_cmds DarwinTools;
    inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
    # newer versions cause linking failures against `libabsl_spinlock_wait`
+4 −3
Original line number Diff line number Diff line
@@ -11089,9 +11089,10 @@ with pkgs;
  perceptualdiff = callPackage ../tools/graphics/perceptualdiff { };
  inherit (import ../servers/sql/percona-server pkgs) percona-server_8_0 percona-server_8_3;
  percona-server_lts = percona-server_8_0;
  percona-server_innovation = percona-server_8_3;
  inherit (import ../servers/sql/percona-server pkgs) percona-server_8_0 percona-server_8_4;
  percona-server_lts = percona-server_8_4;
  # temporarily, latest LTS and Innovation release are equal
  percona-server_innovation = percona-server_8_4;
  percona-server = percona-server_lts;
  inherit (import ../tools/backup/percona-xtrabackup pkgs) percona-xtrabackup_8_0 percona-xtrabackup_8_3;
  percona-xtrabackup_lts = percona-xtrabackup_8_0;