From 6ce89e174fc16fcc304f4cdf05241a194c70bf97 Mon Sep 17 00:00:00 2001 From: Phil Wetzel Date: Thu, 12 May 2016 18:22:53 -0400 Subject: [PATCH] mariadb: wrap mysqld with --basedir --- pkgs/servers/sql/mariadb/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index c8f25b6f09db..902be5322228 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -2,6 +2,7 @@ , openssl, pcre, boost, judy, bison, libxml2 , libaio, libevent, groff, jemalloc, cracklib, systemd, numactl, perl , fixDarwinDylibNames, cctools, CoreServices +, makeWrapper }: with stdenv.lib; @@ -19,6 +20,7 @@ stdenv.mkDerivation rec { # temporary due to https://mariadb.atlassian.net/browse/MDEV-9000 (if stdenv.is64bit then snappy else null) pcre libxml2 boost judy bison libevent cracklib + makeWrapper ] ++ stdenv.lib.optionals stdenv.isLinux [ jemalloc libaio systemd ] ++ stdenv.lib.optionals (stdenv.isLinux && !stdenv.isArm) [ numactl ] ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ]; @@ -92,6 +94,10 @@ stdenv.mkDerivation rec { substituteInPlace $out/bin/mysql_install_db \ --replace basedir=\"\" basedir=\"$out\" + # Wrap mysqld with --basedir, but as last flag + wrapProgram $out/bin/mysqld + sed -i "s,\(^exec.*$\),\1 --basedir=$out,g" $out/bin/mysqld + # Remove superfluous files rm -r $out/mysql-test $out/sql-bench $out/data # Don't need testing data rm $out/share/man/man1/mysql-test-run.pl.1