Skip to content

Commit

Permalink
mariadb: add option to build server without tokudb storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Izorkin committed Apr 2, 2020
1 parent f75c11c commit 0296e67
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
6 changes: 6 additions & 0 deletions nixos/doc/manual/release-notes/rl-2003.xml
Expand Up @@ -757,6 +757,12 @@ auth required pam_succeed_if.so uid >= 1000 quiet
</warning>
</para>
</listitem>
<listitem>
<para>
The TokuDB storage engine will be disabled in <package>mariadb</package> 10.5. It is recommended to switch
to RocksDB. See also <link xlink:href="https://mariadb.com/kb/en/tokudb/">TokuDB</link>.
</para>
</listitem>
</itemizedlist>
</section>

Expand Down
21 changes: 13 additions & 8 deletions pkgs/servers/sql/mariadb/default.nix
@@ -1,9 +1,10 @@
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, makeWrapper, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
, libiconv, openssl, pcre, boost, judy, bison, libxml2, libkrb5, linux-pam, curl
, libaio, libevent, jemalloc, cracklib, systemd, perl
, libaio, libevent, jemalloc450, jemalloc, cracklib, systemd, perl
, fixDarwinDylibNames, cctools, CoreServices, less
, numactl # NUMA Support
, withStorageMroonga ? true, kytea, msgpack, zeromq
, withStorageToku ? true
}:

with stdenv.lib;
Expand Down Expand Up @@ -34,9 +35,11 @@ common = rec { # attributes common to both builds
nativeBuildInputs = [ cmake pkgconfig ];

buildInputs = [
ncurses openssl zlib pcre jemalloc libiconv curl
ncurses openssl zlib pcre libiconv curl
] ++ optionals stdenv.hostPlatform.isLinux [ libaio systemd libkrb5 ]
++ optionals stdenv.hostPlatform.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
++ optionals stdenv.hostPlatform.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ]
++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) [ jemalloc450 ]
++ optional (!stdenv.hostPlatform.isDarwin && !withStorageToku) [ jemalloc ];

prePatch = ''
sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
Expand Down Expand Up @@ -80,8 +83,6 @@ common = rec { # attributes common to both builds
# to pass in java explicitly.
"-DCONNECT_WITH_JDBC=OFF"
"-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
] ++ optionals stdenv.hostPlatform.isMusl [
"-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
];

postInstall = ''
Expand All @@ -99,6 +100,7 @@ common = rec { # attributes common to both builds
passthru.mysqlVersion = "5.7";

meta = {

description = "An enhanced, drop-in replacement for MySQL";
homepage = https://mariadb.org/;
license = licenses.gpl2;
Expand Down Expand Up @@ -166,10 +168,13 @@ server = stdenv.mkDerivation (common // {
] ++ optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) [
"-DWITH_NUMA=ON"
] ++ optional (!withStorageMroonga) [
"-DWITHOUT_MROONGA=ON"
] ++ optionals stdenv.hostPlatform.isDarwin [
"-DWITHOUT_OQGRAPH=1"
"-DWITHOUT_MROONGA=1"
] ++ optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isMusl || !withStorageToku) [
"-DWITHOUT_TOKUDB=1"
] ++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) [
"-DWITH_JEMALLOC=static"
] ++ optional stdenv.hostPlatform.isDarwin [
"-DWITHOUT_OQGRAPH=1"
];

preConfigure = optionalString (!stdenv.hostPlatform.isDarwin) ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -15771,7 +15771,7 @@ in
mariadb = callPackage ../servers/sql/mariadb {
# As per mariadb's cmake, "static jemalloc_pic.a can only be used up to jemalloc 4".
# https://jira.mariadb.org/browse/MDEV-15034
jemalloc = jemalloc450.override ({ disableInitExecTls = true; });
jemalloc450 = jemalloc450.override ({ disableInitExecTls = true; });
inherit (darwin) cctools;
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
};
Expand Down

0 comments on commit 0296e67

Please sign in to comment.