From 80f4d5d56a73265ce9e57c05e8f79dad18ee8b92 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Mon, 10 Dec 2018 12:34:35 +0300 Subject: [PATCH] php: fix build php 7.3 in Darwin --- pkgs/development/interpreters/php/default.nix | 4 +- .../php/php73-darwin-isfinite.patch | 60 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/php/php73-darwin-isfinite.patch diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 0fbd6d72611..ae4e9b9635d 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -264,6 +264,8 @@ in { sha256 = "0rvwx37dsmxivgrf4wfc1y778iln498c6a40biy9k6lnr6p7s9ks"; # https://bugs.php.net/bug.php?id=71041 - extraPatches = [ ./fix-bug-71041.patch ]; + # https://bugs.php.net/bug.php?id=76826 + extraPatches = [ ./fix-bug-71041.patch ] + ++ optional stdenv.isDarwin ./php73-darwin-isfinite.patch; }; } diff --git a/pkgs/development/interpreters/php/php73-darwin-isfinite.patch b/pkgs/development/interpreters/php/php73-darwin-isfinite.patch new file mode 100644 index 00000000000..7f784e0f5a9 --- /dev/null +++ b/pkgs/development/interpreters/php/php73-darwin-isfinite.patch @@ -0,0 +1,60 @@ +diff -ru a/configure.ac b/configure.ac +--- a/configure.ac 2018-12-04 19:12:20.000000000 +0300 ++++ b/configure.ac 2018-12-10 12:30:37.798917520 +0300 +@@ -68,7 +68,7 @@ + #include + + #ifndef zend_isnan +-#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISNAN && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_isnan(a) isnan(a) + #elif defined(HAVE_FPCLASS) + #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) +@@ -77,7 +77,7 @@ + #endif + #endif + +-#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISINF && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_isinf(a) isinf(a) + #elif defined(INFINITY) + /* Might not work, but is required by ISO C99 */ +@@ -88,7 +88,7 @@ + #define zend_isinf(a) 0 + #endif + +-#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISFINITE && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_finite(a) isfinite(a) + #elif defined(HAVE_FINITE) + #define zend_finite(a) finite(a) +diff -ru a/Zend/configure.ac b/Zend/configure.ac +--- a/Zend/configure.ac 2018-12-04 19:12:30.000000000 +0300 ++++ b/Zend/configure.ac 2018-12-10 12:28:50.350929699 +0300 +@@ -59,7 +59,7 @@ + #include + + #ifndef zend_isnan +-#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISNAN && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_isnan(a) isnan(a) + #elif defined(HAVE_FPCLASS) + #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) +@@ -68,7 +68,7 @@ + #endif + #endif + +-#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISINF && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_isinf(a) isinf(a) + #elif defined(INFINITY) + /* Might not work, but is required by ISO C99 */ +@@ -79,7 +79,7 @@ + #define zend_isinf(a) 0 + #endif + +-#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L) ++#if HAVE_DECL_ISFINITE && (defined(__APPLE__) || defined(__APPLE_CC__) || !defined(__cplusplus) || __cplusplus < 201103L) + #define zend_finite(a) isfinite(a) + #elif defined(HAVE_FINITE) + #define zend_finite(a) finite(a)