Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / php.scm
index 90e6ab1..ca7f0ee 100644 (file)
@@ -2,6 +2,8 @@
 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +30,7 @@
   #:use-module (gnu packages curl)
   #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages dbm)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
@@ -40,6 +43,7 @@
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module ((guix licenses) #:prefix license:))
 
-(define gd-for-php
-  (package
-    (inherit gd)
-    (source (origin
-             (inherit (package-source gd))
-             (patches (search-patches "gd-fix-tests-on-i686.patch"
-                                      "gd-freetype-test-failure.patch"
-                                      "gd-CVE-2018-5711.patch"))))))
-
 (define-public php
   (package
     (name "php")
-    (version "7.2.4")
+    (version "7.3.8")
     (home-page "https://secure.php.net/")
     (source (origin
               (method url-fetch)
               (uri (string-append home-page "distributions/"
-                                  name "-" version ".tar.xz"))
+                                  "php-" version ".tar.xz"))
               (sha256
                (base32
-                "123s0lbyz4fxr3kk91r4v658mk899dym36lggxnx9pwd2jyv25kr"))
+                "19fm990yl97fq538lkp0m1imbp30qrx7785x211w1n15wqm6n17n"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "ext"
                             ;;"mbstring/libmbfl"
                             ;;"date/lib"
                             ;;"bcmath/libbcmath"
-                            ;;"fileinfo/libmagic" ; This is a patched version of libmagic.
+                            ;;"fileinfo/libmagic" ; a patched version of libmagic
                             '("gd/libgd"
                               "mbstring/oniguruma"
-                              "pcre/pcrelib"
+                              "pcre/pcre2lib"
                               "sqlite3/libsqlite"
                               "xmlrpc/libxmlrpc"
                               "zip/lib"))
                   #t))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags
+     `(#:configure-flags
        (let-syntax ((with (syntax-rules ()
                             ((_ option input)
                              (string-append option "="
                "--with-mysqli"          ; Required for, e.g. wordpress
                "--with-pdo-mysql"
                "--with-zlib"
+               "--enable-bcmath"        ; Required for, e.g. Zabbix frontend
                "--enable-calendar"
                "--enable-dba=shared"
                "--enable-exif"
              (substitute* "ext/standard/tests/streams/bug60602.phpt"
                (("'ls'") (string-append "'" (which "ls") "'")))
 
+             ,@(if (string-prefix? "arm" (or (%current-system)
+                                             (%current-target-system)))
+                   ;; Drop tests known to fail on armhf.
+                   '((for-each delete-file
+                              (list
+                                "ext/calendar/tests/unixtojd_error1.phpt"
+                                ;; arm can be a lot slower, so a time-related test fails
+                                "ext/fileinfo/tests/cve-2014-3538-nojit.phpt"
+                                "ext/pcre/tests/bug76514.phpt"
+                                "ext/pcre/tests/preg_match_error3.phpt"
+                                "ext/standard/tests/general_functions/var_export-locale.phpt"
+                                "ext/standard/tests/general_functions/var_export_basic1.phpt")))
+                   '())
+
              ;; Drop tests that are known to fail.
              (for-each delete-file
                        '("ext/posix/tests/posix_getgrgid.phpt"    ; Requires /etc/group.
                          ;; This bug should have been fixed in gd 2.2.2.
                          ;; Is it a regression?
                          "ext/gd/tests/bug65148.phpt"
+                         ;; These tests should not be run (disabled because
+                         ;; GD_BUNDLED = 0)
+                         "ext/gd/tests/bug77198_auto.phpt"
+                         "ext/gd/tests/bug77198_threshold.phpt"
+                         "ext/gd/tests/bug77200.phpt"
+                         "ext/gd/tests/bug77269.phpt"
                          ;; TODO: Enable these when libgd is built with xpm support.
                          "ext/gd/tests/xpm2gd.phpt"
                          "ext/gd/tests/xpm2jpg.phpt"
                          "ext/gd/tests/xpm2png.phpt"
+                         ;; Whitespace difference, probably caused by a very
+                         ;; long store path
+                         "ext/gd/tests/bug77479.phpt"
+                         ;; Slightly different result (NULL instead of false),
+                         ;; but the bug report suggests the issue was in
+                         ;; the bundled gd, not upstream.
+                         "ext/gd/tests/bug77272.phpt"
+                         ;; Expected invalid XBM but got EOF before image was
+                         ;; complete.  It's a warning in both cases and test
+                         ;; result is the same.
+                         "ext/gd/tests/bug77973.phpt"
 
                          ;; XXX: These iconv tests have the expected outcome,
                          ;; but with different error messages.
                          ;; Expects "illegal character", instead gets "unknown error (84)".
                          "ext/iconv/tests/bug52211.phpt"
+                         "ext/iconv/tests/bug60494.phpt"
                          ;; Expects "wrong charset", gets unknown error (22).
                          "ext/iconv/tests/iconv_mime_decode_variation3.phpt"
                          "ext/iconv/tests/iconv_strlen_error2.phpt"
                          ;; iconv breaks the loop after the first error with Termsig=11.
                          "ext/iconv/tests/iconv_strpos_variation4.phpt"
                          "ext/iconv/tests/iconv_strrpos_variation3.phpt"
+                         ;; Expects "invalid multibyte sequence" but got
+                         ;; "unknown error".
+                         "ext/iconv/tests/bug76249.phpt"
 
                          ;; XXX: These test failures appear legitimate, needs investigation.
                          ;; open_basedir() restriction failure.
                          "ext/curl/tests/bug61948.phpt"
+                         ;; Fails on recent curl https://bugs.php.net/patch-display.php?bug_id=77493
+                         "ext/curl/tests/curl_basic_009.phpt"
                          ;; Expects a false boolean, gets empty array from glob().
                          "ext/standard/tests/file/bug41655_1.phpt"
                          "ext/standard/tests/file/glob_variation5.phpt"
                          "ext/mbstring/tests/mb_ereg_variation3.phpt"
                          "ext/mbstring/tests/mb_ereg_replace_variation1.phpt"
                          "ext/mbstring/tests/bug72994.phpt"
-                         "ext/ldap/tests/ldap_set_option_error.phpt"))
+                         "ext/mbstring/tests/bug77367.phpt"
+                         "ext/mbstring/tests/bug77370.phpt"
+                         "ext/mbstring/tests/bug77371.phpt"
+                         "ext/mbstring/tests/bug77381.phpt"
+                         "ext/mbstring/tests/mbregex_stack_limit.phpt"
+                         "ext/mbstring/tests/mbregex_stack_limit2.phpt"
+                         "ext/ldap/tests/ldap_set_option_error.phpt"
+
+                         ;; Sometimes cannot start the LDAP server.
+                         "ext/ldap/tests/bug76248.phpt"
+
+                         ;; Bug #76909 preg_match difference between 7.3 and < 7.3
+                         "ext/pcre/tests/bug76909.phpt"))
 
              ;; Skip tests requiring network access.
              (setenv "SKIP_ONLINE_TESTS" "1")
        ("curl" ,curl)
        ("cyrus-sasl" ,cyrus-sasl)
        ("freetype" ,freetype)
-       ("gd" ,gd-for-php)
+       ("gd" ,gd)
        ("gdbm" ,gdbm)
        ("glibc" ,glibc)
        ("gmp" ,gmp)
        ("oniguruma" ,oniguruma)
        ("openldap" ,openldap)
        ("openssl" ,openssl)
-       ("pcre" ,pcre)
+       ("pcre" ,pcre2)
        ("postgresql" ,postgresql)
        ("readline" ,readline)
        ("sqlite" ,sqlite)
      `(("pkg-config" ,pkg-config)
        ("bison" ,bison)
        ("intltool" ,intltool)
-       ("procps" ,procps)))         ; For tests.
+       ("procps" ,procps)))             ; for tests
     (synopsis "PHP programming language")
     (description
       "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
@@ -347,3 +393,6 @@ systems, web content management systems and web frameworks." )
               license:lgpl2.1+                              ; ext/bcmath/libbcmath
               license:bsd-2                                 ; ext/fileinfo/libmagic
               license:expat))))                             ; ext/date/lib
+
+(define-public php-with-bcmath
+  (deprecated-package "php-with-bcmath" php))