mariadb: move callPackage down one layer to preserve .override
This commit is contained in:
parent
9517864e93
commit
8b30afdd78
@ -1,48 +1,46 @@
|
||||
{ lib, stdenv, fetchurl, nixosTests, buildPackages
|
||||
# Native buildInputs components
|
||||
, bison, boost, cmake, fixDarwinDylibNames, flex, makeWrapper, pkg-config
|
||||
# Common components
|
||||
, curl, libiconv, ncurses, openssl, openssl_1_1, pcre, pcre2
|
||||
, libkrb5, libaio, liburing, systemd
|
||||
, CoreServices, cctools, perl
|
||||
, jemalloc, less, libedit
|
||||
# Server components
|
||||
, bzip2, lz4, lzo, snappy, xz, zlib, zstd
|
||||
, cracklib, judy, libevent, libxml2
|
||||
, linux-pam, numactl, pmdk
|
||||
, fmt_8
|
||||
, withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq
|
||||
, withStorageRocks ? true
|
||||
, withEmbedded ? false
|
||||
}:
|
||||
|
||||
let
|
||||
# shared across all versions
|
||||
generic =
|
||||
{ version, hash
|
||||
, lib, stdenv, fetchurl, nixosTests, buildPackages
|
||||
# Native buildInputs components
|
||||
, bison, boost, cmake, fixDarwinDylibNames, flex, makeWrapper, pkg-config
|
||||
# Common components
|
||||
, curl, libiconv, ncurses, openssl, openssl_1_1, pcre, pcre2
|
||||
, libkrb5, libaio, liburing, systemd
|
||||
, CoreServices, cctools, perl
|
||||
, jemalloc, less, libedit
|
||||
# Server components
|
||||
, bzip2, lz4, lzo, snappy, xz, zlib, zstd
|
||||
, cracklib, judy, libevent, libxml2
|
||||
, linux-pam, numactl, pmdk
|
||||
, fmt_8
|
||||
, withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq
|
||||
, withStorageRocks ? true
|
||||
, withEmbedded ? false
|
||||
}:
|
||||
let
|
||||
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
|
||||
libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
mytopEnv = buildPackages.perl.withPackages (p: with p; [ DBDmysql DBI TermReadKey ]);
|
||||
|
||||
mytopEnv = buildPackages.perl.withPackages (p: with p; [ DBDmysql DBI TermReadKey ]);
|
||||
|
||||
mariadbPackage = packageSettings: (server packageSettings) // {
|
||||
client = client packageSettings; # MariaDB Client
|
||||
server = server packageSettings; # MariaDB Server
|
||||
};
|
||||
|
||||
commonOptions = packageSettings: rec { # attributes common to both builds
|
||||
inherit (packageSettings) version;
|
||||
common = rec { # attributes common to both builds
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.mariadb.com/MariaDB/mariadb-${version}/source/mariadb-${version}.tar.gz";
|
||||
inherit (packageSettings) hash;
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ]
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
|
||||
++ lib.optional (!stdenv.hostPlatform.isDarwin) makeWrapper;
|
||||
|
||||
buildInputs = [
|
||||
libiconv ncurses zlib
|
||||
] ++ (packageSettings.extraBuildInputs or [])
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux ([ libkrb5 systemd ]
|
||||
] ++ lib.optionals stdenv.hostPlatform.isLinux ([ libkrb5 systemd ]
|
||||
++ (if (lib.versionOlder version "10.6") then [ libaio ] else [ liburing ]))
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices cctools perl libedit ]
|
||||
++ lib.optional (!stdenv.hostPlatform.isDarwin) [ jemalloc ]
|
||||
@ -119,7 +117,7 @@ commonOptions = packageSettings: rec { # attributes common to both builds
|
||||
'';
|
||||
|
||||
passthru.tests = let
|
||||
testVersion = "mariadb_${builtins.replaceStrings ["."] [""] (lib.versions.majorMinor (packageSettings.version))}";
|
||||
testVersion = "mariadb_${builtins.replaceStrings ["."] [""] (lib.versions.majorMinor version)}";
|
||||
in {
|
||||
mariadb-galera-rsync = nixosTests.mariadb-galera.${testVersion};
|
||||
mysql = nixosTests.mysql.${testVersion};
|
||||
@ -135,16 +133,11 @@ commonOptions = packageSettings: rec { # attributes common to both builds
|
||||
maintainers = with maintainers; [ thoughtpolice ajs124 das_j ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
client = packageSettings: let
|
||||
common = commonOptions packageSettings;
|
||||
|
||||
in stdenv.mkDerivation (common // {
|
||||
client = stdenv.mkDerivation (common // {
|
||||
pname = "mariadb-client";
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
patches = common.patches ++ [
|
||||
./patch/cmake-plugin-includedir.patch
|
||||
];
|
||||
@ -163,16 +156,11 @@ in stdenv.mkDerivation (common // {
|
||||
mv "$libmysqlclient_path" "$out"/lib/libmysqlclient${libExt}
|
||||
ln -sv libmysqlclient${libExt} "$out"/lib/libmysqlclient_r${libExt}
|
||||
'';
|
||||
});
|
||||
});
|
||||
|
||||
server = packageSettings: let
|
||||
common = commonOptions packageSettings;
|
||||
|
||||
in stdenv.mkDerivation (common // {
|
||||
server = stdenv.mkDerivation (common // {
|
||||
pname = "mariadb-server";
|
||||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
nativeBuildInputs = common.nativeBuildInputs ++ [ bison boost.dev flex ];
|
||||
|
||||
buildInputs = common.buildInputs ++ [
|
||||
@ -189,8 +177,6 @@ in stdenv.mkDerivation (common // {
|
||||
(lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) pmdk.lib
|
||||
++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) numactl);
|
||||
|
||||
patches = common.patches;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace scripts/galera_new_cluster.sh \
|
||||
--replace ":-mariadb" ":-mysql"
|
||||
@ -243,36 +229,53 @@ in stdenv.mkDerivation (common // {
|
||||
|
||||
CXXFLAGS = lib.optionalString stdenv.hostPlatform.isi686 "-fpermissive";
|
||||
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic";
|
||||
});
|
||||
in {
|
||||
mariadb_104 = mariadbPackage {
|
||||
});
|
||||
in
|
||||
server // {
|
||||
inherit client server;
|
||||
};
|
||||
in
|
||||
self: {
|
||||
mariadb_104 = self.callPackage generic {
|
||||
# Supported until 2024-06-18
|
||||
version = "10.4.26";
|
||||
hash = "sha256-cVrH4jr8O4pVnGzJmM2xlz2Q9iGyvddgPixuU4YLLd8=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
mariadb_105 = mariadbPackage {
|
||||
mariadb_105 = self.callPackage generic {
|
||||
# Supported until 2025-06-24
|
||||
version = "10.5.17";
|
||||
hash = "sha256-hJyEC3b0hWUDtD7zqEH8lx6LUYjI3zaQkTv1aZaRt2E=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
mariadb_106 = mariadbPackage {
|
||||
mariadb_106 = self.callPackage generic {
|
||||
# Supported until 2026-07
|
||||
version = "10.6.10";
|
||||
hash = "sha256-atn6hvDIXI7q+tJkNUnV/13ShyAClk51R1LekYY6o7c=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
mariadb_107 = mariadbPackage {
|
||||
mariadb_107 = self.callPackage generic {
|
||||
# Supported until 2023-02. TODO: remove ahead of 22.11 release.
|
||||
version = "10.7.6";
|
||||
hash = "sha256-erX7pDmQV33BdPG5a9NAszN8G9Rv48NmIgsJ0siNLqA=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
mariadb_108 = mariadbPackage {
|
||||
mariadb_108 = self.callPackage generic {
|
||||
# Supported until 2023-05
|
||||
version = "10.8.5";
|
||||
hash = "sha256-z37TjDYTTNgYP93WTLPlD1ROgmS6dCAlXbEpcJfgjos=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
mariadb_109 = mariadbPackage {
|
||||
mariadb_109 = self.callPackage generic {
|
||||
# Supported until 2023-08(?)
|
||||
version = "10.9.3";
|
||||
hash = "sha256-mh4imXL8zMgnDmM/aNP7gk2hUdz09T2h342UesqHa+4=";
|
||||
inherit (self.darwin) cctools;
|
||||
inherit (self.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -23681,10 +23681,7 @@ with pkgs;
|
||||
asio = asio_1_10;
|
||||
};
|
||||
|
||||
inherit (callPackage ../servers/sql/mariadb {
|
||||
inherit (darwin) cctools;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices;
|
||||
})
|
||||
inherit (import ../servers/sql/mariadb pkgs)
|
||||
mariadb_104
|
||||
mariadb_105
|
||||
mariadb_106
|
||||
@ -23693,11 +23690,7 @@ with pkgs;
|
||||
mariadb_109
|
||||
;
|
||||
mariadb = mariadb_106;
|
||||
mariadb-embedded = (callPackage ../servers/sql/mariadb {
|
||||
inherit (darwin) cctools;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices;
|
||||
withEmbedded = true;
|
||||
}).mariadb_106;
|
||||
mariadb-embedded = mariadb.override { withEmbedded = true; };
|
||||
|
||||
mongodb = hiPrio mongodb-3_4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user