summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-12-25 14:00:03 +0100
committerRobin Gloster <mail@glob.in>2017-12-29 02:18:35 +0100
commit1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d (patch)
tree60b905de9b9398c2c95fa8127646e9307a7cb74c
parent462076c909f10efd460595f2090a7cf76d595b74 (diff)
downloadnixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar.gz
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar.bz2
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar.lz
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar.xz
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.tar.zst
nixpkgs-1ca8a7aff6b62181a9592fcd6cb6f008041c5f1d.zip
mariadb: cleanup obsolete code and fix upstream cmake
-rw-r--r--pkgs/servers/sql/mariadb/cmake-includedir.patch11
-rw-r--r--pkgs/servers/sql/mariadb/default.nix11
2 files changed, 15 insertions, 7 deletions
diff --git a/pkgs/servers/sql/mariadb/cmake-includedir.patch b/pkgs/servers/sql/mariadb/cmake-includedir.patch
new file mode 100644
index 00000000000..0c4fe7d321e
--- /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 <mysql.h>
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index c5e8e0a198a..b538fa7515a 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";