mysql84: init at 8.4.0 (#309374)

This commit is contained in:
Shyim 2024-05-12 19:51:57 +02:00 committed by GitHub
parent 27713bdb9a
commit 9aed588e4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 727d66011f9..acae1aada57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1338,19 +1338,6 @@ IF(UNIX AND MY_COMPILER_IS_GNU_OR_CLANG
ENDIF()
ENDIF()
-# For aarch64 some sub-architectures support LSE atomics and some don't. Thus,
-# compiling for the common denominator (-march=armv8-a) means LSE is not used.
-# The -moutline-atomics switch enables run-time detection of LSE support.
-# There are compilers (gcc 9.3.1 for example) which support this switch, but
-# do not enable it by default, even though it seems to help. So, we force it.
-IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
- MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS)
- IF(HAVE_OUTLINE_ATOMICS)
- STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics")
- STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics")
- ENDIF()
-ENDIF()
-
IF(LINUX)
OPTION(LINK_RANDOMIZE "Randomize the order of all symbols in the binary" OFF)
SET(LINK_RANDOMIZE_SEED "mysql"

View File

@ -0,0 +1,78 @@
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, icu, libedit, libevent, lz4, ncurses, openssl, protobuf_21, re2, readline, zlib, zstd, libfido2
, darwin, numactl, libtirpc, rpcsvc-proto, curl
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mysql";
version = "8.4.0";
src = fetchurl {
url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor finalAttrs.version}/mysql-${finalAttrs.version}.tar.gz";
hash = "sha256-R6VDP83WOduDa5nhtUWcK4E8va0j/ytd1K0n95K6kY4=";
};
nativeBuildInputs = [ bison cmake pkg-config ]
++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
patches = [
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
];
## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references.
postPatch = ''
substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
'';
buildInputs = [
(curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf_21 re2 readline zlib
zstd libfido2
] ++ lib.optionals stdenv.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools darwin.apple_sdk.frameworks.CoreServices darwin.developer_cmds darwin.DarwinTools
];
outputs = [ "out" "static" ];
cmakeFlags = [
"-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
"-DWITH_ROUTER=OFF" # It may be packaged separately.
"-DWITH_SYSTEM_LIBS=ON"
"-DWITH_UNIT_TESTS=OFF"
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
"-DMYSQL_DATADIR=/var/lib/mysql"
"-DINSTALL_INFODIR=share/mysql/docs"
"-DINSTALL_MANDIR=share/man"
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
"-DINSTALL_INCLUDEDIR=include/mysql"
"-DINSTALL_DOCREADMEDIR=share/mysql"
"-DINSTALL_SUPPORTFILESDIR=share/mysql"
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
"-DINSTALL_MYSQLTESTDIR="
"-DINSTALL_DOCDIR=share/mysql/docs"
"-DINSTALL_SHAREDIR=share/mysql"
];
postInstall = ''
moveToOutput "lib/*.a" $static
so=${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
'';
passthru = {
client = finalAttrs.finalPackage;
connector-c = finalAttrs.finalPackage;
server = finalAttrs.finalPackage;
mysqlVersion = lib.versions.majorMinor finalAttrs.version;
};
meta = with lib; {
homepage = "https://www.mysql.com/";
description = "The world's most popular open source database";
license = licenses.gpl2;
maintainers = with maintainers; [ orivej shyim ];
platforms = platforms.unix;
};
})