| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 |
|
| 26 | (define-module (gnu packages php)
|
| 27 | #:use-module (gnu packages)
|
| 28 | #:use-module (gnu packages algebra)
|
| 29 | #:use-module (gnu packages aspell)
|
| 30 | #:use-module (gnu packages base)
|
| 31 | #:use-module (gnu packages bison)
|
| 32 | #:use-module (gnu packages compression)
|
| 33 | #:use-module (gnu packages crypto)
|
| 34 | #:use-module (gnu packages curl)
|
| 35 | #:use-module (gnu packages cyrus-sasl)
|
| 36 | #:use-module (gnu packages databases)
|
| 37 | #:use-module (gnu packages dbm)
|
| 38 | #:use-module (gnu packages fontutils)
|
| 39 | #:use-module (gnu packages gd)
|
| 40 | #:use-module (gnu packages gettext)
|
| 41 | #:use-module (gnu packages gnupg)
|
| 42 | #:use-module (gnu packages icu4c)
|
| 43 | #:use-module (gnu packages image)
|
| 44 | #:use-module (gnu packages linux)
|
| 45 | #:use-module (gnu packages multiprecision)
|
| 46 | #:use-module (gnu packages openldap)
|
| 47 | #:use-module (gnu packages pcre)
|
| 48 | #:use-module (gnu packages pkg-config)
|
| 49 | #:use-module (gnu packages readline)
|
| 50 | #:use-module (gnu packages sqlite)
|
| 51 | #:use-module (gnu packages textutils)
|
| 52 | #:use-module (gnu packages tls)
|
| 53 | #:use-module (gnu packages web)
|
| 54 | #:use-module (gnu packages xml)
|
| 55 | #:use-module (gnu packages xorg)
|
| 56 | #:use-module (guix packages)
|
| 57 | #:use-module (guix download)
|
| 58 | #:use-module (guix build-system gnu)
|
| 59 | #:use-module (guix utils)
|
| 60 | #:use-module ((guix licenses) #:prefix license:))
|
| 61 |
|
| 62 | (define-public php
|
| 63 | (package
|
| 64 | (name "php")
|
| 65 | (version "8.2.2")
|
| 66 | (home-page "https://www.php.net/")
|
| 67 | (source (origin
|
| 68 | (method url-fetch)
|
| 69 | (uri (string-append home-page "distributions/"
|
| 70 | "php-" version ".tar.xz"))
|
| 71 | (sha256
|
| 72 | (base32
|
| 73 | "0czflx9ikxymjfgnzaifjx9kc30ww2x4063075hcifjjwqwami5x"))
|
| 74 | (patches
|
| 75 | (search-patches "php-fix-streams-copy-length.patch"))
|
| 76 | (modules '((guix build utils)))
|
| 77 | (snippet
|
| 78 | '(with-directory-excursion "ext"
|
| 79 | (for-each delete-file-recursively
|
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | '("gd/libgd"
|
| 87 | "pcre/pcre2lib"))))))
|
| 88 | (build-system gnu-build-system)
|
| 89 | (arguments
|
| 90 | `(#:configure-flags
|
| 91 | (let-syntax ((with (syntax-rules ()
|
| 92 | ((_ option input)
|
| 93 | (string-append option "="
|
| 94 | (assoc-ref %build-inputs input))))))
|
| 95 | (list (with "--with-bz2" "bzip2")
|
| 96 | (with "--with-curl" "curl")
|
| 97 | (with "--with-gdbm" "gdbm")
|
| 98 | (with "--with-gettext" "libc") |
| 99 | (with "--with-gmp" "gmp")
|
| 100 | (with "--with-ldap" "openldap")
|
| 101 | (with "--with-ldap-sasl" "cyrus-sasl")
|
| 102 | (with "--with-pdo-pgsql" "postgresql")
|
| 103 | (with "--with-pdo-sqlite" "sqlite")
|
| 104 | (with "--with-pgsql" "postgresql")
|
| 105 | |
| 106 | |
| 107 | (with "--with-pspell" "aspell")
|
| 108 | (with "--with-readline" "readline")
|
| 109 | (with "--with-sodium" "libsodium")
|
| 110 | (with "--with-sqlite3" "sqlite")
|
| 111 | (with "--with-tidy" "tidy")
|
| 112 | (with "--with-xsl" "libxslt")
|
| 113 | (with "--with-zlib-dir" "zlib")
|
| 114 | |
| 115 | |
| 116 | |
| 117 | "--with-external-pcre"
|
| 118 | "--with-external-gd"
|
| 119 | "--with-iconv"
|
| 120 | "--with-openssl"
|
| 121 | "--with-mysqli" |
| 122 | "--with-pdo-mysql"
|
| 123 | "--with-zip"
|
| 124 | "--with-zlib"
|
| 125 | "--enable-bcmath" |
| 126 | "--enable-calendar"
|
| 127 | "--enable-dba=shared"
|
| 128 | "--enable-exif"
|
| 129 | "--enable-flatfile"
|
| 130 | "--enable-fpm"
|
| 131 | "--enable-ftp"
|
| 132 | "--enable-gd"
|
| 133 | "--enable-inifile"
|
| 134 | "--enable-intl"
|
| 135 | "--enable-mbstring"
|
| 136 | "--enable-pcntl"
|
| 137 | "--enable-sockets"
|
| 138 | "--enable-sysvsem")) |
| 139 | #:phases
|
| 140 | (modify-phases %standard-phases
|
| 141 | (add-after 'unpack 'do-not-record-build-flags
|
| 142 | (lambda _
|
| 143 | |
| 144 | |
| 145 | (substitute* "scripts/php-config.in"
|
| 146 | (("@CONFIGURE_OPTIONS@") "")
|
| 147 | (("@PHP_LDFLAGS@") ""))
|
| 148 | |
| 149 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 150 | (substitute* "main/build-defs.h.in"
|
| 151 | (("@CONFIGURE_COMMAND@") "(omitted)")))))
|
| 152 | (add-before 'build 'patch-/bin/sh
|
| 153 | (lambda _
|
| 154 | (substitute* '("run-tests.php" "ext/standard/proc_open.c")
|
| 155 | (("/bin/sh") (which "sh")))))
|
| 156 | (add-before 'check 'prepare-tests
|
| 157 | (lambda _
|
| 158 | |
| 159 | |
| 160 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 161 | (substitute* '("ext/mbstring/tests/mb_send_mail02.phpt"
|
| 162 | "ext/mbstring/tests/mb_send_mail04.phpt"
|
| 163 | "ext/mbstring/tests/mb_send_mail05.phpt"
|
| 164 | "ext/mbstring/tests/mb_send_mail06.phpt")
|
| 165 | (("/bin/cat") (which "cat"))))
|
| 166 | (substitute* '("ext/mbstring/tests/mb_send_mail01.phpt"
|
| 167 | "ext/mbstring/tests/mb_send_mail03.phpt"
|
| 168 | "ext/mbstring/tests/bug52681.phpt"
|
| 169 | "ext/standard/tests/general_functions/bug34794.phpt"
|
| 170 | "ext/standard/tests/general_functions/bug44667.phpt"
|
| 171 | "ext/standard/tests/general_functions/proc_open.phpt")
|
| 172 | (("/bin/cat") (which "cat")))
|
| 173 |
|
| 174 | |
| 175 | (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
|
| 176 |
|
| 177 | (substitute* "ext/standard/tests/streams/bug60602.phpt"
|
| 178 | (("'ls'") (string-append "'" (which "ls") "'")))
|
| 179 |
|
| 180 | ,@(if (target-arm32?)
|
| 181 | |
| 182 | '((for-each delete-file
|
| 183 | (list
|
| 184 | "ext/calendar/tests/unixtojd_error1.phpt"
|
| 185 | "ext/opcache/tests/preload_006.phpt"
|
| 186 | "ext/opcache/tests/preload_011.phpt"
|
| 187 | |
| 188 | "ext/fileinfo/tests/cve-2014-3538-nojit.phpt"
|
| 189 | "ext/pcntl/tests/pcntl_unshare_01.phpt"
|
| 190 | "ext/pcre/tests/bug76514.phpt"
|
| 191 | "ext/pcre/tests/preg_match_error3.phpt"
|
| 192 | "ext/pcre/tests/cache_limit.phpt"
|
| 193 | "ext/sockets/tests/socket_getopt.phpt"
|
| 194 | "ext/sockets/tests/socket_sendrecvmsg_error.phpt"
|
| 195 | "ext/standard/tests/general_functions/var_export-locale.phpt"
|
| 196 | "ext/standard/tests/general_functions/var_export_basic1.phpt"
|
| 197 | "ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt"
|
| 198 | "ext/intl/tests/timezone_getOffset_error.phpt"
|
| 199 | "sapi/cli/tests/cli_process_title_unix.phpt"
|
| 200 | "sapi/cli/tests/upload_2G.phpt"
|
| 201 | "Zend/tests/concat_003.phpt")))
|
| 202 | '())
|
| 203 |
|
| 204 | ,@(if (target-x86-32?)
|
| 205 | |
| 206 | '((for-each delete-file
|
| 207 | (list
|
| 208 | "ext/dba/tests/dba_gdbm.phpt")))
|
| 209 | '())
|
| 210 |
|
| 211 | ,@(if (target-ppc64le?)
|
| 212 | |
| 213 | '((for-each delete-file
|
| 214 | (list
|
| 215 | |
| 216 | |
| 217 | |
| 218 | "sapi/phpdbg/tests/watch_001.phpt"
|
| 219 | "sapi/phpdbg/tests/watch_003.phpt"
|
| 220 | "sapi/phpdbg/tests/watch_004.phpt"
|
| 221 | "sapi/phpdbg/tests/watch_005.phpt"
|
| 222 | "sapi/phpdbg/tests/watch_006.phpt")))
|
| 223 | '())
|
| 224 |
|
| 225 | ,@(if (target-riscv64?)
|
| 226 | |
| 227 | '((for-each delete-file
|
| 228 | (list "sapi/cli/tests/upload_2G.phpt")))
|
| 229 | '())
|
| 230 |
|
| 231 | |
| 232 | (for-each delete-file
|
| 233 | '("ext/posix/tests/posix_getgrgid.phpt" |
| 234 | "ext/posix/tests/posix_getgrnam_basic.phpt" |
| 235 | "ext/sockets/tests/bug63000.phpt" |
| 236 | "ext/sockets/tests/socket_shutdown.phpt" |
| 237 | "ext/sockets/tests/socket_send.phpt" |
| 238 | "ext/sockets/tests/mcast_ipv4_recv.phpt" |
| 239 | |
| 240 | "ext/standard/tests/general_functions/getservbyname_basic.phpt"
|
| 241 | "ext/standard/tests/general_functions/getservbyport_basic.phpt"
|
| 242 | "ext/standard/tests/general_functions/getservbyport_variation1.phpt"
|
| 243 | |
| 244 | "ext/standard/tests/network/getprotobyname_basic.phpt"
|
| 245 | "ext/standard/tests/network/getprotobynumber_basic.phpt"
|
| 246 | |
| 247 | "ext/standard/tests/strings/setlocale_basic1.phpt"
|
| 248 | "ext/standard/tests/strings/setlocale_basic2.phpt"
|
| 249 | "ext/standard/tests/strings/setlocale_basic3.phpt"
|
| 250 | "ext/standard/tests/strings/setlocale_variation1.phpt"
|
| 251 | |
| 252 | |
| 253 | "ext/standard/tests/file/disk_free_space_basic.phpt"
|
| 254 | |
| 255 | |
| 256 | |
| 257 | "ext/standard/tests/file/lstat_stat_variation8.phpt"
|
| 258 | |
| 259 | |
| 260 | "ext/date/tests/bug73837.phpt"
|
| 261 |
|
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | "ext/gd/tests/bug39780_extern.phpt"
|
| 267 | "ext/gd/tests/libgd00086_extern.phpt"
|
| 268 | |
| 269 | "ext/gd/tests/bug45799.phpt"
|
| 270 | |
| 271 | "ext/gd/tests/createfromwbmp2_extern.phpt"
|
| 272 | |
| 273 | |
| 274 | "ext/gd/tests/bug65148.phpt"
|
| 275 | |
| 276 | |
| 277 | |
| 278 | "ext/gd/tests/bug66590.phpt"
|
| 279 | |
| 280 | |
| 281 | |
| 282 | "ext/gd/tests/bug70102.phpt"
|
| 283 | |
| 284 | |
| 285 | |
| 286 | "ext/gd/tests/bug73869.phpt"
|
| 287 | |
| 288 | "ext/gd/tests/webp_basic.phpt"
|
| 289 | "ext/gd/tests/imagecreatefromstring_webp.phpt"
|
| 290 | |
| 291 | "ext/gd/tests/xpm2gd.phpt"
|
| 292 | "ext/gd/tests/xpm2jpg.phpt"
|
| 293 | "ext/gd/tests/xpm2png.phpt"
|
| 294 | |
| 295 | |
| 296 | "ext/gd/tests/bug77479.phpt"
|
| 297 | |
| 298 | |
| 299 | |
| 300 | "ext/gd/tests/bug77973.phpt"
|
| 301 | |
| 302 | |
| 303 | "ext/gd/tests/bug79067.phpt"
|
| 304 | |
| 305 | |
| 306 | "ext/gd/tests/bug79068.phpt"
|
| 307 | |
| 308 | "ext/gd/tests/avif_decode_encode.phpt"
|
| 309 | |
| 310 | "ext/gd/tests/bug72339.phpt"
|
| 311 | "ext/gd/tests/bug77272.phpt"
|
| 312 | "ext/gd/tests/bug66356.phpt"
|
| 313 | |
| 314 | "ext/gd/tests/imagecreatefromstring_avif.phpt"
|
| 315 |
|
| 316 | |
| 317 | |
| 318 | |
| 319 | "ext/iconv/tests/bug52211.phpt"
|
| 320 | "ext/iconv/tests/bug60494.phpt"
|
| 321 | |
| 322 | "ext/iconv/tests/iconv_strlen_error2.phpt"
|
| 323 | "ext/iconv/tests/iconv_substr_error2.phpt"
|
| 324 | |
| 325 | "ext/iconv/tests/iconv_strpos_error2.phpt"
|
| 326 | "ext/iconv/tests/iconv_strrpos_error2.phpt"
|
| 327 | |
| 328 | |
| 329 | "ext/iconv/tests/bug76249.phpt"
|
| 330 |
|
| 331 | |
| 332 | |
| 333 | "ext/curl/tests/bug61948-unix.phpt"
|
| 334 | |
| 335 | "ext/curl/tests/curl_setopt_ssl.phpt"
|
| 336 |
|
| 337 | |
| 338 | |
| 339 | "sapi/fpm/tests/bug68591-conf-test-group.phpt"
|
| 340 | "sapi/fpm/tests/bug68591-conf-test-listen-group.phpt"
|
| 341 | "sapi/fpm/tests/bug68591-conf-test-listen-owner.phpt"
|
| 342 |
|
| 343 | |
| 344 | "ext/dba/tests/dba_gdbm_creation_matrix.phpt"
|
| 345 | |
| 346 | "ext/standard/tests/file/bug41655_1.phpt"
|
| 347 | "ext/standard/tests/file/glob_variation5.phpt"
|
| 348 | |
| 349 | "ext/gd/tests/bug43073.phpt"
|
| 350 | |
| 351 | "ext/gd/tests/bug48732-mb.phpt"
|
| 352 | "ext/gd/tests/bug48732.phpt"
|
| 353 | |
| 354 | "ext/gd/tests/bug48801-mb.phpt"
|
| 355 | "ext/gd/tests/bug48801.phpt"
|
| 356 | |
| 357 | "ext/gd/tests/bug53504.phpt"
|
| 358 | |
| 359 | "ext/gd/tests/bug73272.phpt"
|
| 360 | |
| 361 | |
| 362 | "ext/iconv/tests/bug48147.phpt"
|
| 363 | |
| 364 | "ext/iconv/tests/bug51250.phpt"
|
| 365 | |
| 366 | "ext/iconv/tests/iconv_mime_encode.phpt"
|
| 367 | |
| 368 | |
| 369 | "ext/standard/tests/file/bug43008.phpt"
|
| 370 | |
| 371 | "ext/pdo_sqlite/tests/bug_42589.phpt"
|
| 372 | |
| 373 | "ext/pcre/tests/bug79846.phpt"
|
| 374 | |
| 375 | "ext/pcre/tests/bug80118.phpt"
|
| 376 | |
| 377 | "ext/standard/tests/general_functions/proc_nice_basic.phpt"
|
| 378 | |
| 379 | "Zend/tests/bug74093.phpt"))
|
| 380 |
|
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | (substitute* "ext/openssl/tests/bug80747.phpt"
|
| 386 | ((".*error:%s:key size too small.*" match)
|
| 387 | (string-append "%s\n" match "%s\n")))
|
| 388 |
|
| 389 | |
| 390 | (setenv "SKIP_ONLINE_TESTS" "1")
|
| 391 | |
| 392 | (setenv "REPORT_EXIT_STATUS" "1")
|
| 393 | |
| 394 | |
| 395 | (setenv "SKIP_IO_CAPTURE_TESTS" "1"))))
|
| 396 | #:test-target "test"))
|
| 397 | (inputs
|
| 398 | `(("aspell" ,aspell)
|
| 399 | ("bzip2" ,bzip2)
|
| 400 | ("curl" ,curl)
|
| 401 | ("cyrus-sasl" ,cyrus-sasl)
|
| 402 | ("gd" ,gd)
|
| 403 | ("gdbm" ,gdbm)
|
| 404 | ("gmp" ,gmp)
|
| 405 | ("gnutls" ,gnutls)
|
| 406 | ("icu4c" ,icu4c)
|
| 407 | ("libgcrypt" ,libgcrypt)
|
| 408 | ("libpng" ,libpng)
|
| 409 | ("libsodium" ,libsodium)
|
| 410 | ("libxml2" ,libxml2)
|
| 411 | ("libxslt" ,libxslt)
|
| 412 | ("libx11" ,libx11)
|
| 413 | ("libzip" ,libzip)
|
| 414 | ("oniguruma" ,oniguruma)
|
| 415 | ("openldap" ,openldap)
|
| 416 | ("openssl" ,openssl-1.1)
|
| 417 | ("pcre" ,pcre2)
|
| 418 | ("postgresql" ,postgresql)
|
| 419 | ("readline" ,readline)
|
| 420 | ("sqlite" ,sqlite)
|
| 421 | ("tidy" ,tidy-html)
|
| 422 | ("zlib" ,zlib)))
|
| 423 | (native-inputs
|
| 424 | `(("pkg-config" ,pkg-config)
|
| 425 | ("bison" ,bison)
|
| 426 | ("gettext" ,gettext-minimal)
|
| 427 | ("procps" ,procps))) |
| 428 | (synopsis "PHP programming language")
|
| 429 | (description
|
| 430 | "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
|
| 431 | language designed primarily for web development but is also used as
|
| 432 | a general-purpose programming language. PHP code may be embedded into
|
| 433 | HTML code, or it can be used in combination with various web template
|
| 434 | systems, web content management systems and web frameworks." )
|
| 435 | (license (list
|
| 436 | (license:non-copyleft "file://LICENSE") |
| 437 | (license:non-copyleft "file://Zend/LICENSE") |
| 438 | license:lgpl2.1 |
| 439 | license:lgpl2.1+ |
| 440 | license:bsd-2 |
| 441 | license:expat)))) |