3
0
Fork 0
forked from mirrors/nixpkgs

php.extensions.mysqlnd: Fix compression support

HAVE_ZLIB has to be defined in mysqlnd.h for compression support to be
turned on, but the configure script doesn't actually define it even
when zlib is available.
This commit is contained in:
talyz 2020-05-31 19:25:07 +02:00
parent 5db5b25c63
commit 2e0d4a8b39
No known key found for this signature in database
GPG key ID: 2DED2151F4671A2B

View file

@ -986,7 +986,7 @@ in
# The configure script doesn't correctly add library link
# flags, so we add them to the variable used by the Makefile
# when linking.
MYSQLND_SHARED_LIBADD = "-lssl -lcrypto -lz";
MYSQLND_SHARED_LIBADD = "-lssl -lcrypto";
# The configure script builds a config.h which is never
# included. Let's include it in the main header file
# included by all .c-files.
@ -1002,6 +1002,18 @@ in
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
'')
(pkgs.writeText "mysqlnd_fix_compression.patch" ''
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -48,7 +48,7 @@
#define MYSQLND_DBG_ENABLED 0
#endif
-#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
+#if defined(MYSQLND_COMPRESSION_WANTED)
#define MYSQLND_COMPRESSION_ENABLED 1
#endif
'')
];
postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
substituteInPlace configure --replace '$OPENSSL_LIBDIR' '${openssl}/lib' \