37 # Percona-specific deps
43 stdenv.mkDerivation (finalAttrs: {
44 pname = "percona-server";
45 version = "8.0.37-29";
48 url = "https://www.percona.com/downloads/Percona-Server-8.0/Percona-Server-${finalAttrs.version}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
49 hash = "sha256-zZgq3AxCRYdte3dTUJiuMvVGdl9U01s8jxcAqDxZiNM=";
57 # required for scripts/CMakeLists.txt
61 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ];
64 ./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
67 ## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references.
69 substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
70 substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
71 # The rocksdb setup script is called with `env -i` and cannot find anything in PATH.
72 patchShebangs storage/rocksdb/get_rocksdb_files.sh
73 substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace mktemp ${coreutils}/bin/mktemp
74 substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "rm $MKFILE" "${coreutils}/bin/rm $MKFILE"
75 substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --"
81 (curl.override { inherit openssl; })
98 ++ lib.optionals stdenv.hostPlatform.isLinux [
102 ++ lib.optionals stdenv.hostPlatform.isDarwin [
115 # Percona-specific flags.
118 "-DROCKSDB_DISABLE_AVX2=1"
119 "-DROCKSDB_DISABLE_MARCH_NATIVE=1"
121 # Flags taken from mysql package.
122 "-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
123 "-DWITH_ROUTER=OFF" # It may be packaged separately.
124 "-DWITH_SYSTEM_LIBS=ON"
125 "-DWITH_UNIT_TESTS=OFF"
126 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
127 "-DMYSQL_DATADIR=/var/lib/mysql"
128 "-DINSTALL_INFODIR=share/mysql/docs"
129 "-DINSTALL_MANDIR=share/man"
130 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
131 "-DINSTALL_INCLUDEDIR=include/mysql"
132 "-DINSTALL_DOCREADMEDIR=share/mysql"
133 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
134 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
135 "-DINSTALL_MYSQLTESTDIR="
136 "-DINSTALL_DOCDIR=share/mysql/docs"
137 "-DINSTALL_SHAREDIR=share/mysql"
141 moveToOutput "lib/*.a" $static
142 so=${stdenv.hostPlatform.extensions.sharedLibrary}
143 ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
145 wrapProgram $out/bin/mysqld_safe --prefix PATH : ${
154 wrapProgram $out/bin/mysql_config --prefix PATH : ${
160 wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${
166 wrapProgram $out/bin/ps-admin --prefix PATH : ${
172 wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
181 client = finalAttrs.finalPackage;
182 connector-c = finalAttrs.finalPackage;
183 server = finalAttrs.finalPackage;
184 mysqlVersion = lib.versions.majorMinor finalAttrs.version;
185 tests.percona-server = nixosTests.mysql.percona-server_8_0;
189 homepage = "https://www.percona.com/software/mysql-database/percona-server";
191 A free, fully compatible, enhanced, open source drop-in replacement for
192 MySQL® that provides superior performance, scalability and instrumentation.
193 Long-term support release.
195 license = licenses.gpl2Only;
196 maintainers = teams.flyingcircus.members;
197 platforms = platforms.unix;