| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | (define-module (gnu packages php)
|
| 24 | #:use-module (gnu packages)
|
| 25 | #:use-module (gnu packages algebra)
|
| 26 | #:use-module (gnu packages aspell)
|
| 27 | #:use-module (gnu packages base)
|
| 28 | #:use-module (gnu packages bison)
|
| 29 | #:use-module (gnu packages compression)
|
| 30 | #:use-module (gnu packages curl)
|
| 31 | #:use-module (gnu packages cyrus-sasl)
|
| 32 | #:use-module (gnu packages databases)
|
| 33 | #:use-module (gnu packages dbm)
|
| 34 | #:use-module (gnu packages fontutils)
|
| 35 | #:use-module (gnu packages gd)
|
| 36 | #:use-module (gnu packages gettext)
|
| 37 | #:use-module (gnu packages glib)
|
| 38 | #:use-module (gnu packages gnupg)
|
| 39 | #:use-module (gnu packages icu4c)
|
| 40 | #:use-module (gnu packages image)
|
| 41 | #:use-module (gnu packages linux)
|
| 42 | #:use-module (gnu packages multiprecision)
|
| 43 | #:use-module (gnu packages openldap)
|
| 44 | #:use-module (gnu packages pcre)
|
| 45 | #:use-module (gnu packages pkg-config)
|
| 46 | #:use-module (gnu packages readline)
|
| 47 | #:use-module (gnu packages sqlite)
|
| 48 | #:use-module (gnu packages textutils)
|
| 49 | #:use-module (gnu packages tls)
|
| 50 | #:use-module (gnu packages web)
|
| 51 | #:use-module (gnu packages xml)
|
| 52 | #:use-module (gnu packages xorg)
|
| 53 | #:use-module (guix packages)
|
| 54 | #:use-module (guix download)
|
| 55 | #:use-module (guix build-system gnu)
|
| 56 | #:use-module (guix utils)
|
| 57 | #:use-module ((guix licenses) #:prefix license:))
|
| 58 |
|
| 59 | (define-public php
|
| 60 | (package
|
| 61 | (name "php")
|
| 62 | (version "7.4.4")
|
| 63 | (home-page "https://secure.php.net/")
|
| 64 | (source (origin
|
| 65 | (method url-fetch)
|
| 66 | (uri (string-append home-page "distributions/"
|
| 67 | "php-" version ".tar.xz"))
|
| 68 | (sha256
|
| 69 | (base32
|
| 70 | "0k57zj1z8kf8403rd72wymj08bswpa5ikcpzviw9mpykzp7c8wqq"))
|
| 71 | (modules '((guix build utils)))
|
| 72 | (snippet
|
| 73 | '(with-directory-excursion "ext"
|
| 74 | (for-each delete-file-recursively
|
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | '("gd/libgd"
|
| 82 | "pcre/pcre2lib"
|
| 83 | "xmlrpc/libxmlrpc"))
|
| 84 | #t))))
|
| 85 | (build-system gnu-build-system)
|
| 86 | (arguments
|
| 87 | `(#:configure-flags
|
| 88 | (let-syntax ((with (syntax-rules ()
|
| 89 | ((_ option input)
|
| 90 | (string-append option "="
|
| 91 | (assoc-ref %build-inputs input))))))
|
| 92 | (list (with "--with-bz2" "bzip2")
|
| 93 | (with "--with-curl" "curl")
|
| 94 | (with "--with-gdbm" "gdbm")
|
| 95 | (with "--with-gettext" "glibc") |
| 96 | (with "--with-gmp" "gmp")
|
| 97 | (with "--with-ldap" "openldap")
|
| 98 | (with "--with-ldap-sasl" "cyrus-sasl")
|
| 99 | (with "--with-pdo-pgsql" "postgresql")
|
| 100 | (with "--with-pdo-sqlite" "sqlite")
|
| 101 | (with "--with-pgsql" "postgresql")
|
| 102 | |
| 103 | |
| 104 | (with "--with-pspell" "aspell")
|
| 105 | (with "--with-readline" "readline")
|
| 106 | (with "--with-sqlite3" "sqlite")
|
| 107 | (with "--with-tidy" "tidy")
|
| 108 | (with "--with-xsl" "libxslt")
|
| 109 | (with "--with-zlib-dir" "zlib")
|
| 110 | |
| 111 | |
| 112 | |
| 113 | "--with-external-pcre"
|
| 114 | "--with-external-gd"
|
| 115 | "--with-iconv"
|
| 116 | "--with-openssl"
|
| 117 | "--with-mysqli" |
| 118 | "--with-pdo-mysql"
|
| 119 | "--with-zip"
|
| 120 | "--with-zlib"
|
| 121 | "--enable-bcmath" |
| 122 | "--enable-calendar"
|
| 123 | "--enable-dba=shared"
|
| 124 | "--enable-exif"
|
| 125 | "--enable-flatfile"
|
| 126 | "--enable-fpm"
|
| 127 | "--enable-ftp"
|
| 128 | "--enable-gd"
|
| 129 | "--enable-inifile"
|
| 130 | "--enable-intl"
|
| 131 | "--enable-mbstring"
|
| 132 | "--enable-pcntl"
|
| 133 | "--enable-sockets"))
|
| 134 | #:phases
|
| 135 | (modify-phases %standard-phases
|
| 136 | (add-after 'unpack 'do-not-record-build-flags
|
| 137 | (lambda _
|
| 138 | |
| 139 | |
| 140 | (substitute* "scripts/php-config.in"
|
| 141 | (("@CONFIGURE_OPTIONS@") "")
|
| 142 | (("@PHP_LDFLAGS@") ""))
|
| 143 | |
| 144 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 145 | (substitute* "main/build-defs.h.in"
|
| 146 | (("@CONFIGURE_COMMAND@") "(omitted)")))
|
| 147 | #t))
|
| 148 | (add-before 'build 'patch-/bin/sh
|
| 149 | (lambda _
|
| 150 | (substitute* '("run-tests.php" "ext/standard/proc_open.c")
|
| 151 | (("/bin/sh") (which "sh")))
|
| 152 | #t))
|
| 153 | (add-before 'check 'prepare-tests
|
| 154 | (lambda _
|
| 155 | |
| 156 | |
| 157 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 158 | (substitute* '("ext/mbstring/tests/mb_send_mail02.phpt"
|
| 159 | "ext/mbstring/tests/mb_send_mail04.phpt"
|
| 160 | "ext/mbstring/tests/mb_send_mail05.phpt"
|
| 161 | "ext/mbstring/tests/mb_send_mail06.phpt")
|
| 162 | (("/bin/cat") (which "cat"))))
|
| 163 | (substitute* '("ext/mbstring/tests/mb_send_mail01.phpt"
|
| 164 | "ext/mbstring/tests/mb_send_mail03.phpt"
|
| 165 | "ext/mbstring/tests/bug52681.phpt"
|
| 166 | "ext/standard/tests/general_functions/bug34794.phpt"
|
| 167 | "ext/standard/tests/general_functions/bug44667.phpt"
|
| 168 | "ext/standard/tests/general_functions/proc_open.phpt")
|
| 169 | (("/bin/cat") (which "cat")))
|
| 170 |
|
| 171 | |
| 172 | (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
|
| 173 |
|
| 174 | (substitute* "ext/standard/tests/streams/bug60602.phpt"
|
| 175 | (("'ls'") (string-append "'" (which "ls") "'")))
|
| 176 |
|
| 177 | ,@(if (string-prefix? "arm" (or (%current-system)
|
| 178 | (%current-target-system)))
|
| 179 | |
| 180 | '((for-each delete-file
|
| 181 | (list
|
| 182 | "ext/calendar/tests/unixtojd_error1.phpt"
|
| 183 | |
| 184 | "ext/fileinfo/tests/cve-2014-3538-nojit.phpt"
|
| 185 | "ext/pcre/tests/bug76514.phpt"
|
| 186 | "ext/pcre/tests/preg_match_error3.phpt"
|
| 187 | "ext/standard/tests/general_functions/var_export-locale.phpt"
|
| 188 | "ext/standard/tests/general_functions/var_export_basic1.phpt"
|
| 189 | "ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt"
|
| 190 | "ext/intl/tests/timezone_getOffset_error.phpt")))
|
| 191 | '())
|
| 192 |
|
| 193 | |
| 194 | (for-each delete-file
|
| 195 | '("ext/posix/tests/posix_getgrgid.phpt" |
| 196 | "ext/posix/tests/posix_getgrnam_basic.phpt" |
| 197 | "ext/sockets/tests/bug63000.phpt" |
| 198 | "ext/sockets/tests/socket_shutdown.phpt" |
| 199 | "ext/sockets/tests/socket_send.phpt" |
| 200 | "ext/sockets/tests/mcast_ipv4_recv.phpt" |
| 201 | |
| 202 | "ext/standard/tests/general_functions/getservbyname_basic.phpt"
|
| 203 | "ext/standard/tests/general_functions/getservbyport_basic.phpt"
|
| 204 | "ext/standard/tests/general_functions/getservbyport_variation1.phpt"
|
| 205 | |
| 206 | "ext/standard/tests/network/getprotobyname_basic.phpt"
|
| 207 | "ext/standard/tests/network/getprotobynumber_basic.phpt"
|
| 208 | |
| 209 | "ext/standard/tests/strings/setlocale_basic1.phpt"
|
| 210 | "ext/standard/tests/strings/setlocale_basic2.phpt"
|
| 211 | "ext/standard/tests/strings/setlocale_basic3.phpt"
|
| 212 | "ext/standard/tests/strings/setlocale_variation1.phpt"
|
| 213 |
|
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | "ext/gd/tests/bug39780_extern.phpt"
|
| 219 | "ext/gd/tests/libgd00086_extern.phpt"
|
| 220 | |
| 221 | "ext/gd/tests/bug45799.phpt"
|
| 222 | |
| 223 | "ext/gd/tests/createfromwbmp2_extern.phpt"
|
| 224 | |
| 225 | |
| 226 | "ext/gd/tests/bug65148.phpt"
|
| 227 | |
| 228 | "ext/gd/tests/bug77269.phpt"
|
| 229 | |
| 230 | "ext/gd/tests/xpm2gd.phpt"
|
| 231 | "ext/gd/tests/xpm2jpg.phpt"
|
| 232 | "ext/gd/tests/xpm2png.phpt"
|
| 233 | |
| 234 | |
| 235 | "ext/gd/tests/bug77479.phpt"
|
| 236 | |
| 237 | |
| 238 | |
| 239 | "ext/gd/tests/bug77973.phpt"
|
| 240 | |
| 241 | "ext/gd/tests/bug79067.phpt"
|
| 242 | "ext/gd/tests/bug79068.phpt"
|
| 243 |
|
| 244 | |
| 245 | |
| 246 | |
| 247 | "ext/iconv/tests/bug52211.phpt"
|
| 248 | "ext/iconv/tests/bug60494.phpt"
|
| 249 | |
| 250 | "ext/iconv/tests/iconv_strlen_error2.phpt"
|
| 251 | "ext/iconv/tests/iconv_substr_error2.phpt"
|
| 252 | |
| 253 | "ext/iconv/tests/iconv_strpos_error2.phpt"
|
| 254 | "ext/iconv/tests/iconv_strrpos_error2.phpt"
|
| 255 | |
| 256 | |
| 257 | "ext/iconv/tests/bug76249.phpt"
|
| 258 |
|
| 259 | |
| 260 | |
| 261 | "ext/curl/tests/bug61948-unix.phpt"
|
| 262 | |
| 263 | "ext/standard/tests/file/bug41655_1.phpt"
|
| 264 | "ext/standard/tests/file/glob_variation5.phpt"
|
| 265 | |
| 266 | "ext/gd/tests/bug43073.phpt"
|
| 267 | |
| 268 | "ext/gd/tests/bug48732-mb.phpt"
|
| 269 | "ext/gd/tests/bug48732.phpt"
|
| 270 | |
| 271 | "ext/gd/tests/bug48801-mb.phpt"
|
| 272 | "ext/gd/tests/bug48801.phpt"
|
| 273 | |
| 274 | "ext/gd/tests/bug53504.phpt"
|
| 275 | |
| 276 | "ext/gd/tests/bug73272.phpt"
|
| 277 | |
| 278 | |
| 279 | "ext/iconv/tests/bug48147.phpt"
|
| 280 | |
| 281 | "ext/iconv/tests/bug51250.phpt"
|
| 282 | |
| 283 | "ext/iconv/tests/iconv_mime_encode.phpt"
|
| 284 | |
| 285 | |
| 286 | "ext/standard/tests/file/bug43008.phpt"
|
| 287 | |
| 288 | "ext/pdo_sqlite/tests/bug_42589.phpt"))
|
| 289 |
|
| 290 | |
| 291 | (setenv "SKIP_ONLINE_TESTS" "1")
|
| 292 | |
| 293 | (setenv "REPORT_EXIT_STATUS" "1")
|
| 294 | |
| 295 | |
| 296 | (setenv "SKIP_IO_CAPTURE_TESTS" "1")
|
| 297 | #t)))
|
| 298 | #:test-target "test"))
|
| 299 | (inputs
|
| 300 | `(("aspell" ,aspell)
|
| 301 | ("bzip2" ,bzip2)
|
| 302 | ("curl" ,curl)
|
| 303 | ("cyrus-sasl" ,cyrus-sasl)
|
| 304 | ("gd" ,gd)
|
| 305 | ("gdbm" ,gdbm)
|
| 306 | ("glibc" ,glibc)
|
| 307 | ("gmp" ,gmp)
|
| 308 | ("gnutls" ,gnutls)
|
| 309 | ("icu4c" ,icu4c)
|
| 310 | ("libgcrypt" ,libgcrypt)
|
| 311 | ("libpng" ,libpng)
|
| 312 | ("libxml2" ,libxml2)
|
| 313 | ("libxslt" ,libxslt)
|
| 314 | ("libx11" ,libx11)
|
| 315 | ("libzip" ,libzip)
|
| 316 | ("oniguruma" ,oniguruma)
|
| 317 | ("openldap" ,openldap)
|
| 318 | ("openssl" ,openssl)
|
| 319 | ("pcre" ,pcre2)
|
| 320 | ("postgresql" ,postgresql)
|
| 321 | ("readline" ,readline)
|
| 322 | ("sqlite" ,sqlite)
|
| 323 | ("tidy" ,tidy)
|
| 324 | ("zlib" ,zlib)))
|
| 325 | (native-inputs
|
| 326 | `(("pkg-config" ,pkg-config)
|
| 327 | ("bison" ,bison)
|
| 328 | ("intltool" ,intltool)
|
| 329 | ("procps" ,procps))) |
| 330 | (synopsis "PHP programming language")
|
| 331 | (description
|
| 332 | "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
|
| 333 | language designed primarily for web development but is also used as
|
| 334 | a general-purpose programming language. PHP code may be embedded into
|
| 335 | HTML code, or it can be used in combination with various web template
|
| 336 | systems, web content management systems and web frameworks." )
|
| 337 | (license (list
|
| 338 | (license:non-copyleft "file://LICENSE") |
| 339 | (license:non-copyleft "file://Zend/LICENSE") |
| 340 | license:lgpl2.1 |
| 341 | license:lgpl2.1+ |
| 342 | license:bsd-2 |
| 343 | license:expat)))) |