2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
|
2022-02-10 20:34:41 +00:00
|
|
|
, boost, icu, libedit, libevent, lz4, ncurses, openssl, protobuf, re2, readline, zlib, zstd, libfido2
|
2023-10-09 19:29:22 +00:00
|
|
|
, numactl, cctools, CoreServices, developer_cmds, libtirpc, rpcsvc-proto, curl, DarwinTools, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mysql";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "8.0.37";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-10-09 19:29:22 +00:00
|
|
|
url = "https://dev.mysql.com/get/Downloads/MySQL-${lib.versions.majorMinor finalAttrs.version}/mysql-${finalAttrs.version}.tar.gz";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-4GOgkazZ7EC7BfLATfZPiZan5OJuiDu2UChJ1fa0pho=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
nativeBuildInputs = [ bison cmake pkg-config ]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
## 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
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-14 18:05:37 +00:00
|
|
|
boost (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
|
2022-02-10 20:34:41 +00:00
|
|
|
zstd libfido2
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-10-16 20:44:37 +00:00
|
|
|
numactl libtirpc
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2021-08-22 07:53:02 +00:00
|
|
|
cctools CoreServices developer_cmds DarwinTools
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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 = {
|
2023-10-09 19:29:22 +00:00
|
|
|
client = finalAttrs.finalPackage;
|
|
|
|
connector-c = finalAttrs.finalPackage;
|
|
|
|
server = finalAttrs.finalPackage;
|
|
|
|
mysqlVersion = lib.versions.majorMinor finalAttrs.version;
|
2022-02-10 20:34:41 +00:00
|
|
|
tests = nixosTests.mysql.mysql80;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.mysql.com/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "World's most popular open source database";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ orivej ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|