mariadb: cleanup obsolete code and fix upstream cmake

This commit is contained in:
Robin Gloster 2017-12-25 14:00:03 +01:00
parent 462076c909
commit 1ca8a7aff6
2 changed files with 15 additions and 7 deletions

View file

@ -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 <mysql.h>

View file

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