From 70db1185b72a9da50d5e7b373f0bc44e29e9b7cc Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Sun, 9 Jun 2019 23:13:46 +0900 Subject: [PATCH] mysql55: fix build under clang 6 (and newer) --- pkgs/servers/sql/mysql/5.5.x.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/sql/mysql/5.5.x.nix b/pkgs/servers/sql/mysql/5.5.x.nix index d5fbe0bf2494..e089640a5b6f 100644 --- a/pkgs/servers/sql/mysql/5.5.x.nix +++ b/pkgs/servers/sql/mysql/5.5.x.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchurl, cmake, bison, ncurses, openssl, readline, zlib, perl -, cctools, CoreServices }: +{ stdenv, fetchpatch, fetchurl, cmake, bison, ncurses, openssl +, readline, zlib, perl, cctools, CoreServices }: # Note: zlib is not required; MySQL can use an internal zlib. @@ -13,10 +13,17 @@ self = stdenv.mkDerivation rec { sha256 = "1mwrzwk9ap09s430fpdkyhvx5j2syd3xj2hyfzvanjphq4xqbrxi"; }; - patches = if stdenv.isCygwin then [ - ./5.5.17-cygwin.patch - ./5.5.17-export-symbols.patch - ] else null; + patches = + # Minor type error that is a build failure as of clang 6. + stdenv.lib.optional stdenv.cc.isClang (fetchpatch { + url = "https://svn.freebsd.org/ports/head/databases/mysql55-server/files/patch-sql_sql_partition.cc?rev=469888"; + extraPrefix = ""; + sha256 = "09sya27z3ir3xy5mrv3x68hm274594y381n0i6r5s627x71jyszf"; + }) ++ + stdenv.lib.optionals stdenv.isCygwin [ + ./5.5.17-cygwin.patch + ./5.5.17-export-symbols.patch + ]; preConfigure = stdenv.lib.optional stdenv.isDarwin '' ln -s /bin/ps $TMPDIR/ps @@ -51,7 +58,10 @@ self = stdenv.mkDerivation rec { "-DINSTALL_SQLBENCHDIR=" ]; - NIX_CFLAGS_COMPILE = [ "-fpermissive" ]; # since gcc-7 + NIX_CFLAGS_COMPILE = + stdenv.lib.optionals stdenv.cc.isGNU [ "-fpermissive" ] # since gcc-7 + ++ stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-c++11-narrowing" ]; # since clang 6 + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; prePatch = '' @@ -78,6 +88,6 @@ self = stdenv.mkDerivation rec { artistic1 bsd0 bsd2 bsd3 bsdOriginal gpl2 lgpl2 lgpl21 mit publicDomain licenses.zlib ]; - broken = stdenv.isAarch64 && stdenv.isDarwin; + broken = stdenv.isAarch64; }; }; in self