From ccd16f87d545448ad8c3b5037d191d1994226a67 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Sun, 14 Aug 2016 14:29:02 -0400 Subject: [PATCH] mariadb: re-enable jemalloc on darwin and fix impurity CMake in its usual infinite wisdom searches all over the system for java and finds the host OSX java and JNI headers. It then decides to build the connector and fails later on because we didn't actually tell Nix that we wanted java in scope. So instead, we just tell CMake that we don't want the jdbc connector. I believe it does the same with GSS, so I disable that stuff too. None of this should affect Linux, but let me know if it does somheow. --- pkgs/servers/sql/mariadb/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 76a7755f3957..97b7a90892a7 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -32,8 +32,8 @@ common = rec { # attributes common to both builds nativeBuildInputs = [ cmake pkgconfig ]; buildInputs = [ - ncurses openssl zlib pcre - ] ++ stdenv.lib.optionals stdenv.isLinux [ jemalloc libaio systemd ] + ncurses openssl zlib pcre jemalloc + ] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd ] ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ]; cmakeFlags = [ @@ -49,9 +49,18 @@ common = rec { # attributes common to both builds "-DWITH_ZLIB=system" "-DWITH_SSL=system" "-DWITH_PCRE=system" + + # On Darwin without sandbox, CMake will find the system java and attempt to build with java support, but + # then it will fail during the actual build. Let's just disable the flag explicitly until someone decides + # to pass in java explicitly. This should have no effect on Linux. + "-DCONNECT_WITH_JDBC=OFF" + + # Same as above. Somehow on Darwin CMake decides that we support GSS even though we aren't provding the + # library through Nix, and then breaks later on. This should have no effect on Linux. + "-DPLUGIN_AUTH_GSSAPI=NO" + "-DPLUGIN_AUTH_GSSAPI_CLIENT=NO" ] ++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib" - ++ optional (!stdenv.isLinux) "-DWITH_JEMALLOC=no" # bad build at least on Darwin ; preConfigure = ''