git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #89266 from talyz/mysqlnd-fix-compression

php.extensions.mysqlnd: Fix compression support

commitb084cf2d3096cd600d0d4d21c733bdb78646ee9a authorKim Lindberger <kim.lindberger@gmail.com> dateWed 3 Jun 2020, 21:42 (6 years ago) parentf7036e22e0d4a8
1 file changed+20−5
pkgs/top-level/php-packages.nix+20−5
pkgs/top-level/php-packages.nix+20−5
@@ -854,6 +854,9 @@ in
854854 inherit configureFlags internalDeps buildInputs
855855 zendExtension doCheck;
856856
857+ prePatch = "pushd ../..";
858+ postPatch = "popd";
859+
857860 preConfigure = ''
858861 nullglobRestore=$(shopt -p nullglob)
859862 shopt -u nullglob # To make ?-globbing work
@@ -983,14 +986,14 @@ in
983986 # The configure script doesn't correctly add library link
984987 # flags, so we add them to the variable used by the Makefile
985988 # when linking.
986− MYSQLND_SHARED_LIBADD = "-lssl -lcrypto -lz";
989+ MYSQLND_SHARED_LIBADD = "-lssl -lcrypto";
987990 # The configure script builds a config.h which is never
988991 # included. Let's include it in the main header file
989992 # included by all .c-files.
990993 patches = [
991994 (pkgs.writeText "mysqlnd_config.patch" ''
992− --- a/mysqlnd.h
993− +++ b/mysqlnd.h
995+ --- a/ext/mysqlnd/mysqlnd.h
996+ +++ b/ext/mysqlnd/mysqlnd.h
994997 @@ -1,3 +1,6 @@
995998 +#ifdef HAVE_CONFIG_H
996999 +#include "config.h"
@@ -999,6 +1002,18 @@ in
9991002 +----------------------------------------------------------------------+
10001003 | Copyright (c) The PHP Group |
10011004 '')
1005+ (pkgs.writeText "mysqlnd_fix_compression.patch" ''
1006+ --- a/ext/mysqlnd/mysqlnd.h
1007+ +++ b/ext/mysqlnd/mysqlnd.h
1008+ @@ -48,7 +48,7 @@
1009+ #define MYSQLND_DBG_ENABLED 0
1010+ #endif
1011+
1012+ -#if defined(MYSQLND_COMPRESSION_WANTED) && defined(HAVE_ZLIB)
1013+ +#if defined(MYSQLND_COMPRESSION_WANTED)
1014+ #define MYSQLND_COMPRESSION_ENABLED 1
1015+ #endif
1016+ '')
10021017 ];
10031018 postPhpize = lib.optionalString (lib.versionOlder php.version "7.4") ''
10041019 substituteInPlace configure --replace '$OPENSSL_LIBDIR' '${openssl}/lib' \
@@ -1013,8 +1028,8 @@ in
10131028 # included after the ifdef...
10141029 patches = lib.optional (lib.versionOlder php.version "7.4") [
10151030 (pkgs.writeText "zend_file_cache_config.patch" ''
1016− --- a/zend_file_cache.c
1017− +++ b/zend_file_cache.c
1031+ --- a/ext/opcache/zend_file_cache.c
1032+ +++ b/ext/opcache/zend_file_cache.c
10181033 @@ -27,9 +27,9 @@
10191034 #include "ext/standard/md5.h"
10201035 #endif