From 97de142e595104090b2b432b0348aed1100513c5 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Wed, 22 Jul 2020 14:20:57 +0000 Subject: [PATCH] Unbreak the build against MariaDB and MySQL 8.0 (the latter replaced my_bool with C99 bool, while earlier versions used typedef to char). PR: 243035 --- mail/dspam/Makefile | 2 ++ mail/dspam/files/patch-src_mysql__drv.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 mail/dspam/files/patch-src_mysql__drv.c diff --git a/mail/dspam/Makefile b/mail/dspam/Makefile index b844013af447..5922d6e56ce6 100644 --- a/mail/dspam/Makefile +++ b/mail/dspam/Makefile @@ -470,6 +470,8 @@ post-patch: @${REINPLACE_CMD} -e "s^%%PERL%%^${PERL}^" \ ${WRKSRC}/src/tools/dspam_train.in \ ${WRKSRC}/src/tools/dspam_notify.in + @${TEST} ${MYSQL_FLAVOUR} == mariadb && ${REINPLACE_CMD} -e \ + 's,&& defined(CR_ERROR_FIRST),,' ${WRKSRC}/configure || : pre-configure: .if ${PORT_OPTIONS:MVIRT_USERS} && !( ${PORT_OPTIONS:MMYSQL} || \ diff --git a/mail/dspam/files/patch-src_mysql__drv.c b/mail/dspam/files/patch-src_mysql__drv.c new file mode 100644 index 000000000000..a111ff821f55 --- /dev/null +++ b/mail/dspam/files/patch-src_mysql__drv.c @@ -0,0 +1,14 @@ +--- src/mysql_drv.c.orig 2012-04-11 18:48:33 UTC ++++ src/mysql_drv.c +@@ -3461,7 +3461,11 @@ MYSQL *_mysql_drv_connect (DSPAM_CTX *CTX, const char + snprintf(attrib, sizeof(attrib), "%sReconnect", prefix); + if (_ds_match_attribute(CTX->config->attributes, attrib, "true")) + { ++# if MYSQL_VERSION_ID < 80000 || defined(MARIADB_VERSION_ID) + my_bool reconnect = 1; ++# else ++ bool reconnect = 1; ++# endif + mysql_options(dbh, MYSQL_OPT_RECONNECT, &reconnect); + } + #endif