diff --git a/pkgs/servers/sql/mariadb/cmake-includedir.patch b/pkgs/servers/sql/mariadb/cmake-includedir.patch new file mode 100644 index 000000000000..0c4fe7d321e2 --- /dev/null +++ b/pkgs/servers/sql/mariadb/cmake-includedir.patch @@ -0,0 +1,11 @@ +--- a/include/CMakeLists.txt 2017-12-25 05:59:07.204144374 +0100 ++++ b/include/CMakeLists.txt 2017-12-25 05:59:26.339552817 +0100 +@@ -94,7 +94,7 @@ + ENDIF() + + MACRO(INSTALL_COMPAT_HEADER file footer) +- INSTALL(CODE "FILE(WRITE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDEDIR}/${file} ++ INSTALL(CODE "FILE(WRITE ${INSTALL_INCLUDEDIR}/${file} + \"/* Do not edit this file directly, it was auto-generated by cmake */ + + #warning This file should not be included by clients, include only diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index c5e8e0a198a0..b538fa7515a2 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -31,11 +31,11 @@ common = rec { # attributes common to both builds ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ]; prePatch = '' - substituteInPlace cmake/libutils.cmake \ - --replace /usr/bin/libtool libtool sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt ''; + patches = [ ./cmake-includedir.patch ]; + cmakeFlags = [ "-DBUILD_CONFIG=mysql_release" "-DMANUFACTURER=NixOS.org" @@ -48,7 +48,7 @@ common = rec { # attributes common to both builds "-DWITH_ZLIB=system" "-DWITH_SSL=system" - "-DWITH_PCRE=bundled" + "-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 @@ -105,10 +105,8 @@ client = stdenv.mkDerivation (common // { # prevent cycle; it needs to reference $dev postInstall = common.postInstall + '' + moveToOutput bin/mysql_config "$dev" moveToOutput bin/mariadb_config "$dev" - mv $bin/bin/mysql_config $dev/bin - mv $out/nix/store/*/include/mysql/*.h $dev/include/mysql - rm -r $out/nix ''; enableParallelBuilding = true; # the client should be OK @@ -156,7 +154,6 @@ everything = stdenv.mkDerivation (common // { postInstall = common.postInstall + '' rm -r "$out"/{mysql-test,sql-bench,data} # Don't need testing data rm "$out"/share/man/man1/mysql-test-run.pl.1 - rm "$out"/bin/rcmysql ''; CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";