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.
This commit is contained in:
Kasper Gałkowski 2021-07-06 00:33:56 +02:00
parent 976791a768
commit cd7ca4552a

View file

@ -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