Unverified Commit 04704adc authored by Daniel McCarney's avatar Daniel McCarney
Browse files

ldmud: patch mysql configure script detection

The upstream `configure.ac`'s `AC_LANG_PROGRAM` for mysql feature
detection seems to be incompatible with the `mariadb-connector-c`
package, resulting in support not being detected.

Digging in to the `config.log` we can see it's a type mismatch error
from the test program `.c`:

```
configure:11661: checking for mySQL
configure:11694: gcc -c -g -O2 -fwrapv -I/usr/inet6/include -I/nix/store/ya8wpj6dqz39024v6xrv504i9kyidpil-mariadb-connector-c-3.1.21-dev/include/mysql conftest.c >&5
conftest.c: In function 'foo':
conftest.c:90:12: error: returning 'MYSQL *' {aka 'struct st_mysql *'} from a function with incompatible return type 'struct MYSQL *' [-Wincompatible-pointer-types]
90 |     return &var;
|            ^~~~
```

This commit resolves the issue locally by applying a small patch.
parent 321754aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-PkrjP7tSZMaj61Hsn++7+CumhqFPLbf0+eAI6afP9HA=";
  };

  patches = [ ./libxml2-2.12.0-compat.patch ];
  patches = [ ./libxml2-2.12.0-compat.patch ./mysql-compat.patch ];

  sourceRoot = "${src.name}/src";

+13 −0
Original line number Diff line number Diff line
diff --git src/autoconf/configure.ac src/autoconf/configure.ac
index 156e97f4..6d70bf33 100644
--- src/autoconf/configure.ac
+++ src/autoconf/configure.ac
@@ -1410,7 +1410,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <mysql.h>
 #include <errmsg.h>
 
-struct MYSQL * foo(void)
+struct st_mysql * foo(void)
 {
     static MYSQL var;