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