nixpkgs/pkgs/servers/sql/mysql/8.0.x.nix
Thomas Gerbet d931f342a4 mysql80: 8.0.39 -> 8.0.40
Fixes:
* CVE-2024-21230
* CVE-2024-7264
* CVE-2024-21196
* CVE-2024-21238
* CVE-2024-21194
* CVE-2024-21199
* CVE-2024-21218
* CVE-2024-21236
* CVE-2024-21239
* CVE-2024-21198
* CVE-2024-21219
* CVE-2024-21203
* CVE-2024-21197
* CVE-2024-21201
* CVE-2024-21241
* CVE-2024-21193
* CVE-2024-21212
* CVE-2024-21213
* CVE-2024-21247
* CVE-2024-21231
* CVE-2024-21237

https://www.oracle.com/security-alerts/cpuoct2024.html#AppendixMSQL

Changes:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-40.html
2024-10-21 16:14:11 +02:00

80 lines
2.8 KiB
Nix

{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, boost, icu, libedit, libevent, lz4, ncurses, openssl, protobuf, re2, readline, zlib, zstd, libfido2
, numactl, cctools, CoreServices, developer_cmds, libtirpc, rpcsvc-proto, curl, DarwinTools, nixosTests
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mysql";
version = "8.0.40";
src = fetchurl {
url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor finalAttrs.version}/mysql-${finalAttrs.version}.tar.gz";
hash = "sha256-At/ZQ/lnQvf5zXiFWzJwjqTfVIycFK+Sc4F/O72dIrI=";
};
nativeBuildInputs = [ bison cmake pkg-config ]
++ lib.optionals (!stdenv.hostPlatform.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 = [
boost (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
zstd libfido2
] ++ lib.optionals stdenv.hostPlatform.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools CoreServices developer_cmds 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;
tests = nixosTests.mysql.mysql80;
};
meta = with lib; {
homepage = "https://www.mysql.com/";
description = "World's most popular open source database";
license = licenses.gpl2Only;
maintainers = with maintainers; [ orivej ];
platforms = platforms.unix;
};
})