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