From 611b957c98e52da33e86b379bc2ec883a1320294 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Fri, 20 Jan 2023 16:17:26 +0300 Subject: [PATCH] mariadb-connector-c: fix locate libdir and plugindir --- pkgs/servers/sql/mariadb/connector-c/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/sql/mariadb/connector-c/default.nix b/pkgs/servers/sql/mariadb/connector-c/default.nix index 8bcfd3619541..7a175620c7cb 100644 --- a/pkgs/servers/sql/mariadb/connector-c/default.nix +++ b/pkgs/servers/sql/mariadb/connector-c/default.nix @@ -29,8 +29,11 @@ in stdenv.mkDerivation { postPatch = '' substituteInPlace mariadb_config/mariadb_config.c.in \ - --replace '-I%s/@INSTALL_INCLUDEDIR@' "-I$dev/include" \ - --replace '-L%s/@INSTALL_LIBDIR@' "-L$out/lib/mariadb" + --replace '#define INCLUDE "-I%s/@INSTALL_INCLUDEDIR@ -I%s/@INSTALL_INCLUDEDIR@/mysql"' "#define INCLUDE \"-I$dev/include -I$dev/include/mysql\"" \ + --replace '#define LIBS "-L%s/@INSTALL_LIBDIR@/ -lmariadb"' "#define LIBS \"-L$out/lib/mariadb -lmariadb\"" \ + --replace '#define PKG_LIBDIR "%s/@INSTALL_LIBDIR@"' "#define PKG_LIBDIR \"$out/lib/mariadb\"" \ + --replace '#define PLUGIN_DIR "%s/@INSTALL_PLUGINDIR@"' "#define PLUGIN_DIR \"$out/lib/mariadb/plugin\"" \ + --replace '#define PKG_PLUGINDIR "%s/@INSTALL_PLUGINDIR@"' "#define PKG_PLUGINDIR \"$out/lib/mariadb/plugin\"" '' + lib.optionalString stdenv.hostPlatform.isStatic '' # Disables all dynamic plugins substituteInPlace cmake/plugins.cmake \