| 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 | |
| 54 | |
| 55 | (define gd-for-php
|
| 56 | (package (inherit gd)
|
| 57 | (source
|
| 58 | (origin
|
| 59 | (inherit (package-source gd))
|
| 60 | (patches (search-patches
|
| 61 | "gd-fix-truecolor-format-correction.patch"
|
| 62 | "gd-fix-chunk-size-on-boundaries.patch"))))))
|
| 63 |
|
| 64 | (define-public php
|
| 65 | (package
|
| 66 | (name "php")
|
| 67 | (version "7.0.14")
|
| 68 | (home-page "https://secure.php.net/")
|
| 69 | (source (origin
|
| 70 | (method url-fetch)
|
| 71 | (uri (string-append home-page "distributions/"
|
| 72 | name "-" version ".tar.xz"))
|
| 73 | (sha256
|
| 74 | (base32
|
| 75 | "12ccgbrfchgvmcfb88rcknq7xmrf19c5ysdr4v8jxk51j9izy78g"))
|
| 76 | (modules '((guix build utils)))
|
| 77 | (snippet
|
| 78 | '(with-directory-excursion "ext"
|
| 79 | (for-each delete-file-recursively
|
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | '("gd/libgd"
|
| 87 | "mbstring/oniguruma"
|
| 88 | "pcre/pcrelib"
|
| 89 | "sqlite3/libsqlite"
|
| 90 | "xmlrpc/libxmlrpc"
|
| 91 | "zip/lib"))))))
|
| 92 | (build-system gnu-build-system)
|
| 93 | (arguments
|
| 94 | '(#:configure-flags
|
| 95 | (let-syntax ((with (syntax-rules ()
|
| 96 | ((_ option input)
|
| 97 | (string-append option "="
|
| 98 | (assoc-ref %build-inputs input))))))
|
| 99 | (list (with "--with-bz2" "bzip2")
|
| 100 | (with "--with-curl" "curl")
|
| 101 | (with "--with-freetype-dir" "freetype")
|
| 102 | (with "--with-gd" "gd")
|
| 103 | (with "--with-gdbm" "gdbm")
|
| 104 | (with "--with-gettext" "glibc") |
| 105 | (with "--with-gmp" "gmp")
|
| 106 | (with "--with-jpeg-dir" "libjpeg")
|
| 107 | (with "--with-ldap" "openldap")
|
| 108 | (with "--with-ldap-sasl" "cyrus-sasl")
|
| 109 | (with "--with-libzip" "zip")
|
| 110 | (with "--with-libxml-dir" "libxml2")
|
| 111 | (with "--with-onig" "oniguruma")
|
| 112 | (with "--with-pcre-dir" "pcre")
|
| 113 | (with "--with-pcre-regex" "pcre")
|
| 114 | (with "--with-pdo-pgsql" "postgresql")
|
| 115 | (with "--with-pdo-sqlite" "sqlite")
|
| 116 | (with "--with-pgsql" "postgresql")
|
| 117 | (with "--with-png-dir" "libpng")
|
| 118 | |
| 119 | |
| 120 | (with "--with-pspell" "aspell")
|
| 121 | (with "--with-readline" "readline")
|
| 122 | (with "--with-sqlite3" "sqlite")
|
| 123 | (with "--with-tidy" "tidy")
|
| 124 | (with "--with-webp-dir" "libwebp")
|
| 125 | (with "--with-xpm-dir" "libxpm")
|
| 126 | (with "--with-xsl" "libxslt")
|
| 127 | (with "--with-zlib-dir" "zlib")
|
| 128 | |
| 129 | |
| 130 | |
| 131 | "--with-iconv"
|
| 132 | "--with-openssl"
|
| 133 | "--with-pdo-mysql"
|
| 134 | "--with-zlib"
|
| 135 | "--enable-calendar"
|
| 136 | "--enable-dba=shared"
|
| 137 | "--enable-exif"
|
| 138 | "--enable-flatfile"
|
| 139 | "--enable-fpm"
|
| 140 | "--enable-ftp"
|
| 141 | "--enable-inifile"
|
| 142 | "--enable-mbstring"
|
| 143 | "--enable-pcntl"
|
| 144 | "--enable-sockets"
|
| 145 | "--enable-threads"))
|
| 146 | #:phases
|
| 147 | (modify-phases %standard-phases
|
| 148 | (add-after 'unpack 'do-not-record-build-flags
|
| 149 | (lambda _
|
| 150 | |
| 151 | |
| 152 | (substitute* "scripts/php-config.in"
|
| 153 | (("@CONFIGURE_OPTIONS@") "")
|
| 154 | (("@PHP_LDFLAGS@") ""))
|
| 155 | |
| 156 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 157 | (substitute* "main/build-defs.h.in"
|
| 158 | (("@CONFIGURE_COMMAND@") "(omitted)")))
|
| 159 | #t))
|
| 160 | (add-before 'build 'patch-/bin/sh
|
| 161 | (lambda _
|
| 162 | (substitute* '("run-tests.php" "ext/standard/proc_open.c")
|
| 163 | (("/bin/sh") (which "sh")))
|
| 164 | #t))
|
| 165 | (add-before 'check 'prepare-tests
|
| 166 | (lambda _
|
| 167 | |
| 168 | |
| 169 | (with-fluids ((%default-port-encoding "ISO-8859-1"))
|
| 170 | (substitute* '("ext/mbstring/tests/mb_send_mail02.phpt"
|
| 171 | "ext/mbstring/tests/mb_send_mail04.phpt"
|
| 172 | "ext/mbstring/tests/mb_send_mail05.phpt"
|
| 173 | "ext/mbstring/tests/mb_send_mail06.phpt")
|
| 174 | (("/bin/cat") (which "cat"))))
|
| 175 | (substitute* '("ext/mbstring/tests/mb_send_mail01.phpt"
|
| 176 | "ext/mbstring/tests/mb_send_mail03.phpt"
|
| 177 | "ext/mbstring/tests/bug52861.phpt"
|
| 178 | "ext/standard/tests/general_functions/bug34794.phpt"
|
| 179 | "ext/standard/tests/general_functions/bug44667.phpt"
|
| 180 | "ext/standard/tests/general_functions/proc_open.phpt")
|
| 181 | (("/bin/cat") (which "cat")))
|
| 182 | |
| 183 | (delete-file "ext/mbstring/tests/mb_send_mail07.phpt")
|
| 184 |
|
| 185 | (substitute* "ext/standard/tests/streams/bug60602.phpt"
|
| 186 | (("'ls'") (string-append "'" (which "ls") "'")))
|
| 187 |
|
| 188 | |
| 189 | (for-each delete-file
|
| 190 | '("ext/posix/tests/posix_getgrgid.phpt" |
| 191 | "ext/sockets/tests/bug63000.phpt" |
| 192 | "ext/sockets/tests/socket_shutdown.phpt" |
| 193 | "ext/sockets/tests/socket_send.phpt" |
| 194 | "ext/sockets/tests/mcast_ipv4_recv.phpt" |
| 195 | |
| 196 | "ext/standard/tests/general_functions/getservbyname_basic.phpt"
|
| 197 | "ext/standard/tests/general_functions/getservbyport_basic.phpt"
|
| 198 | "ext/standard/tests/general_functions/getservbyport_variation1.phpt"
|
| 199 | |
| 200 | "ext/standard/tests/network/getprotobyname_basic.phpt"
|
| 201 | "ext/standard/tests/network/getprotobynumber_basic.phpt"
|
| 202 | |
| 203 | "ext/standard/tests/strings/setlocale_basic1.phpt"
|
| 204 | "ext/standard/tests/strings/setlocale_basic2.phpt"
|
| 205 | "ext/standard/tests/strings/setlocale_basic3.phpt"
|
| 206 | "ext/standard/tests/strings/setlocale_variation1.phpt"
|
| 207 |
|
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | "ext/gd/tests/bug39780_extern.phpt"
|
| 213 | "ext/gd/tests/libgd00086_extern.phpt"
|
| 214 | |
| 215 | "ext/gd/tests/bug45799.phpt"
|
| 216 | |
| 217 | "ext/gd/tests/bug66356.phpt"
|
| 218 | |
| 219 | "ext/gd/tests/bug72339.phpt"
|
| 220 | |
| 221 | |
| 222 | "ext/gd/tests/bug72482.phpt"
|
| 223 | "ext/gd/tests/bug72482_2.phpt"
|
| 224 | "ext/gd/tests/bug73213.phpt"
|
| 225 | |
| 226 | "ext/gd/tests/createfromwbmp2_extern.phpt"
|
| 227 | |
| 228 | "ext/gd/tests/xpm2gd.phpt"
|
| 229 | "ext/gd/tests/xpm2jpg.phpt"
|
| 230 | "ext/gd/tests/xpm2png.phpt"
|
| 231 |
|
| 232 | |
| 233 | |
| 234 | |
| 235 | "ext/iconv/tests/bug52211.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 | |
| 251 | "ext/curl/tests/bug61948.phpt"
|
| 252 | |
| 253 | "ext/standard/tests/file/bug41655_1.phpt"
|
| 254 | "ext/standard/tests/file/glob_variation5.phpt"
|
| 255 | |
| 256 | "ext/standard/tests/streams/proc_open_bug64438.phpt"
|
| 257 | |
| 258 | "ext/gd/tests/bug43073.phpt"
|
| 259 | |
| 260 | "ext/gd/tests/bug48732.phpt"
|
| 261 | |
| 262 | "ext/gd/tests/bug48801.phpt"
|
| 263 | |
| 264 | "ext/gd/tests/bug53504.phpt"
|
| 265 | |
| 266 | "ext/gd/tests/bug73272.phpt"
|
| 267 | |
| 268 | |
| 269 | "ext/iconv/tests/bug48147.phpt"
|
| 270 | |
| 271 | "ext/iconv/tests/bug51250.phpt"
|
| 272 | |
| 273 | "ext/iconv/tests/iconv003.phpt"
|
| 274 | |
| 275 | "ext/iconv/tests/iconv_mime_encode.phpt"
|
| 276 | |
| 277 | |
| 278 | "ext/standard/tests/file/bug43008.phpt"
|
| 279 | |
| 280 | "ext/pdo_sqlite/tests/bug_42589.phpt"))
|
| 281 |
|
| 282 | |
| 283 | (setenv "SKIP_ONLINE_TESTS" "1")
|
| 284 | |
| 285 | (setenv "REPORT_EXIT_STATUS" "1")
|
| 286 | #t)))
|
| 287 | #:test-target "test"))
|
| 288 | (inputs
|
| 289 | `(("aspell" ,aspell)
|
| 290 | ("bzip2" ,bzip2)
|
| 291 | ("curl" ,curl)
|
| 292 | ("cyrus-sasl" ,cyrus-sasl)
|
| 293 | ("freetype" ,freetype)
|
| 294 | ("gd" ,gd-for-php)
|
| 295 | ("gdbm" ,gdbm)
|
| 296 | ("glibc" ,glibc)
|
| 297 | ("gmp" ,gmp)
|
| 298 | ("libgcrypt" ,libgcrypt)
|
| 299 | ("libjpeg" ,libjpeg)
|
| 300 | ("libpng" ,libpng)
|
| 301 | ("libwebp" ,libwebp)
|
| 302 | ("libxml2" ,libxml2)
|
| 303 | ("libxpm" ,libxpm)
|
| 304 | ("libxslt" ,libxslt)
|
| 305 | ("libx11" ,libx11)
|
| 306 | ("oniguruma" ,oniguruma)
|
| 307 | ("openldap" ,openldap)
|
| 308 | ("openssl" ,openssl)
|
| 309 | ("pcre" ,pcre)
|
| 310 | ("postgresql" ,postgresql)
|
| 311 | ("readline" ,readline)
|
| 312 | ("sqlite" ,sqlite-3.15.1)
|
| 313 | ("tidy" ,tidy)
|
| 314 | ("zip" ,zip)
|
| 315 | ("zlib" ,zlib)))
|
| 316 | (native-inputs
|
| 317 | `(("pkg-config" ,pkg-config)
|
| 318 | ("bison" ,bison)
|
| 319 | ("intltool" ,intltool)
|
| 320 | ("procps" ,procps))) |
| 321 | (synopsis "PHP programming language")
|
| 322 | (description
|
| 323 | "PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
|
| 324 | language designed primarily for web development but is also used as
|
| 325 | a general-purpose programming language. PHP code may be embedded into
|
| 326 | HTML code, or it can be used in combination with various web template
|
| 327 | systems, web content management systems and web frameworks." )
|
| 328 | (license (list
|
| 329 | (license:non-copyleft "file://LICENSE") |
| 330 | (license:non-copyleft "file://Zend/LICENSE") |
| 331 | license:lgpl2.1 |
| 332 | license:lgpl2.1+ |
| 333 | license:bsd-2 |
| 334 | license:expat)))) |