about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorTim Otten <totten@civicrm.org>2019-08-13 12:50:52 -0700
committerOrivej Desh (NixOS) <40807862+orivej-nixos@users.noreply.github.com>2019-08-13 19:50:51 +0000
commitdae42566dbee37a3b7a609fa86eca9618f4f4b67 (patch)
tree8ecf0bcde7c568e1cde1147e493c011ab51797a5 /pkgs/servers
parenta3bf0c2e4005670fd710e7eb42403e0348754e77 (diff)
downloadnixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar.gz
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar.bz2
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar.lz
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar.xz
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.tar.zst
nixlib-dae42566dbee37a3b7a609fa86eca9618f4f4b67.zip
mysql80: init at 8.0.17 (#65221)
MySQL 8.0 is a significant iteration after MySQL 5.7.  This patch adds it as
a parallel build alongside mysql57 (similar to mysql56 and mysql55 before).
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/sql/mysql/8.0.x.nix73
-rw-r--r--pkgs/servers/sql/mysql/abi-check.patch18
-rw-r--r--pkgs/servers/sql/mysql/libutils.patch5
3 files changed, 96 insertions, 0 deletions
diff --git a/pkgs/servers/sql/mysql/8.0.x.nix b/pkgs/servers/sql/mysql/8.0.x.nix
new file mode 100644
index 000000000000..8785e052224d
--- /dev/null
+++ b/pkgs/servers/sql/mysql/8.0.x.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv, fetchurl, bison, cmake, pkgconfig
+, boost, icu, libedit, libevent, lz4, ncurses, openssl, protobuf, re2, readline, zlib
+, numactl, perl, cctools, CoreServices, developer_cmds
+}:
+
+let
+self = stdenv.mkDerivation rec {
+  name = "mysql-8.0.17";
+
+  src = fetchurl {
+    url = "https://dev.mysql.com/get/Downloads/MySQL-${self.mysqlVersion}/${name}.tar.gz";
+    sha256 = "1mjrlxn8vigi69r0r674j2dibdnkaar01ji5965gsyx7k60z7qy6";
+  };
+
+  patches = [
+    ./abi-check.patch
+    ./libutils.patch
+  ];
+
+  nativeBuildInputs = [ bison cmake pkgconfig ];
+
+  buildInputs = [
+    boost icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
+  ] ++ lib.optionals stdenv.isLinux [
+    numactl
+  ] ++ lib.optionals stdenv.isDarwin [
+    cctools CoreServices developer_cmds
+  ];
+
+  outputs = [ "out" "static" ];
+
+  cmakeFlags = [
+    "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12" # For std::shared_timed_mutex.
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # To run libmysql/libmysql_api_test during build.
+    "-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
+    "-DWITH_ROUTER=OFF" # It may be packaged separately.
+    "-DWITH_SYSTEM_LIBS=ON"
+    "-DWITH_UNIT_TESTS=OFF"
+    "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
+    "-DMYSQL_DATADIR=/var/lib/mysql"
+    "-DINSTALL_INFODIR=share/mysql/docs"
+    "-DINSTALL_MANDIR=share/man"
+    "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
+    "-DINSTALL_INCLUDEDIR=include/mysql"
+    "-DINSTALL_DOCREADMEDIR=share/mysql"
+    "-DINSTALL_SUPPORTFILESDIR=share/mysql"
+    "-DINSTALL_MYSQLSHAREDIR=share/mysql"
+    "-DINSTALL_MYSQLTESTDIR="
+    "-DINSTALL_DOCDIR=share/mysql/docs"
+    "-DINSTALL_SHAREDIR=share/mysql"
+  ];
+
+  postInstall = ''
+    moveToOutput "lib/*.a" $static
+    so=${stdenv.hostPlatform.extensions.sharedLibrary}
+    ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
+  '';
+
+  passthru = {
+    client = self;
+    connector-c = self;
+    server = self;
+    mysqlVersion = "8.0";
+  };
+
+  meta = with lib; {
+    homepage = "https://www.mysql.com/";
+    description = "The world's most popular open source database";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}; in self
diff --git a/pkgs/servers/sql/mysql/abi-check.patch b/pkgs/servers/sql/mysql/abi-check.patch
new file mode 100644
index 000000000000..de45d9c3ea21
--- /dev/null
+++ b/pkgs/servers/sql/mysql/abi-check.patch
@@ -0,0 +1,18 @@
+MySQL ABI check assumes that with -nostdinc any standard #include terminates
+preprocessing, but we do not provide that:
+https://github.com/NixOS/nixpkgs/issues/44530
+
+"#error" does not terminate preprocessing, so we #include a non-existent file instead.
+
+--- a/cmake/do_abi_check.cmake
++++ b/cmake/do_abi_check.cmake
+@@ -68,1 +68,1 @@ FOREACH(file ${ABI_HEADERS})
+-      -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
++      -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include/nostdinc -I${SOURCE_DIR}/include
+@@ -74,1 +74,1 @@ FOREACH(file ${ABI_HEADERS})
+-    COMMAND sed -e "/^# /d"
++    COMMAND sed -e "/^# /d" -e "/^#include <-nostdinc>$/d"
+--- /dev/null
++++ b/include/nostdinc/stdint.h
+@@ -0,0 +1,1 @@
++#include <-nostdinc>
diff --git a/pkgs/servers/sql/mysql/libutils.patch b/pkgs/servers/sql/mysql/libutils.patch
new file mode 100644
index 000000000000..fa1a35e12f23
--- /dev/null
+++ b/pkgs/servers/sql/mysql/libutils.patch
@@ -0,0 +1,5 @@
+--- a/cmake/libutils.cmake
++++ b/cmake/libutils.cmake
+@@ -345 +345 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES)
+-      COMMAND /usr/bin/libtool -static -o $<TARGET_FILE:${TARGET}>
++      COMMAND libtool -static -o $<TARGET_FILE:${TARGET}>