Merge pull request #51738 from Izorkin/php73

php: update php packages
This commit is contained in:
Franz Pletz 2018-12-11 19:38:42 +00:00 committed by GitHub
commit 10d9fe7d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 211 additions and 35 deletions

View file

@ -1,9 +1,9 @@
# pcre functionality is tested in nixos/tests/php-pcre.nix
{ lib, stdenv, fetchurl, flex, bison, autoconf
, mysql, libxml2, readline, zlib, curl, postgresql, gettext
, openssl, pcre, pkgconfig, sqlite, config, libjpeg, libpng, freetype
, openssl, pcre, pcre2, pkgconfig, sqlite, config, libjpeg, libpng, freetype
, libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
, uwimap, pam, gmp, apacheHttpd, libiconv, systemd, libsodium, html-tidy, libargon2
, uwimap, pam, gmp, apacheHttpd, libiconv, systemd, libsodium, html-tidy, libargon2, libzip
}:
with lib;
@ -42,7 +42,7 @@ let
, intlSupport ? config.php.intl or true
, exifSupport ? config.php.exif or true
, xslSupport ? config.php.xsl or false
, mcryptSupport ? config.php.mcrypt or true
, mcryptSupport ? (config.php.mcrypt or true) && (versionOlder version "7.2")
, bz2Support ? config.php.bz2 or false
, zipSupport ? config.php.zip or true
, ftpSupport ? config.php.ftp or true
@ -54,6 +54,11 @@ let
, sodiumSupport ? (config.php.sodium or true) && (versionAtLeast version "7.2")
, tidySupport ? (config.php.tidy or false)
, argon2Support ? (config.php.argon2 or true) && (versionAtLeast version "7.2")
, libzipSupport ? (config.php.libzip or true) && (versionAtLeast version "7.3")
, phpdbgSupport ? config.php.phpdbg or true
, cgiSupport ? config.php.cgi or true
, cliSupport ? config.php.cli or true
, pharSupport ? config.php.phar or true
}:
let
@ -68,7 +73,9 @@ let
enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig autoconf ];
buildInputs = [ flex bison pcre ]
buildInputs = [ flex bison ]
++ optional (versionOlder version "7.3") pcre
++ optional (versionAtLeast version "7.3") pcre2
++ optional withSystemd systemd
++ optionals imapSupport [ uwimap openssl pam ]
++ optionals curlSupport [ curl openssl ]
@ -96,15 +103,16 @@ let
++ optional (mssqlSupport && !stdenv.isDarwin) freetds
++ optional sodiumSupport libsodium
++ optional tidySupport html-tidy
++ optional argon2Support libargon2;
++ optional argon2Support libargon2
++ optional libzipSupport libzip;
CXXFLAGS = optional stdenv.cc.isClang "-std=c++11";
configureFlags = [
"--with-config-file-scan-dir=/etc/php.d"
"--with-pcre-regex=${pcre.dev} PCRE_LIBDIR=${pcre}"
]
++ optional (versionOlder version "7.3") "--with-pcre-regex=${pcre.dev} PCRE_LIBDIR=${pcre}"
++ optional (versionAtLeast version "7.3") "--with-pcre-regex=${pcre2.dev} PCRE_LIBDIR=${pcre2}"
++ optional stdenv.isDarwin "--with-iconv=${libiconv}"
++ optional withSystemd "--with-fpm-systemd"
++ optionals imapSupport [
@ -163,8 +171,13 @@ let
++ optional calendarSupport "--enable-calendar"
++ optional sodiumSupport "--with-sodium=${libsodium.dev}"
++ optional tidySupport "--with-tidy=${html-tidy}"
++ optional argon2Support "--with-password-argon2=${libargon2}";
++ optional argon2Support "--with-password-argon2=${libargon2}"
++ optional libzipSupport "--with-libzip=${libzip.dev}"
++ optional phpdbgSupport "--enable-phpdbg"
++ optional (!phpdbgSupport) "--disable-phpdbg"
++ optional (!cgiSupport) "--disable-cgi"
++ optional (!cliSupport) "--disable-cli"
++ optional (!pharSupport) "--disable-phar";
hardeningDisable = [ "bindnow" ];
@ -189,6 +202,7 @@ let
'';
postInstall = ''
test -d $out/etc || mkdir $out/etc
cp php.ini-production $out/etc/php.ini
'';
@ -228,18 +242,30 @@ let
in {
php71 = generic {
version = "7.1.24";
sha256 = "02qy76krbdhlbkzs9k1sa5mgmj0qnbb8gcf1j3q0cq3z7kkj9pk6";
version = "7.1.25";
sha256 = "1b5az5vhap593ggjxirs1zdlg20hcv9h94iq5kgaxky71a4dqb00";
# https://bugs.php.net/bug.php?id=76826
extraPatches = optional stdenv.isDarwin ./php71-darwin-isfinite.patch;
};
php72 = generic {
version = "7.2.12";
sha256 = "1dpnbsv4bdlc5v40ddddi971f456jp1qrn89w5di1dj70g1c895p";
version = "7.2.13";
sha256 = "0bg9nfc250p24hxn4bdjz7ngcw75h8rpf4qjxqzcs6s9fvxlcjjv";
# https://bugs.php.net/bug.php?id=71041
# https://bugs.php.net/bug.php?id=76826
extraPatches = optional stdenv.isDarwin ./php72-darwin-isfinite.patch;
extraPatches = [ ./fix-bug-71041.patch ]
++ optional stdenv.isDarwin ./php72-darwin-isfinite.patch;
};
php73 = generic {
version = "7.3.0";
sha256 = "0rvwx37dsmxivgrf4wfc1y778iln498c6a40biy9k6lnr6p7s9ks";
# https://bugs.php.net/bug.php?id=71041
# https://bugs.php.net/bug.php?id=76826
extraPatches = [ ./fix-bug-71041.patch ]
++ optional stdenv.isDarwin ./php73-darwin-isfinite.patch;
};
}

View file

@ -0,0 +1,25 @@
diff --git a/Zend/zend_signal.c b/Zend/zend_signal.c
index 24d454d..6307620 100644
--- a/Zend/zend_signal.c
+++ b/Zend/zend_signal.c
@@ -399,7 +399,7 @@ void zend_signal_init(void) /* {{{ */
/* {{{ zend_signal_startup
* alloc zend signal globals */
-void zend_signal_startup(void)
+ZEND_API void zend_signal_startup(void)
{
#ifdef ZTS
diff --git a/Zend/zend_signal.h b/Zend/zend_signal.h
index e8ee7d6..462d06f 100644
--- a/Zend/zend_signal.h
+++ b/Zend/zend_signal.h
@@ -89,7 +89,7 @@ ZEND_API void zend_signal_handler_unblock(void);
void zend_signal_activate(void);
void zend_signal_deactivate(void);
BEGIN_EXTERN_C()
-void zend_signal_startup(void);
+ZEND_API void zend_signal_startup(void);
END_EXTERN_C()
void zend_signal_init(void);

View file

@ -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 <math.h>
#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 <math.h>
#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)

View file

@ -3,6 +3,7 @@
, python
, php71
, php72
, php73
, perl526
, perl
, perldevel
@ -30,6 +31,7 @@ stdenv.mkDerivation rec {
python
php71
php72
php73
perl526
perl
perldevel
@ -49,6 +51,7 @@ stdenv.mkDerivation rec {
./configure python --module=python --config=${python}/bin/python-config --lib-path=${python}/lib
./configure php --module=php71 --config=${php71.dev}/bin/php-config --lib-path=${php71}/lib
./configure php --module=php72 --config=${php72.dev}/bin/php-config --lib-path=${php72}/lib
./configure php --module=php73 --config=${php73.dev}/bin/php-config --lib-path=${php73}/lib
./configure perl --module=perl526 --perl=${perl526}/bin/perl
./configure perl --module=perl --perl=${perl}/bin/perl
./configure perl --module=perl529 --perl=${perldevel}/bin/perl

View file

@ -7835,18 +7835,28 @@ in
php = php72;
});
php73Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php73;
});
phpPackages-unit = php72Packages-unit;
php71Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php71-unit;
});
php72Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php72Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php72-unit;
});
php73Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php73-unit;
});
inherit (callPackages ../development/interpreters/php { })
php71
php72;
php72
php73;
php-embed = php72-embed;
@ -7860,12 +7870,19 @@ in
config.php.apxs2 = false;
};
php73-embed = php73.override {
config.php.embed = true;
config.php.apxs2 = false;
};
php-unit = php72-unit;
php71-unit = php71.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};
@ -7873,6 +7890,17 @@ in
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};
php73-unit = php73.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};
@ -13551,6 +13579,7 @@ in
unit = callPackage ../servers/http/unit {
php71 = php71-unit;
php72 = php72-unit;
php73 = php73-unit;
};
nginx = nginxStable;

View file

@ -7,10 +7,12 @@ let
inherit (pkgs) stdenv autoreconfHook fetchurl;
};
isPhp73 = pkgs.lib.versionAtLeast php.version "7.3";
apcu = buildPecl {
name = "apcu-5.1.11";
sha256 = "0nz9m3fbxgyc2ij63yqmxm06a1f51g8rkxk85f85ziqdin66q2f1";
buildInputs = [ pkgs.pcre ];
name = "apcu-5.1.15";
sha256 = "0v91fxh3z3amwicqlmz7lvnh4zfl2d7kj2zc8pvlvj2lms8ql5zc";
buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
doCheck = true;
checkTarget = "test";
checkFlagsArray = ["REPORT_EXIT_STATUS=1" "NO_INTERACTION=1"];
@ -21,7 +23,7 @@ let
apcu_bc = buildPecl {
name = "apcu_bc-1.0.4";
sha256 = "1raww7alwayg9nk0akly1mdrjypxlwg8safnmaczl773cwpw5cbw";
buildInputs = [ apcu pkgs.pcre ];
buildInputs = [ apcu (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
};
ast = buildPecl {
@ -32,7 +34,7 @@ let
couchbase = buildPecl rec {
name = "couchbase-${version}";
version = "2.3.4";
version = "2.6.0";
buildInputs = [ pkgs.libcouchbase pkgs.zlib igbinary pcs ];
@ -40,7 +42,7 @@ let
owner = "couchbase";
repo = "php-couchbase";
rev = "v${version}";
sha256 = "0rdlrl7vh4kbxxj9yxp54xpnnrxydpa9fab7dy4nas474j5vb2bp";
sha256 = "0lhcvgd4a0wvxniinxajj48p5krbp44h8932021qq14rv94r4k0b";
};
configureFlags = [ "--with-couchbase" ];
@ -87,7 +89,7 @@ let
};
igbinary = buildPecl {
name = "igbinary-2.0.4";
name = "igbinary-2.0.8";
configureFlags = [ "--enable-igbinary" ];
@ -95,10 +97,10 @@ let
outputs = [ "out" "dev" ];
sha256 = "0a55l4f0bgbf3f6sh34njd14niwagg829gfkvb8n5fs69xqab67d";
sha256 = "105nyn703k9p9c7wwy6npq7xd9mczmmlhyn0gn2v2wz0f88spjxs";
};
mailparse = buildPecl {
mailparse = assert !isPhp73; buildPecl {
name = "mailparse-3.0.2";
sha256 = "0fw447ralqihsjnn0fm2hkaj8343cvb90v0d1wfclgz49256y6nq";
@ -109,10 +111,12 @@ let
sha256 = "0z2nc92xfc5axa9f2dy95rmsd2c81q8cs1pm4anh0a50x9g5ng0z";
configureFlags = [ "--with-imagick=${pkgs.imagemagick.dev}" ];
nativeBuildInputs = [ pkgs.pkgconfig ];
buildInputs = [ pkgs.pcre ];
buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
};
memcached = buildPecl rec {
memcached = if isPhp73 then memcached73 else memcached7;
memcached7 = assert !isPhp73; buildPecl rec {
name = "memcached-php7";
src = fetchgit {
@ -130,6 +134,24 @@ let
buildInputs = with pkgs; [ cyrus_sasl zlib ];
};
memcached73 = assert isPhp73; buildPecl rec {
name = "memcached-php73";
src = fetchgit {
url = "https://github.com/php-memcached-dev/php-memcached";
rev = "6d8f5d524f35e72422b9e81319b96f23af02adcc";
sha256 = "1s1d5r3n2h9zys8sqvv52fld6jy21ki7cl0gbbvd9dixqc0lf1jh";
};
configureFlags = [
"--with-zlib-dir=${pkgs.zlib.dev}"
"--with-libmemcached-dir=${pkgs.libmemcached}"
];
nativeBuildInputs = [ pkgs.pkgconfig ];
buildInputs = with pkgs; [ cyrus_sasl zlib ];
};
oci8 = buildPecl rec {
name = "oci8-2.1.8";
sha256 = "1bp6fss2f2qmd5bdk7x22j8vx5qivrdhz4x7csf29vjgj6gvchxy";
@ -143,7 +165,9 @@ let
sha256 = "0d4p1gpl8gkzdiv860qzxfz250ryf0wmjgyc8qcaaqgkdyh5jy5p";
};
xdebug = buildPecl {
xdebug = if isPhp73 then xdebug73 else xdebug7;
xdebug7 = assert !isPhp73; buildPecl {
name = "xdebug-2.6.1";
sha256 = "0xxxy6n4lv7ghi9liqx133yskg07lw316vhcds43n1sjq3b93rns";
@ -152,10 +176,19 @@ let
checkTarget = "test";
};
yaml = buildPecl {
name = "yaml-2.0.2";
xdebug73 = assert isPhp73; buildPecl {
name = "xdebug-2.7.0beta1";
sha256 = "0f80zy79kyy4hn6iigpgfkwppwldjfj5g7s4gddklv3vskdb1by3";
sha256 = "1ghh14z55l4jklinkgjkfhkw53lp2r7lgmyh7q8kdnf7jnpwx84h";
doCheck = true;
checkTarget = "test";
};
yaml = buildPecl {
name = "yaml-2.0.4";
sha256 = "1036zhc5yskdfymyk8jhwc34kvkvsn5kaf50336153v4dqwb11lp";
configureFlags = [
"--with-yaml=${pkgs.libyaml}"
@ -164,7 +197,7 @@ let
nativeBuildInputs = [ pkgs.pkgconfig ];
};
zmq = buildPecl {
zmq = assert !isPhp73; buildPecl {
name = "zmq-1.1.3";
sha256 = "1kj487vllqj9720vlhfsmv32hs2dy2agp6176mav6ldx31c3g4n4";
@ -197,11 +230,11 @@ let
configureFlags = [ "--with-v8=${pkgs.v8_6_x}" ];
};
v8js = buildPecl rec {
version = "1.4.1";
v8js = assert !isPhp73; buildPecl rec {
version = "2.1.0";
name = "v8js-${version}";
sha256 = "0k5dc395gzva4l6n9mzvkhkjq914460cwk1grfandcqy73j6m89q";
sha256 = "0g63dyhhicngbgqg34wl91nm3556vzdgkq19gy52gvmqj47rj6rg";
buildInputs = [ pkgs.v8_6_x ];
configureFlags = [ "--with-v8js=${pkgs.v8_6_x}" ];