mysql84: init at 8.4.0 (#309374)

authored by Shyim and committed by GitHub 9aed588e 27713bdb

+102
+24
pkgs/by-name/my/mysql84/no-force-outline-atomics.patch
···
··· 1 + diff --git a/CMakeLists.txt b/CMakeLists.txt 2 + index 727d66011f9..acae1aada57 100644 3 + --- a/CMakeLists.txt 4 + +++ b/CMakeLists.txt 5 + @@ -1338,19 +1338,6 @@ IF(UNIX AND MY_COMPILER_IS_GNU_OR_CLANG 6 + ENDIF() 7 + ENDIF() 8 + 9 + -# For aarch64 some sub-architectures support LSE atomics and some don't. Thus, 10 + -# compiling for the common denominator (-march=armv8-a) means LSE is not used. 11 + -# The -moutline-atomics switch enables run-time detection of LSE support. 12 + -# There are compilers (gcc 9.3.1 for example) which support this switch, but 13 + -# do not enable it by default, even though it seems to help. So, we force it. 14 + -IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") 15 + - MY_CHECK_CXX_COMPILER_FLAG( "-moutline-atomics" HAVE_OUTLINE_ATOMICS) 16 + - IF(HAVE_OUTLINE_ATOMICS) 17 + - STRING_APPEND(CMAKE_C_FLAGS " -moutline-atomics") 18 + - STRING_APPEND(CMAKE_CXX_FLAGS " -moutline-atomics") 19 + - ENDIF() 20 + -ENDIF() 21 + - 22 + IF(LINUX) 23 + OPTION(LINK_RANDOMIZE "Randomize the order of all symbols in the binary" OFF) 24 + SET(LINK_RANDOMIZE_SEED "mysql"
+78
pkgs/by-name/my/mysql84/package.nix
···
··· 1 + { lib, stdenv, fetchurl, bison, cmake, pkg-config 2 + , icu, libedit, libevent, lz4, ncurses, openssl, protobuf_21, re2, readline, zlib, zstd, libfido2 3 + , darwin, numactl, libtirpc, rpcsvc-proto, curl 4 + }: 5 + 6 + stdenv.mkDerivation (finalAttrs: { 7 + pname = "mysql"; 8 + version = "8.4.0"; 9 + 10 + src = fetchurl { 11 + url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor finalAttrs.version}/mysql-${finalAttrs.version}.tar.gz"; 12 + hash = "sha256-R6VDP83WOduDa5nhtUWcK4E8va0j/ytd1K0n95K6kY4="; 13 + }; 14 + 15 + nativeBuildInputs = [ bison cmake pkg-config ] 16 + ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ]; 17 + 18 + patches = [ 19 + ./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch 20 + ]; 21 + 22 + ## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references. 23 + postPatch = '' 24 + substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool 25 + substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool 26 + ''; 27 + 28 + buildInputs = [ 29 + (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf_21 re2 readline zlib 30 + zstd libfido2 31 + ] ++ lib.optionals stdenv.isLinux [ 32 + numactl libtirpc 33 + ] ++ lib.optionals stdenv.isDarwin [ 34 + darwin.cctools darwin.apple_sdk.frameworks.CoreServices darwin.developer_cmds darwin.DarwinTools 35 + ]; 36 + 37 + outputs = [ "out" "static" ]; 38 + 39 + cmakeFlags = [ 40 + "-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin. 41 + "-DWITH_ROUTER=OFF" # It may be packaged separately. 42 + "-DWITH_SYSTEM_LIBS=ON" 43 + "-DWITH_UNIT_TESTS=OFF" 44 + "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" 45 + "-DMYSQL_DATADIR=/var/lib/mysql" 46 + "-DINSTALL_INFODIR=share/mysql/docs" 47 + "-DINSTALL_MANDIR=share/man" 48 + "-DINSTALL_PLUGINDIR=lib/mysql/plugin" 49 + "-DINSTALL_INCLUDEDIR=include/mysql" 50 + "-DINSTALL_DOCREADMEDIR=share/mysql" 51 + "-DINSTALL_SUPPORTFILESDIR=share/mysql" 52 + "-DINSTALL_MYSQLSHAREDIR=share/mysql" 53 + "-DINSTALL_MYSQLTESTDIR=" 54 + "-DINSTALL_DOCDIR=share/mysql/docs" 55 + "-DINSTALL_SHAREDIR=share/mysql" 56 + ]; 57 + 58 + postInstall = '' 59 + moveToOutput "lib/*.a" $static 60 + so=${stdenv.hostPlatform.extensions.sharedLibrary} 61 + ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so 62 + ''; 63 + 64 + passthru = { 65 + client = finalAttrs.finalPackage; 66 + connector-c = finalAttrs.finalPackage; 67 + server = finalAttrs.finalPackage; 68 + mysqlVersion = lib.versions.majorMinor finalAttrs.version; 69 + }; 70 + 71 + meta = with lib; { 72 + homepage = "https://www.mysql.com/"; 73 + description = "The world's most popular open source database"; 74 + license = licenses.gpl2; 75 + maintainers = with maintainers; [ orivej shyim ]; 76 + platforms = platforms.unix; 77 + }; 78 + })