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.

Changed files
+12 -3
pkgs
servers
sql
mariadb
+12 -3
pkgs/servers/sql/mariadb/default.nix
···
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [
-
ncurses openssl zlib pcre
-
] ++ stdenv.lib.optionals stdenv.isLinux [ jemalloc libaio systemd ]
++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
cmakeFlags = [
···
"-DWITH_ZLIB=system"
"-DWITH_SSL=system"
"-DWITH_PCRE=system"
]
++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib"
-
++ optional (!stdenv.isLinux) "-DWITH_JEMALLOC=no" # bad build at least on Darwin
;
preConfigure = ''
···
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [
+
ncurses openssl zlib pcre jemalloc
+
] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd ]
++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
cmakeFlags = [
···
"-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"
;
preConfigure = ''