forked from mirrors/nixpkgs
Merge pull request #44343 from Izorkin/mariadb-10.3
mariadb: 10.2.17 -> 10.3.15
This commit is contained in:
commit
75a82b54a1
16
pkgs/servers/sql/mariadb/cmake-plugin-includedir.patch
Normal file
16
pkgs/servers/sql/mariadb/cmake-plugin-includedir.patch
Normal file
|
@ -0,0 +1,16 @@
|
|||
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
|
||||
index 31291d26..fad52814 100644
|
||||
--- a/cmake/plugin.cmake
|
||||
+++ b/cmake/plugin.cmake
|
||||
@@ -34,6 +34,11 @@ MACRO(MYSQL_ADD_PLUGIN)
|
||||
"LINK_LIBRARIES;DEPENDENCIES"
|
||||
${ARGN}
|
||||
)
|
||||
+
|
||||
+ IF(WITHOUT_SERVER OR ARG_CLIENT)
|
||||
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
+ ENDIF()
|
||||
+
|
||||
IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
|
||||
|
||||
# Add common include directories
|
|
@ -1,5 +1,5 @@
|
|||
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, ncurses, zlib, xz, lzo, lz4, bzip2, snappy
|
||||
, libiconv, openssl, pcre, boost, judy, bison, libxml2
|
||||
, libiconv, openssl, pcre, boost, judy, bison, libxml2, libkrb5
|
||||
, libaio, libevent, jemalloc, cracklib, systemd, numactl, perl
|
||||
, fixDarwinDylibNames, cctools, CoreServices
|
||||
, asio, buildEnv, check, scons
|
||||
|
@ -22,14 +22,14 @@ galeraLibs = buildEnv {
|
|||
};
|
||||
|
||||
common = rec { # attributes common to both builds
|
||||
version = "10.2.17";
|
||||
version = "10.3.15";
|
||||
|
||||
src = fetchurl {
|
||||
urls = [
|
||||
"https://downloads.mariadb.org/f/mariadb-${version}/source/mariadb-${version}.tar.gz"
|
||||
"https://downloads.mariadb.com/MariaDB/mariadb-${version}/source/mariadb-${version}.tar.gz"
|
||||
];
|
||||
sha256 = "09xy6mgnz22mz8zgqlnddn8nzgs9xlz8lai4a7aa8x78in7hgcz7";
|
||||
sha256 = "0s399nxk2z8fgdr527p64y74zwjc3gpv7psf1n2r6ksl9njr3wr7";
|
||||
name = "mariadb-${version}.tar.gz";
|
||||
};
|
||||
|
||||
|
@ -37,52 +37,50 @@ common = rec { # attributes common to both builds
|
|||
|
||||
buildInputs = [
|
||||
ncurses openssl zlib pcre jemalloc libiconv
|
||||
] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd ]
|
||||
] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd libkrb5 ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
|
||||
|
||||
prePatch = ''
|
||||
sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
|
||||
'';
|
||||
|
||||
patches = [ ./cmake-includedir.patch ./include-dirs-path.patch ]
|
||||
patches = [ ./cmake-includedir.patch ]
|
||||
++ stdenv.lib.optional stdenv.cc.isClang ./clang-isfinite.patch;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_CONFIG=mysql_release"
|
||||
"-DMANUFACTURER=NixOS.org"
|
||||
"-DDEFAULT_CHARSET=utf8"
|
||||
"-DDEFAULT_COLLATION=utf8_general_ci"
|
||||
"-DDEFAULT_CHARSET=utf8mb4"
|
||||
"-DDEFAULT_COLLATION=utf8mb4_unicode_ci"
|
||||
"-DSECURITY_HARDENED=ON"
|
||||
|
||||
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
|
||||
"-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock"
|
||||
"-DINSTALL_BINDIR=bin"
|
||||
"-DINSTALL_DOCDIR=share/doc/mysql"
|
||||
"-DINSTALL_DOCREADMEDIR=share/doc/mysql"
|
||||
"-DINSTALL_INCLUDEDIR=include/mysql"
|
||||
"-DINSTALL_INFODIR=share/mysql/docs"
|
||||
"-DINSTALL_MANDIR=share/man"
|
||||
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
|
||||
"-DINSTALL_SCRIPTDIR=bin"
|
||||
"-DINSTALL_SUPPORTFILESDIR=share/doc/mysql"
|
||||
"-DINSTALL_MYSQLTESTDIR=OFF"
|
||||
"-DINSTALL_SQLBENCHDIR=OFF"
|
||||
|
||||
"-DWITH_ZLIB=system"
|
||||
"-DWITH_SSL=system"
|
||||
"-DWITH_PCRE=system"
|
||||
|
||||
"-DWITH_SAFEMALLOC=OFF"
|
||||
"-DEMBEDDED_LIBRARY=OFF"
|
||||
] ++ optional stdenv.isDarwin [
|
||||
# On Darwin without sandbox, CMake will find the system java and attempt to build with java support, but
|
||||
# then it will fail during the actual build. Let's just disable the flag explicitly until someone decides
|
||||
# to pass in java explicitly. This should have no effect on Linux.
|
||||
# to pass in java explicitly.
|
||||
"-DCONNECT_WITH_JDBC=OFF"
|
||||
|
||||
# Same as above. Somehow on Darwin CMake decides that we support GSS even though we aren't provding the
|
||||
# library through Nix, and then breaks later on. This should have no effect on Linux.
|
||||
"-DPLUGIN_AUTH_GSSAPI=NO"
|
||||
"-DPLUGIN_AUTH_GSSAPI_CLIENT=NO"
|
||||
]
|
||||
++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
|
||||
++ optional stdenv.hostPlatform.isMusl "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
|
||||
;
|
||||
|
||||
preConfigure = ''
|
||||
cmakeFlags="$cmakeFlags -DINSTALL_INCLUDEDIR=''${!outputDev}/include/mysql"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
rm "$out"/lib/*.a
|
||||
find "''${!outputBin}/bin" -name '*test*' -delete
|
||||
'';
|
||||
"-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
|
||||
] ++ optional stdenv.hostPlatform.isMusl [
|
||||
"-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
|
||||
];
|
||||
|
||||
passthru.mysqlVersion = "5.7";
|
||||
|
||||
|
@ -98,28 +96,26 @@ common = rec { # attributes common to both builds
|
|||
client = stdenv.mkDerivation (common // {
|
||||
name = "mariadb-client-${common.version}";
|
||||
|
||||
outputs = [ "bin" "dev" "out" ];
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
propagatedBuildInputs = [ openssl zlib ]; # required from mariadb.pc
|
||||
|
||||
patches = [ ./cmake-plugin-includedir.patch ];
|
||||
|
||||
cmakeFlags = common.cmakeFlags ++ [
|
||||
"-DWITHOUT_SERVER=ON"
|
||||
"-DWITH_WSREP=OFF"
|
||||
];
|
||||
|
||||
preConfigure = common.preConfigure + ''
|
||||
cmakeFlags="$cmakeFlags \
|
||||
-DINSTALL_BINDIR=$bin/bin \
|
||||
-DINSTALL_SCRIPTDIR=$bin/bin \
|
||||
-DINSTALL_SUPPORTFILESDIR=$bin/share/mysql \
|
||||
-DINSTALL_DOCDIR=$bin/share/doc/mysql \
|
||||
-DINSTALL_DOCREADMEDIR=$bin/share/doc/mysql \
|
||||
"
|
||||
'';
|
||||
|
||||
# prevent cycle; it needs to reference $dev
|
||||
postInstall = common.postInstall + ''
|
||||
moveToOutput bin/mysql_config "$dev"
|
||||
moveToOutput bin/mariadb_config "$dev"
|
||||
postInstall = ''
|
||||
rm -r "$out"/share/mysql
|
||||
rm -r "$out"/share/doc
|
||||
rm "$out"/bin/{msql2mysql,mysql_plugin,mytop,wsrep_sst_rsync_wan,mysql_config,mariadb_config}
|
||||
rm "$out"/lib/plugin/{daemon_example.ini,dialog.so,mysql_clear_password.so,sha256_password.so}
|
||||
rm "$out"/lib/{libmariadb.so,libmysqlclient.so,libmysqlclient_r.so}
|
||||
mv "$out"/lib/libmariadb.so.3 "$out"/lib/libmysqlclient.so
|
||||
ln -sv libmysqlclient.so "$out"/lib/libmysqlclient_r.so
|
||||
mkdir -p "$dev"/lib && mv "$out"/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true; # the client should be OK
|
||||
|
@ -128,6 +124,8 @@ client = stdenv.mkDerivation (common // {
|
|||
everything = stdenv.mkDerivation (common // {
|
||||
name = "mariadb-${common.version}";
|
||||
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
nativeBuildInputs = common.nativeBuildInputs ++ [ bison ];
|
||||
|
||||
buildInputs = common.buildInputs ++ [
|
||||
|
@ -137,39 +135,36 @@ everything = stdenv.mkDerivation (common // {
|
|||
|
||||
cmakeFlags = common.cmakeFlags ++ [
|
||||
"-DMYSQL_DATADIR=/var/lib/mysql"
|
||||
"-DINSTALL_SYSCONFDIR=etc/mysql"
|
||||
"-DINSTALL_INFODIR=share/mysql/docs"
|
||||
"-DINSTALL_MANDIR=share/man"
|
||||
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
|
||||
"-DINSTALL_SCRIPTDIR=bin"
|
||||
"-DINSTALL_SUPPORTFILESDIR=share/mysql"
|
||||
"-DINSTALL_DOCREADMEDIR=share/doc/mysql"
|
||||
"-DINSTALL_DOCDIR=share/doc/mysql"
|
||||
"-DINSTALL_SHAREDIR=share/mysql"
|
||||
"-DINSTALL_MYSQLTESTDIR=OFF"
|
||||
"-DINSTALL_SQLBENCHDIR=OFF"
|
||||
|
||||
"-DENABLED_LOCAL_INFILE=ON"
|
||||
"-DENABLED_LOCAL_INFILE=OFF"
|
||||
"-DWITH_READLINE=ON"
|
||||
"-DWITH_EXTRA_CHARSETS=complex"
|
||||
"-DWITH_EMBEDDED_SERVER=ON"
|
||||
"-DWITH_ARCHIVE_STORAGE_ENGINE=1"
|
||||
"-DWITH_BLACKHOLE_STORAGE_ENGINE=1"
|
||||
"-DWITH_INNOBASE_STORAGE_ENGINE=1"
|
||||
"-DWITH_PARTITION_STORAGE_ENGINE=1"
|
||||
"-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1"
|
||||
"-DWITHOUT_FEDERATED_STORAGE_ENGINE=1"
|
||||
"-DWITH_EXTRA_CHARSETS=all"
|
||||
"-DWITH_EMBEDDED_SERVER=OFF"
|
||||
"-DWITH_UNIT_TESTS=OFF"
|
||||
"-DWITH_WSREP=ON"
|
||||
"-DWITH_INNODB_DISALLOW_WRITES=ON"
|
||||
"-DWITHOUT_EXAMPLE=1"
|
||||
"-DWITHOUT_FEDERATED=1"
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||
"-DWITHOUT_OQGRAPH_STORAGE_ENGINE=1"
|
||||
"-DWITHOUT_OQGRAPH=1"
|
||||
"-DWITHOUT_TOKUDB=1"
|
||||
];
|
||||
|
||||
postInstall = common.postInstall + ''
|
||||
preConfigure = ''
|
||||
cmakeFlags="$cmakeFlags \
|
||||
-DINSTALL_SHAREDIR=$dev/share/mysql
|
||||
-DINSTALL_SUPPORTFILESDIR=$dev/share/mysql"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
chmod +x "$out"/bin/wsrep_sst_common
|
||||
rm -r "$out"/data # Don't need testing data
|
||||
rm "$out"/share/man/man1/mysql-test-run.pl.1
|
||||
rm "$out"/bin/rcmysql
|
||||
rm "$out"/bin/{mysql_find_rows,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck}
|
||||
rm "$out"/bin/{mysqldump,mysqlhotcopy,mysqlimport,mysqlshow,mysqlslap,mysqltest}
|
||||
rm "$out"/lib/mysql/plugin/{auth_gssapi_client.so,client_ed25519.so,daemon_example.ini}
|
||||
rm "$out"/lib/{libmysqlclient.so,libmysqlclient_r.so}
|
||||
mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
|
||||
mkdir -p "$dev"/lib && mv "$out"/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib
|
||||
'' + optionalString (! stdenv.isDarwin) ''
|
||||
sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
|
||||
'';
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
index 45d2f4e..e5666db 100644
|
||||
--- a/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
+++ b/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
static char *mariadb_progname;
|
||||
|
||||
-#define INCLUDE "-I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
|
||||
+#define INCLUDE "-I@INSTALL_INCLUDEDIR@ -I@INSTALL_INCLUDEDIR@/mysql"
|
||||
#define LIBS "-L@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb @extra_dynamic_LDFLAGS@"
|
||||
#define LIBS_SYS "@extra_dynamic_LDFLAGS@"
|
||||
#define CFLAGS INCLUDE
|
|
@ -14425,7 +14425,9 @@ in
|
|||
|
||||
mariadb = callPackage ../servers/sql/mariadb {
|
||||
asio = asio_1_10;
|
||||
jemalloc = jemalloc.override ({ disableInitExecTls = true; });
|
||||
# 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; });
|
||||
inherit (darwin) cctools;
|
||||
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue