| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages php)
|
| 21 | #:use-module (gnu packages)
|
| 22 | #:use-module (gnu packages algebra)
|
| 23 | #:use-module (gnu packages aspell)
|
| 24 | #:use-module (gnu packages base)
|
| 25 | #:use-module (gnu packages bison)
|
| 26 | #:use-module (gnu packages compression)
|
| 27 | #:use-module (gnu packages curl)
|
| 28 | #:use-module (gnu packages cyrus-sasl)
|
| 29 | #:use-module (gnu packages databases)
|
| 30 | #:use-module (gnu packages fontutils)
|
| 31 | #:use-module (gnu packages gd)
|
| 32 | #:use-module (gnu packages gettext)
|
| 33 | #:use-module (gnu packages glib)
|
| 34 | #:use-module (gnu packages gnupg)
|
| 35 | #:use-module (gnu packages image)
|
| 36 | #:use-module (gnu packages linux)
|
| 37 | #:use-module (gnu packages multiprecision)
|
| 38 | #:use-module (gnu packages openldap)
|
| 39 | #:use-module (gnu packages pcre)
|
| 40 | #:use-module (gnu packages pkg-config)
|
| 41 | #:use-module (gnu packages readline)
|
| 42 | #:use-module (gnu packages textutils)
|
| 43 | #:use-module (gnu packages tls)
|
| 44 | #:use-module (gnu packages web)
|
| 45 | #:use-module (gnu packages xml)
|
| 46 | #:use-module (gnu packages xorg)
|
| 47 | #:use-module (gnu packages zip)
|
| 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.1.4")
|
| 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 | "02rh1lcfj2hakyls73gwn6w00yblnfh4883w13gn7sgkmn346lbi"))
|
| 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 | (build-system gnu-build-system)
|
| 82 | (arguments
|
| 83 | '(#:configure-flags
|
| 84 | (let-syntax ((with (syntax-rules ()
|
| 85 | ((_ option input)
|
| 86 | (string-append option "="
|
| 87 | (assoc-ref %build-inputs input))))))
|
| 88 | (list (with "--with-bz2" "bzip2")
|
| 89 | (with "--with-curl" "curl")
|
| 90 | (with "--with-freetype-dir" "freetype")
|
| 91 | (with "--with-gd" "gd")
|
| 92 | (with "--with-gdbm" "gdbm")
|
| 93 | (with "--with-gettext" "glibc") |
| 94 | (with "--with-gmp" "gmp")
|
| 95 | (with "--with-jpeg-dir" "libjpeg")
|
| 96 | (with "--with-ldap" "openldap")
|
| 97 | (with "--with-ldap-sasl" "cyrus-sasl")
|
| 98 | (with "--with-libzip" "zip")
|
| 99 | (with "--with-libxml-dir" "libxml2")
|
| 100 | (with "--with-onig" "oniguruma")
|
| 101 | (with "--with-pcre-dir" "pcre")
|
| 102 | (with "--with-pcre-regex" "pcre")
|
| 103 | (with "--with-pdo-pgsql" "postgresql")
|
| 104 | (with "--with-pdo-sqlite" "sqlite")
|
| 105 | (with "--with-pgsql" "postgresql")
|
| 106 | (with "--with-png-dir" "libpng")
|
| 107 | |
| 108 | |
| 109 | (with "--with-pspell" "aspell")
|
| 110 | (with "--with-readline" "readline")
|
| 111 | (with "--with-sqlite3" "sqlite")
|
| 112 | (with "--with-tidy" "tidy")
|
| 113 | (with "--with-webp-dir" "libwebp")
|
| 114 | (with "--with-xpm-dir" "libxpm")
|
| 115 | (with "--with-xsl" "libxslt")
|
| 116 | (with "--with-zlib-dir" "zlib")
|
| 117 | |
| 118 | |
| 119 | |
| 120 | "--with-iconv"
|
| 121 | "--with-openssl"
|
| 122 | "--with-mysqli" |
| 123 | "--with-pdo-mysql"
|
| 124 | "--with-zlib"
|
| 125 | "--enable-calendar"
|
| 126 | "--enable-dba=shared"
|
| 127 | "--enable-exif"
|
| 128 | "--enable-flatfile"
|
| 129 | "--enable-fpm"
|
| 130 | "--enable-ftp"
|
| 131 | "--enable-inifile"
|
| 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/bug52861.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 | |
| 174 | |
| 175 | (utime "sapi/phpdbg/tests/include.inc" 1 1)
|
| 176 | (utime "sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc" 1 1)
|
| 177 |
|
| 178 | |
| 179 | (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
|
| 180 |
|
| 181 | (substitute* "ext/standard/tests/streams/bug60602.phpt"
|
| 182 | (("'ls'") (string-append "'" (which "ls") "'")))
|
| 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 | "ext/gd/tests/xpm2gd.phpt"
|
| 225 | "ext/gd/tests/xpm2jpg.phpt"
|
| 226 | "ext/gd/tests/xpm2png.phpt"
|
| 227 |
|
| 228 | |
| 229 | |
| 230 | |
| 231 | "ext/iconv/tests/bug52211.phpt"
|
| 232 | |
| 233 | "ext/iconv/tests/iconv_mime_decode_variation3.phpt"
|
| 234 | "ext/iconv/tests/iconv_strlen_error2.phpt"
|
| 235 | "ext/iconv/tests/iconv_strlen_variation2.phpt"
|
| 236 | "ext/iconv/tests/iconv_substr_error2.phpt"
|
| 237 | |
| 238 | "ext/iconv/tests/iconv_strpos_error2.phpt"
|
| 239 | "ext/iconv/tests/iconv_strrpos_error2.phpt"
|
| 240 | |
| 241 | |
| 242 | "ext/iconv/tests/iconv_strpos_variation4.phpt"
|
| 243 | "ext/iconv/tests/iconv_strrpos_variation3.phpt"
|
| 244 |
|
| 245 | |
| 246 | |
| 247 | "ext/curl/tests/bug61948.phpt"
|
| 248 | |
| 249 | "ext/standard/tests/file/bug41655_1.phpt"
|
| 250 | "ext/standard/tests/file/glob_variation5.phpt"
|
| 251 | |
| 252 | "ext/standard/tests/streams/proc_open_bug64438.phpt"
|
| 253 | |
| 254 | "ext/gd/tests/bug43073.phpt"
|
| 255 | |
| 256 | "ext/gd/tests/bug48732-mb.phpt"
|
| 257 | "ext/gd/tests/bug48732.phpt"
|
| 258 | |
| 259 | "ext/gd/tests/bug48801-mb.phpt"
|
| 260 | "ext/gd/tests/bug48801.phpt"
|
| 261 | |
| 262 | "ext/gd/tests/bug53504.phpt"
|
| 263 | |
| 264 | "ext/gd/tests/bug73272.phpt"
|
| 265 | |
| 266 | |
| 267 | "ext/iconv/tests/bug48147.phpt"
|
| 268 | |
| 269 | "ext/iconv/tests/bug51250.phpt"
|
| 270 | |
| 271 | "ext/iconv/tests/iconv003.phpt"
|
| 272 | |
| 273 | "ext/iconv/tests/iconv_mime_encode.phpt"
|
| 274 | |
| 275 | |
| 276 | "ext/standard/tests/file/bug43008.phpt"
|
| 277 | |
| 278 | "ext/pdo_sqlite/tests/bug_42589.phpt"))
|
| 279 |
|
| 280 | |
| 281 | (setenv "SKIP_ONLINE_TESTS" "1")
|
| 282 | |
| 283 | (setenv "REPORT_EXIT_STATUS" "1")
|
| 284 | #t)))
|
| 285 | #:test-target "test"))
|
| 286 | (inputs
|
| 287 | `(("aspell" ,aspell)
|
| 288 | ("bzip2" ,bzip2)
|
| 289 | ("curl" ,curl)
|
| 290 | ("cyrus-sasl" ,cyrus-sasl)
|
| 291 | ("freetype" ,freetype)
|
| 292 | ("gd" ,gd)
|
| 293 | ("gdbm" ,gdbm)
|
| 294 | ("glibc" ,glibc)
|
| 295 | ("gmp" ,gmp)
|
| 296 | ("gnutls" ,gnutls)
|
| 297 | ("libgcrypt" ,libgcrypt)
|
| 298 | ("libjpeg" ,libjpeg)
|
| 299 | ("libpng" ,libpng)
|
| 300 | ("libwebp" ,libwebp)
|
| 301 | ("libxml2" ,libxml2)
|
| 302 | ("libxpm" ,libxpm)
|
| 303 | ("libxslt" ,libxslt)
|
| 304 | ("libx11" ,libx11)
|
| 305 | ("oniguruma" ,oniguruma)
|
| 306 | ("openldap" ,openldap)
|
| 307 | ("openssl" ,openssl)
|
| 308 | ("pcre" ,pcre)
|
| 309 | ("postgresql" ,postgresql)
|
| 310 | ("readline" ,readline)
|
| 311 | ("sqlite" ,sqlite)
|
| 312 | ("tidy" ,tidy)
|
| 313 | ("zip" ,zip)
|
| 314 | ("zlib" ,zlib)))
|
| 315 | (native-inputs
|
| 316 | `(("pkg-config" ,pkg-config)
|
| 317 | ("bison" ,bison)
|
| 318 | ("intltool" ,intltool)
|
| 319 | ("procps" ,procps))) |
| 320 | (synopsis "PHP programming language")
|
| 321 | (description
|
| 322 | "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
|
| 323 | language designed primarily for web development but is also used as
|
| 324 | a general-purpose programming language. PHP code may be embedded into
|
| 325 | HTML code, or it can be used in combination with various web template
|
| 326 | systems, web content management systems and web frameworks." )
|
| 327 | (license (list
|
| 328 | (license:non-copyleft "file://LICENSE") |
| 329 | (license:non-copyleft "file://Zend/LICENSE") |
| 330 | license:lgpl2.1 |
| 331 | license:lgpl2.1+ |
| 332 | license:bsd-2 |
| 333 | license:expat)))) |