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