{ungoogled-,}chromium,chromedriver: 130.0.6723.58 -> 130.0.6723.69 (#351519)
[NixPkgs.git] / pkgs / servers / sql / percona-server / 8_0.nix
blobe48afe07af8692b768729f5c2b157e1494d316b4
2   lib,
3   stdenv,
4   fetchurl,
5   bison,
6   cmake,
7   pkg-config,
8   boost,
9   icu,
10   libedit,
11   libevent,
12   lz4,
13   ncurses,
14   openssl,
15   perl,
16   protobuf,
17   re2,
18   readline,
19   zlib,
20   zstd,
21   libfido2,
22   numactl,
23   cctools,
24   CoreServices,
25   developer_cmds,
26   libtirpc,
27   rpcsvc-proto,
28   curl,
29   DarwinTools,
30   nixosTests,
31   coreutils,
32   procps,
33   gnused,
34   gnugrep,
35   hostname,
36   makeWrapper,
37   # Percona-specific deps
38   cyrus_sasl,
39   gnumake,
40   openldap,
43 stdenv.mkDerivation (finalAttrs: {
44   pname = "percona-server";
45   version = "8.0.37-29";
47   src = fetchurl {
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=";
50   };
52   nativeBuildInputs = [
53     bison
54     cmake
55     pkg-config
56     makeWrapper
57     # required for scripts/CMakeLists.txt
58     coreutils
59     gnugrep
60     procps
61   ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ];
63   patches = [
64     ./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
65   ];
67   ## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references.
68   postPatch = ''
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 --"
76   '';
78   buildInputs =
79     [
80       boost
81       (curl.override { inherit openssl; })
82       icu
83       libedit
84       libevent
85       lz4
86       ncurses
87       openssl
88       protobuf
89       re2
90       readline
91       zlib
92       zstd
93       libfido2
94       openldap
95       perl
96       cyrus_sasl
97     ]
98     ++ lib.optionals stdenv.hostPlatform.isLinux [
99       numactl
100       libtirpc
101     ]
102     ++ lib.optionals stdenv.hostPlatform.isDarwin [
103       cctools
104       CoreServices
105       developer_cmds
106       DarwinTools
107     ];
109   outputs = [
110     "out"
111     "static"
112   ];
114   cmakeFlags = [
115     # Percona-specific flags.
116     "-DPORTABLE=1"
117     "-DWITH_LDAP=system"
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"
138   ];
140   postInstall = ''
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 : ${
146       lib.makeBinPath [
147         coreutils
148         procps
149         gnugrep
150         gnused
151         hostname
152       ]
153     }
154     wrapProgram $out/bin/mysql_config --prefix PATH : ${
155       lib.makeBinPath [
156         coreutils
157         gnused
158       ]
159     }
160     wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${
161       lib.makeBinPath [
162         coreutils
163         gnugrep
164       ]
165     }
166     wrapProgram $out/bin/ps-admin --prefix PATH : ${
167       lib.makeBinPath [
168         coreutils
169         gnugrep
170       ]
171     }
172     wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
173       lib.makeBinPath [
174         coreutils
175         gnugrep
176       ]
177     }
178   '';
180   passthru = {
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;
186   };
188   meta = with lib; {
189     homepage = "https://www.percona.com/software/mysql-database/percona-server";
190     description = ''
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.
194     '';
195     license = licenses.gpl2Only;
196     maintainers = teams.flyingcircus.members;
197     platforms = platforms.unix;
198   };