mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
commit
c740bbf1ba
12
pkgs/servers/sql/mariadb/cmake-fix-crypt-libs.patch
Normal file
12
pkgs/servers/sql/mariadb/cmake-fix-crypt-libs.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/libmariadb/plugins/auth/CMakeLists.txt b/libmariadb/plugins/auth/CMakeLists.txt
|
||||
index aa599418..7a51f73b 100644
|
||||
--- a/libmariadb/plugins/auth/CMakeLists.txt
|
||||
+++ b/libmariadb/plugins/auth/CMakeLists.txt
|
||||
@@ -50,6 +50,7 @@ IF(WITH_SSL)
|
||||
${REF10_SOURCES}
|
||||
${CRYPT_SOURCE}
|
||||
INCLUDES ${REF10_DIR}
|
||||
+ LIBRARIES ${ED25519_LIBS}
|
||||
COMPILE_OPTIONS -DMYSQL_CLIENT=1)
|
||||
IF(MSVC)
|
||||
# Silence conversion (integer truncantion) warnings from reference code
|
21
pkgs/servers/sql/mariadb/cmake-libmariadb-includedir.patch
Normal file
21
pkgs/servers/sql/mariadb/cmake-libmariadb-includedir.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/libmariadb/mariadb_config/mariadb_config.c.in b/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
index 703c9466..c6d3f1bc 100644
|
||||
--- a/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
+++ b/libmariadb/mariadb_config/mariadb_config.c.in
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
static char *mariadb_progname;
|
||||
|
||||
-#define INCLUDE "-I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
|
||||
-#define LIBS "-L@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
|
||||
+#define INCLUDE "-I@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_INCLUDEDIR@/mysql"
|
||||
+#define LIBS "-L@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_LIBDIR@/ -lmariadb"
|
||||
#define LIBS_SYS "@extra_dynamic_LDFLAGS@"
|
||||
#define CFLAGS INCLUDE
|
||||
#define VERSION "@MARIADB_CLIENT_VERSION@"
|
||||
#define CC_VERSION "@CPACK_PACKAGE_VERSION@"
|
||||
-#define PLUGIN_DIR "@CMAKE_INSTALL_PREFIX@/@INSTALL_PLUGINDIR@"
|
||||
+#define PLUGIN_DIR "@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_PLUGINDIR@"
|
||||
#define SOCKET "@MARIADB_UNIX_ADDR@"
|
||||
#define PORT "@MARIADB_PORT@"
|
||||
#define TLS_LIBRARY_VERSION "@TLS_LIBRARY_VERSION@"
|
15
pkgs/servers/sql/mariadb/cmake-without-client.patch
Normal file
15
pkgs/servers/sql/mariadb/cmake-without-client.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 1ea7c1df..b0face0d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -176,6 +176,10 @@ ELSE()
|
||||
SET (SKIP_COMPONENTS "N-O-N-E")
|
||||
ENDIF()
|
||||
|
||||
+IF (WITHOUT_CLIENT)
|
||||
+ SET (SKIP_COMPONENTS "Client|ClientPlugins|ManPagesClient")
|
||||
+ENDIF()
|
||||
+
|
||||
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
|
||||
|
||||
INCLUDE(check_compiler_flag)
|
@ -4,6 +4,7 @@
|
||||
, fixDarwinDylibNames, cctools, CoreServices
|
||||
, asio, buildEnv, check, scons
|
||||
, less
|
||||
, withoutClient ? false
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
@ -14,9 +15,9 @@ libExt = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
|
||||
mytopEnv = perl.withPackages (p: with p; [ DataDumper DBDmysql DBI TermReadKey ]);
|
||||
|
||||
mariadb = everything // {
|
||||
inherit client; # libmysqlclient.so in .out, necessary headers in .dev and utils in .bin
|
||||
server = everything; # a full single-output build, including everything in `client` again
|
||||
mariadb = server // {
|
||||
inherit client; # MariaDB Client
|
||||
server = server; # MariaDB Server
|
||||
inherit connector-c; # libmysqlclient.so
|
||||
inherit galera;
|
||||
};
|
||||
@ -27,14 +28,14 @@ galeraLibs = buildEnv {
|
||||
};
|
||||
|
||||
common = rec { # attributes common to both builds
|
||||
version = "10.3.15";
|
||||
version = "10.3.17";
|
||||
|
||||
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 = "0s399nxk2z8fgdr527p64y74zwjc3gpv7psf1n2r6ksl9njr3wr7";
|
||||
sha256 = "15vh15az16932q42y9dxpzwxldmh0x4hvzrar3f8kblsqm7ym890";
|
||||
name = "mariadb-${version}.tar.gz";
|
||||
};
|
||||
|
||||
@ -42,19 +43,18 @@ common = rec { # attributes common to both builds
|
||||
|
||||
buildInputs = [
|
||||
ncurses openssl zlib pcre jemalloc libiconv
|
||||
] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd libkrb5 ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
|
||||
] ++ optionals stdenv.isLinux [ libaio systemd libkrb5 ]
|
||||
++ 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 ]
|
||||
++ optionals stdenv.isDarwin [
|
||||
# Derived from "Fixed c++11 narrowing error"
|
||||
# https://github.com/MariaDB/server/commit/a0dfefb0f8a47145e599a5f1b0dc576fa7634b92
|
||||
./fix-c++11-narrowing-error.patch
|
||||
];
|
||||
patches = [
|
||||
./cmake-includedir.patch
|
||||
./cmake-libmariadb-includedir.patch
|
||||
./cmake-fix-crypt-libs.patch
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_CONFIG=mysql_release"
|
||||
@ -68,6 +68,8 @@ common = rec { # attributes common to both builds
|
||||
"-DINSTALL_DOCDIR=share/doc/mysql"
|
||||
"-DINSTALL_DOCREADMEDIR=share/doc/mysql"
|
||||
"-DINSTALL_INCLUDEDIR=include/mysql"
|
||||
"-DINSTALL_LIBDIR=lib/mysql"
|
||||
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
|
||||
"-DINSTALL_INFODIR=share/mysql/docs"
|
||||
"-DINSTALL_MANDIR=share/man"
|
||||
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
|
||||
@ -80,20 +82,30 @@ common = rec { # attributes common to both builds
|
||||
"-DWITH_SSL=system"
|
||||
"-DWITH_PCRE=system"
|
||||
"-DWITH_SAFEMALLOC=OFF"
|
||||
"-DWITH_UNIT_TESTS=OFF"
|
||||
"-DEMBEDDED_LIBRARY=OFF"
|
||||
] ++ optional stdenv.isDarwin [
|
||||
] ++ optionals 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.
|
||||
"-DCONNECT_WITH_JDBC=OFF"
|
||||
"-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
|
||||
] ++ optional stdenv.hostPlatform.isMusl [
|
||||
] ++ optionals stdenv.hostPlatform.isMusl [
|
||||
"-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
rm "$out"/lib/mysql/plugin/daemon_example.ini
|
||||
mkdir -p "$dev"/bin && mv "$out"/bin/{mariadb_config,mysql_config} "$dev"/bin
|
||||
mkdir -p "$dev"/lib/mysql && mv "$out"/lib/mysql/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib/mysql
|
||||
mkdir -p "$dev"/lib/mysql/plugin && mv "$out"/lib/mysql/plugin/{caching_sha2_password.so,dialog.so,mysql_clear_password.so,sha256_password.so} "$dev"/lib/mysql/plugin
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.mysqlVersion = "5.7";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = {
|
||||
description = "An enhanced, drop-in replacement for MySQL";
|
||||
homepage = https://mariadb.org/;
|
||||
license = licenses.gpl2;
|
||||
@ -103,36 +115,40 @@ common = rec { # attributes common to both builds
|
||||
};
|
||||
|
||||
client = stdenv.mkDerivation (common // {
|
||||
name = "mariadb-client-${common.version}";
|
||||
pname = "mariadb-client";
|
||||
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
propagatedBuildInputs = [ openssl zlib ]; # required from mariadb.pc
|
||||
|
||||
patches = [ ./cmake-plugin-includedir.patch ];
|
||||
patches = common.patches ++ [
|
||||
./cmake-plugin-includedir.patch
|
||||
];
|
||||
|
||||
cmakeFlags = common.cmakeFlags ++ [
|
||||
"-DWITHOUT_SERVER=ON"
|
||||
"-DWITH_WSREP=OFF"
|
||||
"-DINSTALL_MYSQLSHAREDIR=share/mysql-client"
|
||||
];
|
||||
|
||||
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}
|
||||
libmysqlclient_path=$(readlink -f $out/lib/libmysqlclient${libExt})
|
||||
rm "$out"/lib/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}}
|
||||
mv "$libmysqlclient_path" "$out"/lib/libmysqlclient${libExt}
|
||||
ln -sv libmysqlclient${libExt} "$out"/lib/libmysqlclient_r${libExt}
|
||||
mkdir -p "$dev"/lib && mv "$out"/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib
|
||||
preConfigure = ''
|
||||
cmakeFlags="$cmakeFlags \
|
||||
-DCMAKE_INSTALL_PREFIX_DEV=$dev"
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true; # the client should be OK
|
||||
postInstall = common.postInstall + ''
|
||||
rm -r "$out"/share/doc
|
||||
rm "$out"/bin/{mysqltest,mytop,wsrep_sst_rsync_wan}
|
||||
libmysqlclient_path=$(readlink -f $out/lib/mysql/libmysqlclient${libExt})
|
||||
rm "$out"/lib/mysql/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}}
|
||||
mv "$libmysqlclient_path" "$out"/lib/mysql/libmysqlclient${libExt}
|
||||
ln -sv libmysqlclient${libExt} "$out"/lib/mysql/libmysqlclient_r${libExt}
|
||||
|
||||
'';
|
||||
});
|
||||
|
||||
everything = stdenv.mkDerivation (common // {
|
||||
name = "mariadb-${common.version}";
|
||||
server = stdenv.mkDerivation (common // {
|
||||
pname = "mariadb-server";
|
||||
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
@ -144,6 +160,10 @@ everything = stdenv.mkDerivation (common // {
|
||||
] ++ optional (stdenv.isLinux && !stdenv.isAarch32) numactl
|
||||
++ optional (!stdenv.isDarwin) mytopEnv;
|
||||
|
||||
patches = common.patches ++ [
|
||||
./cmake-without-client.patch
|
||||
];
|
||||
|
||||
cmakeFlags = common.cmakeFlags ++ [
|
||||
"-DMYSQL_DATADIR=/var/lib/mysql"
|
||||
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
|
||||
@ -156,6 +176,8 @@ everything = stdenv.mkDerivation (common // {
|
||||
"-DWITH_INNODB_DISALLOW_WRITES=ON"
|
||||
"-DWITHOUT_EXAMPLE=1"
|
||||
"-DWITHOUT_FEDERATED=1"
|
||||
] ++ stdenv.lib.optionals withoutClient [
|
||||
"-DWITHOUT_CLIENT=ON"
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||
"-DWITHOUT_OQGRAPH=1"
|
||||
"-DWITHOUT_TOKUDB=1"
|
||||
@ -163,27 +185,27 @@ everything = stdenv.mkDerivation (common // {
|
||||
|
||||
preConfigure = ''
|
||||
cmakeFlags="$cmakeFlags \
|
||||
-DCMAKE_INSTALL_PREFIX_DEV=$dev
|
||||
-DINSTALL_SHAREDIR=$dev/share/mysql
|
||||
-DINSTALL_SUPPORTFILESDIR=$dev/share/mysql"
|
||||
'' + optionalString (!stdenv.isDarwin) ''
|
||||
patchShebangs scripts/mytop.sh
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
postInstall = common.postInstall + ''
|
||||
chmod +x "$out"/bin/wsrep_sst_common
|
||||
rm "$out"/bin/mysql_client_test
|
||||
rm -r "$out"/data # Don't need testing data
|
||||
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/{libmysqlclient${libExt},libmysqlclient_r${libExt}}
|
||||
mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
|
||||
'' + optionalString withoutClient ''
|
||||
${ # We don't build with GSSAPI on Darwin
|
||||
optionalString (! stdenv.isDarwin) ''
|
||||
optionalString (!stdenv.isDarwin) ''
|
||||
rm "$out"/lib/mysql/plugin/auth_gssapi_client.so
|
||||
''
|
||||
}
|
||||
rm "$out"/lib/mysql/plugin/{client_ed25519.so,daemon_example.ini}
|
||||
rm "$out"/lib/{libmysqlclient${libExt},libmysqlclient_r${libExt}}
|
||||
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) ''
|
||||
rm "$out"/lib/mysql/plugin/client_ed25519.so
|
||||
'' + optionalString (!stdenv.isDarwin) ''
|
||||
sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
|
||||
'';
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/sql/table.cc b/sql/table.cc
|
||||
index e46af771507..9bef21a1da2 100644
|
||||
--- a/sql/table.cc
|
||||
+++ b/sql/table.cc
|
||||
@@ -8814,7 +8814,7 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
|
||||
|
||||
store(FLD_BEGIN_TS, thd->transaction_time());
|
||||
thd->set_time();
|
||||
- timeval end_time= {thd->query_start(), long(thd->query_start_sec_part())};
|
||||
+ timeval end_time= {thd->query_start(), int(thd->query_start_sec_part())};
|
||||
store(FLD_TRX_ID, start_id);
|
||||
store(FLD_COMMIT_ID, end_id);
|
||||
store(FLD_COMMIT_TS, end_time);
|
@ -194,6 +194,8 @@ mapAliases ({
|
||||
m3d-linux = m33-linux; # added 2016-08-13
|
||||
man_db = man-db; # added 2016-05
|
||||
manpages = man-pages; # added 2015-12-06
|
||||
mariadb-client = hiPrio mariadb.client; #added 2019.07.28
|
||||
mysql-client = hiPrio mariadb.client;
|
||||
memtest86 = memtest86plus; # added 2019-05-08
|
||||
mesa_noglu = mesa; # added 2019-05-28
|
||||
# NOTE: 2018-07-12: legacy alias:
|
||||
|
Loading…
Reference in New Issue
Block a user