| 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 | (define-module (gnu packages php)
|
| 26 | #:use-module (gnu packages)
|
| 27 | #:use-module (gnu packages algebra)
|
| 28 | #:use-module (gnu packages aspell)
|
| 29 | #:use-module (gnu packages base)
|
| 30 | #:use-module (gnu packages bison)
|
| 31 | #:use-module (gnu packages compression)
|
| 32 | #:use-module (gnu packages crypto)
|
| 33 | #:use-module (gnu packages curl)
|
| 34 | #:use-module (gnu packages cyrus-sasl)
|
| 35 | #:use-module (gnu packages databases)
|
| 36 | #:use-module (gnu packages dbm)
|
| 37 | #:use-module (gnu packages fontutils)
|
| 38 | #:use-module (gnu packages gd)
|
| 39 | #:use-module (gnu packages gettext)
|
| 40 | #:use-module (gnu packages gnupg)
|
| 41 | #:use-module (gnu packages icu4c)
|
| 42 | #:use-module (gnu packages image)
|
| 43 | #:use-module (gnu packages linux)
|
| 44 | #:use-module (gnu packages multiprecision)
|
| 45 | #:use-module (gnu packages openldap)
|
| 46 | #:use-module (gnu packages pcre)
|
| 47 | #:use-module (gnu packages pkg-config)
|
| 48 | #:use-module (gnu packages readline)
|
| 49 | #:use-module (gnu packages sqlite)
|
| 50 | #:use-module (gnu packages textutils)
|
| 51 | #:use-module (gnu packages tls)
|
| 52 | #:use-module (gnu packages web)
|
| 53 | #:use-module (gnu packages xml)
|
| 54 | #:use-module (gnu packages xorg)
|
| 55 | #:use-module (guix packages)
|
| 56 | #:use-module (guix download)
|
| 57 | #:use-module (guix build-system gnu)
|
| 58 | #:use-module (guix utils)
|
| 59 | #:use-module ((guix licenses) #:prefix license:))
|
| 60 |
|
| 61 | (define-public php
|
| 62 | (package
|
| 63 | (name "php")
|
| 64 | (version "7.4.30")
|
| 65 | (home-page "https://secure.php.net/")
|
| 66 | (source (origin
|
| 67 | (method url-fetch)
|
| 68 | (uri (string-append home-page "distributions/"
|
| 69 | "php-" version ".tar.xz"))
|
| 70 | (sha256
|
| 71 | (base32
|
| 72 | "03d7icwys4ikl45q3rgsxv1m3i7kfxhykpx75nn7jzn6697s6wpa"))
|
| 73 | (patches (search-patches "php-bug-74093-test.patch"
|
| 74 | "php-curl-compat.patch"))
|
| 75 | (modules '((guix build utils)))
|
| 76 | (snippet
|
| 77 | '(with-directory-excursion "ext"
|
| 78 | (for-each delete-file-recursively
|
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | '("gd/libgd"
|
| 86 | "pcre/pcre2lib"
|
| 87 | "xmlrpc/libxmlrpc"))))))
|
| 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 | #:phases
|
| 139 | (modify-phases %standard-phases
|
| 140 | (add-after 'unpack 'do-not-record-build-flags
|
| 141 | (lambda _
|
| 142 | |
| 143 | |
| 144 | (substitute* "scripts/php-config.in"
|
| 145 | (("@CONFIGURE_OPTIONS@") "")
|
| 146 | (("@PHP_LDFLAGS@") ""))
|
| 147 | |
| 148 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 149 | (substitute* "main/build-defs.h.in"
|
| 150 | (("@CONFIGURE_COMMAND@") "(omitted)")))))
|
| 151 | (add-before 'build 'patch-/bin/sh
|
| 152 | (lambda _
|
| 153 | (substitute* '("run-tests.php" "ext/standard/proc_open.c")
|
| 154 | (("/bin/sh") (which "sh")))))
|
| 155 | (add-before 'check 'prepare-tests
|
| 156 | (lambda _
|
| 157 | |
| 158 | |
| 159 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 160 | (substitute* '("ext/mbstring/tests/mb_send_mail02.phpt"
|
| 161 | "ext/mbstring/tests/mb_send_mail04.phpt"
|
| 162 | "ext/mbstring/tests/mb_send_mail05.phpt"
|
| 163 | "ext/mbstring/tests/mb_send_mail06.phpt")
|
| 164 | (("/bin/cat") (which "cat"))))
|
| 165 | (substitute* '("ext/mbstring/tests/mb_send_mail01.phpt"
|
| 166 | "ext/mbstring/tests/mb_send_mail03.phpt"
|
| 167 | "ext/mbstring/tests/bug52681.phpt"
|
| 168 | "ext/standard/tests/general_functions/bug34794.phpt"
|
| 169 | "ext/standard/tests/general_functions/bug44667.phpt"
|
| 170 | "ext/standard/tests/general_functions/proc_open.phpt")
|
| 171 | (("/bin/cat") (which "cat")))
|
| 172 |
|
| 173 | |
| 174 | (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
|
| 175 |
|
| 176 | (substitute* "ext/standard/tests/streams/bug60602.phpt"
|
| 177 | (("'ls'") (string-append "'" (which "ls") "'")))
|
| 178 |
|
| 179 | ,@(if (string-prefix? "arm" (or (%current-system)
|
| 180 | (%current-target-system)))
|
| 181 | |
| 182 | '((for-each delete-file
|
| 183 | (list
|
| 184 | "ext/calendar/tests/unixtojd_error1.phpt"
|
| 185 | |
| 186 | "ext/fileinfo/tests/cve-2014-3538-nojit.phpt"
|
| 187 | "ext/pcntl/tests/pcntl_unshare_01.phpt"
|
| 188 | "ext/pcre/tests/bug76514.phpt"
|
| 189 | "ext/pcre/tests/preg_match_error3.phpt"
|
| 190 | "ext/pcre/tests/cache_limit.phpt"
|
| 191 | "ext/sockets/tests/socket_getopt.phpt"
|
| 192 | "ext/sockets/tests/socket_sendrecvmsg_error.phpt"
|
| 193 | "ext/standard/tests/general_functions/var_export-locale.phpt"
|
| 194 | "ext/standard/tests/general_functions/var_export_basic1.phpt"
|
| 195 | "ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt"
|
| 196 | "ext/intl/tests/timezone_getOffset_error.phpt"
|
| 197 | "sapi/cli/tests/cli_process_title_unix.phpt"
|
| 198 | "sapi/cli/tests/upload_2G.phpt"
|
| 199 | "Zend/tests/concat_003.phpt")))
|
| 200 | '())
|
| 201 |
|
| 202 | ,@(if (target-ppc64le?)
|
| 203 | |
| 204 | '((for-each delete-file
|
| 205 | (list
|
| 206 | |
| 207 | |
| 208 | |
| 209 | "sapi/phpdbg/tests/watch_001.phpt"
|
| 210 | "sapi/phpdbg/tests/watch_003.phpt"
|
| 211 | "sapi/phpdbg/tests/watch_004.phpt"
|
| 212 | "sapi/phpdbg/tests/watch_005.phpt"
|
| 213 | "sapi/phpdbg/tests/watch_006.phpt")))
|
| 214 | '())
|
| 215 |
|
| 216 | |
| 217 | (for-each delete-file
|
| 218 | '("ext/posix/tests/posix_getgrgid.phpt" |
| 219 | "ext/posix/tests/posix_getgrnam_basic.phpt" |
| 220 | "ext/sockets/tests/bug63000.phpt" |
| 221 | "ext/sockets/tests/socket_shutdown.phpt" |
| 222 | "ext/sockets/tests/socket_send.phpt" |
| 223 | "ext/sockets/tests/mcast_ipv4_recv.phpt" |
| 224 | |
| 225 | "ext/standard/tests/general_functions/getservbyname_basic.phpt"
|
| 226 | "ext/standard/tests/general_functions/getservbyport_basic.phpt"
|
| 227 | "ext/standard/tests/general_functions/getservbyport_variation1.phpt"
|
| 228 | |
| 229 | "ext/standard/tests/network/getprotobyname_basic.phpt"
|
| 230 | "ext/standard/tests/network/getprotobynumber_basic.phpt"
|
| 231 | |
| 232 | "ext/standard/tests/strings/setlocale_basic1.phpt"
|
| 233 | "ext/standard/tests/strings/setlocale_basic2.phpt"
|
| 234 | "ext/standard/tests/strings/setlocale_basic3.phpt"
|
| 235 | "ext/standard/tests/strings/setlocale_variation1.phpt"
|
| 236 | |
| 237 | |
| 238 | "ext/standard/tests/file/disk_free_space_basic.phpt"
|
| 239 | |
| 240 | |
| 241 | |
| 242 | "ext/standard/tests/file/lstat_stat_variation8.phpt"
|
| 243 | |
| 244 | |
| 245 | "ext/date/tests/bug73837.phpt"
|
| 246 |
|
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | "ext/gd/tests/bug39780_extern.phpt"
|
| 252 | "ext/gd/tests/libgd00086_extern.phpt"
|
| 253 | |
| 254 | "ext/gd/tests/bug45799.phpt"
|
| 255 | |
| 256 | "ext/gd/tests/createfromwbmp2_extern.phpt"
|
| 257 | |
| 258 | |
| 259 | "ext/gd/tests/bug65148.phpt"
|
| 260 | |
| 261 | |
| 262 | |
| 263 | "ext/gd/tests/bug66590.phpt"
|
| 264 | |
| 265 | |
| 266 | |
| 267 | "ext/gd/tests/bug70102.phpt"
|
| 268 | |
| 269 | |
| 270 | |
| 271 | "ext/gd/tests/bug73869.phpt"
|
| 272 | |
| 273 | "ext/gd/tests/webp_basic.phpt"
|
| 274 | "ext/gd/tests/imagecreatefromstring_webp.phpt"
|
| 275 | |
| 276 | "ext/gd/tests/bug77269.phpt"
|
| 277 | |
| 278 | "ext/gd/tests/xpm2gd.phpt"
|
| 279 | "ext/gd/tests/xpm2jpg.phpt"
|
| 280 | "ext/gd/tests/xpm2png.phpt"
|
| 281 | |
| 282 | |
| 283 | "ext/gd/tests/bug77479.phpt"
|
| 284 | |
| 285 | |
| 286 | |
| 287 | "ext/gd/tests/bug77973.phpt"
|
| 288 | |
| 289 | |
| 290 | "ext/gd/tests/bug79067.phpt"
|
| 291 | |
| 292 | |
| 293 | "ext/gd/tests/bug79068.phpt"
|
| 294 |
|
| 295 | |
| 296 | |
| 297 | |
| 298 | "ext/iconv/tests/bug52211.phpt"
|
| 299 | "ext/iconv/tests/bug60494.phpt"
|
| 300 | |
| 301 | "ext/iconv/tests/iconv_strlen_error2.phpt"
|
| 302 | "ext/iconv/tests/iconv_substr_error2.phpt"
|
| 303 | |
| 304 | "ext/iconv/tests/iconv_strpos_error2.phpt"
|
| 305 | "ext/iconv/tests/iconv_strrpos_error2.phpt"
|
| 306 | |
| 307 | |
| 308 | "ext/iconv/tests/bug76249.phpt"
|
| 309 |
|
| 310 | |
| 311 | |
| 312 | "ext/curl/tests/bug61948-unix.phpt"
|
| 313 | |
| 314 | "ext/standard/tests/file/bug41655_1.phpt"
|
| 315 | "ext/standard/tests/file/glob_variation5.phpt"
|
| 316 | |
| 317 | "ext/gd/tests/bug43073.phpt"
|
| 318 | |
| 319 | "ext/gd/tests/bug48732-mb.phpt"
|
| 320 | "ext/gd/tests/bug48732.phpt"
|
| 321 | |
| 322 | "ext/gd/tests/bug48801-mb.phpt"
|
| 323 | "ext/gd/tests/bug48801.phpt"
|
| 324 | |
| 325 | "ext/gd/tests/bug53504.phpt"
|
| 326 | |
| 327 | "ext/gd/tests/bug73272.phpt"
|
| 328 | |
| 329 | |
| 330 | "ext/iconv/tests/bug48147.phpt"
|
| 331 | |
| 332 | "ext/iconv/tests/bug51250.phpt"
|
| 333 | |
| 334 | "ext/iconv/tests/iconv_mime_encode.phpt"
|
| 335 | |
| 336 | |
| 337 | "ext/standard/tests/file/bug43008.phpt"
|
| 338 | |
| 339 | "ext/pdo_sqlite/tests/bug_42589.phpt"
|
| 340 | |
| 341 | "ext/pcre/tests/bug79846.phpt"
|
| 342 | |
| 343 | "ext/pcre/tests/bug80118.phpt"
|
| 344 | |
| 345 | "ext/standard/tests/general_functions/proc_nice_basic.phpt"
|
| 346 | |
| 347 | "Zend/tests/bug74093.phpt"))
|
| 348 |
|
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | (substitute* "ext/openssl/tests/bug80747.phpt"
|
| 354 | ((".*error:%s:key size too small.*" match)
|
| 355 | (string-append "%s\n" match "%s\n")))
|
| 356 |
|
| 357 | |
| 358 | (setenv "SKIP_ONLINE_TESTS" "1")
|
| 359 | |
| 360 | (setenv "REPORT_EXIT_STATUS" "1")
|
| 361 | |
| 362 | |
| 363 | (setenv "SKIP_IO_CAPTURE_TESTS" "1"))))
|
| 364 | #:test-target "test"))
|
| 365 | (inputs
|
| 366 | `(("aspell" ,aspell)
|
| 367 | ("bzip2" ,bzip2)
|
| 368 | ("curl" ,curl)
|
| 369 | ("cyrus-sasl" ,cyrus-sasl)
|
| 370 | ("gd" ,gd)
|
| 371 | ("gdbm" ,gdbm)
|
| 372 | ("gmp" ,gmp)
|
| 373 | ("gnutls" ,gnutls)
|
| 374 | ("icu4c" ,icu4c)
|
| 375 | ("libgcrypt" ,libgcrypt)
|
| 376 | ("libpng" ,libpng)
|
| 377 | ("libsodium" ,libsodium)
|
| 378 | ("libxml2" ,libxml2)
|
| 379 | ("libxslt" ,libxslt)
|
| 380 | ("libx11" ,libx11)
|
| 381 | ("libzip" ,libzip)
|
| 382 | ("oniguruma" ,oniguruma)
|
| 383 | ("openldap" ,openldap)
|
| 384 | ("openssl" ,openssl-1.1)
|
| 385 | ("pcre" ,pcre2)
|
| 386 | ("postgresql" ,postgresql)
|
| 387 | ("readline" ,readline)
|
| 388 | ("sqlite" ,sqlite)
|
| 389 | ("tidy" ,tidy)
|
| 390 | ("zlib" ,zlib)))
|
| 391 | (native-inputs
|
| 392 | `(("pkg-config" ,pkg-config)
|
| 393 | ("bison" ,bison)
|
| 394 | ("gettext" ,gettext-minimal)
|
| 395 | ("procps" ,procps))) |
| 396 | (synopsis "PHP programming language")
|
| 397 | (description
|
| 398 | "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
|
| 399 | language designed primarily for web development but is also used as
|
| 400 | a general-purpose programming language. PHP code may be embedded into
|
| 401 | HTML code, or it can be used in combination with various web template
|
| 402 | systems, web content management systems and web frameworks." )
|
| 403 | (license (list
|
| 404 | (license:non-copyleft "file://LICENSE") |
| 405 | (license:non-copyleft "file://Zend/LICENSE") |
| 406 | license:lgpl2.1 |
| 407 | license:lgpl2.1+ |
| 408 | license:bsd-2 |
| 409 | license:expat)))) |