From cd7ca4552ac6f98abf1f3662560149154d9a8b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Ga=C5=82kowski?= Date: Tue, 6 Jul 2021 00:33:56 +0200 Subject: [PATCH] mariadb: replace galera_new_cluster in postPatch instead of postInstall This prevents build errors when building mariadb with systemd removed from buildInputs, in which case the galera_new_cluster file isn't copied to $out/bin. Also fixes a small bug where the URL in the script became invalid after replacing - now it correctly points to an article on the MariaDB website. --- pkgs/servers/sql/mariadb/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 64f603a4f071..b7205f93026d 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -161,6 +161,11 @@ server = stdenv.mkDerivation (common // { patches = common.patches; + postPatch = '' + substituteInPlace scripts/galera_new_cluster.sh \ + --replace ":-mariadb" ":-mysql" + ''; + cmakeFlags = common.cmakeFlags ++ [ "-DMYSQL_DATADIR=/var/lib/mysql" "-DENABLED_LOCAL_INFILE=OFF" @@ -202,7 +207,6 @@ server = stdenv.mkDerivation (common // { mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security rm -r "$out"/OFF - sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster ''; # perlPackages.DBDmysql is broken on darwin