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