Merge pull request #253532 from reckenrode/mariadb-odbc-connector-fix

mariadb-connector-odbc: fix build with clang 16 on Darwin
This commit is contained in:
toonn 2023-10-05 17:32:16 +02:00 committed by GitHub
commit dee8f46494
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -55,8 +55,14 @@
fetchSubmodules = true;
};
patches = [
# Fix `call to undeclared function 'sleep'` with clang 16
./mariadb-connector-odbc-unistd.patch
];
nativeBuildInputs = [ cmake ];
buildInputs = [ unixODBC openssl libiconv ];
buildInputs = [ unixODBC openssl libiconv zlib ]
++ lib.optionals stdenv.isDarwin [ libkrb5 ];
preConfigure = ''
# we don't want to build a .pkg
@ -66,6 +72,7 @@
'';
cmakeFlags = [
"-DWITH_EXTERNAL_ZLIB=ON"
"-DODBC_LIB_DIR=${lib.getLib unixODBC}/lib"
"-DODBC_INCLUDE_DIR=${lib.getDev unixODBC}/include"
"-DWITH_OPENSSL=ON"

View file

@ -0,0 +1,12 @@
diff -ur a/test/use_result.c b/test/use_result.c
--- a/test/use_result.c 1969-12-31 19:00:01.000000000 -0500
+++ b/test/use_result.c 2023-09-05 00:08:12.979889343 -0400
@@ -23,6 +23,8 @@
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <unistd.h>
+
#include "tap.h"
SQLINTEGER my_max_rows= 100;