3
0
Fork 0
forked from mirrors/nixpkgs

mariadb-connector-c: fix static build (#147166)

This commit is contained in:
SCOTT-HAMILTON 2021-11-25 22:03:55 +01:00 committed by GitHub
parent 07e3b29217
commit b47648f6c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,13 @@ stdenv.mkDerivation {
substituteInPlace mariadb_config/mariadb_config.c.in \
--replace '-I%s/@INSTALL_INCLUDEDIR@' "-I$dev/include" \
--replace '-L%s/@INSTALL_LIBDIR@' "-L$out/lib/mariadb"
'' + lib.optionalString stdenv.hostPlatform.isStatic ''
# Disables all dynamic plugins
substituteInPlace cmake/plugins.cmake \
--replace 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "DYNAMIC")' 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "INVALID")'
# Force building static libraries
substituteInPlace libmariadb/CMakeLists.txt \
--replace 'libmariadb SHARED' 'libmariadb STATIC'
'';
# The cmake setup-hook uses $out/lib by default, this is not the case here.