1 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
2 # Contributor: Matt Harrison <matt@harrison.us.com>
28 url='https://www.php.net/'
29 makedepends=('apache' 'aspell' 'c-client' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
30 'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl'
32 checkdepends=('procps-ng')
34 source=("https://php.net/distributions/php-${pkgver}.tar.xz"{,.asc}
35 'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
36 'enchant-2.patch' 'php7.patch')
37 sha512sums=('052fbb6120b9943927685f736574871bc2b0c60d4ef18b54ec3f3d92398842286189fd426647c3c91eec38b11ce607090c4cd339040c92bda852574b96c36f67'
39 '284e3c0fe3ded0ff3e7d53f2769ea207b4591ef42abeff2d8604e87fe379929bd3b19ff294a729834f339a9da85ae7d4a7d8605890677222f78601b4f2b22247'
40 'eccbe1a0c7b2757ab3c982c871cc591a66ad70f085aaa0d44f93cacacedc7b8fd21b8d0c66471327ff070db1bab1ab83a802f6fa190f33bdd74c134975e3910e'
41 'bf43a99b464a873986954233e2df4841eeab21a6d359a777b7514a4fa34462c9f0fd85243086122ed50c766d5b60fb83f9f181a9b43ae1b527672a4f3b8d8eed'
42 '7248e9a93faebb86b156130b6ecd8c9733ae8dfa2789c738f9db5a2ab2daee294132b7d8a5a59c860e9e235fdc1bc6a9e9b8b410a23ccc5c6627297d834d3120'
43 '642e9f84d9d0df96e5d9bafcd3aed7aab3b4374e7917be98e9fa386919c64e9a27ac2daace99b4fcaa7256cca60a87d22893c2ef5383e5353926d8869fda376d'
44 '5d7d44d692848fbb952e17e5bd6dffa79b764526e4940fbe0a5138ad62cb41abdb8c9bb8dd64cd1d0b488c74972bcf3f9c6d32a3bbeac90982fdf6321d3ec788'
45 'f8c197fb657958016340db87de3e3427cc692cccc791e88c650362ed89bfd3be6180e430e5c446d19566b7e66225f9fa8cbed46a0909c87d6e046e65135d3031')
46 validpgpkeys=('5A52880781F755608BF815FC910DEB46F53EA312'
47 '42670A7FE4D0441C8E4632349E4FDC074A4EF02D')
48 _interpreter=${pkgver%.*}
51 cd "${srcdir}/php-${pkgver}"
53 patch -p0 -i "${srcdir}/apache.patch"
54 patch -p0 -i "${srcdir}/php-fpm.patch"
55 patch -p0 -i "${srcdir}/php.ini.patch"
56 patch -p0 -i "${srcdir}/enchant-2.patch"
57 patch -p0 -i "${srcdir}/php7.patch"
60 rm tests/output/stream_isatty_*.phpt
64 # http://site.icu-project.org/download/61#TOC-Migration-Issues
65 CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
67 local _phpconfig="--srcdir=../php-${pkgver} \
71 --sysconfdir=/etc/php7 \
72 --localstatedir=/var \
74 --with-config-file-path=/etc/php7 \
75 --with-config-file-scan-dir=/etc/php7/conf.d \
77 --mandir=/usr/share/man \
78 --libdir=/usr/lib/php7 \
79 --datarootdir=/usr/share/php7 \
80 --datadir=/usr/share/php7 \
82 --includedir=/usr/include/php7 \
83 --disable-gcc-global-regs \
86 local _phpextensions="\
87 --enable-bcmath=shared \
88 --enable-calendar=shared \
90 --enable-exif=shared \
93 --enable-intl=shared \
96 --enable-shmop=shared \
97 --enable-soap=shared \
98 --enable-sockets=shared \
99 --enable-sysvmsg=shared \
100 --enable-sysvsem=shared \
101 --enable-sysvshm=shared \
105 --with-enchant=shared \
107 --with-external-pcre \
110 --with-gettext=shared \
112 --with-iconv=shared \
119 --with-mysql-sock=/run/mysqld/mysqld.sock \
120 --with-mysqli=shared,mysqlnd \
122 --with-password-argon2 \
123 --with-pdo-dblib=shared,/usr \
124 --with-pdo-mysql=shared,mysqlnd \
125 --with-pdo-odbc=shared,unixODBC,/usr \
126 --with-pdo-pgsql=shared \
127 --with-pdo-sqlite=shared \
128 --with-pgsql=shared \
129 --with-pspell=shared \
132 --with-sodium=shared \
133 --with-sqlite3=shared \
135 --with-unixODBC=shared \
136 --with-xmlrpc=shared \
142 EXTENSION_DIR=/usr/lib/php7/modules
145 mkdir "${srcdir}/build"
147 ln -s ../php-${pkgver}/configure
148 ./configure ${_phpconfig} \
153 --with-fpm-user=http \
154 --with-fpm-group=http \
155 --enable-embed=shared \
160 # reuse the previous run; this will save us a lot of time
161 cp -a "${srcdir}/build" "${srcdir}/build-apache"
162 cd "${srcdir}/build-apache"
163 ./configure ${_phpconfig} \
169 cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
170 cd "${srcdir}/build-phpdbg"
171 ./configure ${_phpconfig} \
180 # Check if sendmail was configured correctly (FS#47600)
181 sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
183 export REPORT_EXIT_STATUS=1
184 export NO_INTERACTION=1
185 export SKIP_ONLINE_TESTS=1
186 export SKIP_SLOW_TESTS=1
187 export TEST_PHP_ARGS="-j$(nproc)"
188 export TESTS='tests Zend'
194 pkgdesc='A general-purpose scripting language that is especially suited to web development'
195 depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma')
196 provides=(php-interpreter=$_interpreter)
197 backup=('etc/php7/php.ini')
200 make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
201 install -D -m644 "${srcdir}/php-${pkgver}/php.ini-production" "${pkgdir}/etc/php7/php.ini"
202 install -d -m755 "${pkgdir}/etc/php7/conf.d/"
204 # remove static modules
205 rm -f "${pkgdir}/usr/lib/php7/modules/"*.a
206 # remove modules provided by sub packages
207 rm -f "${pkgdir}/usr/lib/php7/modules/"{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
208 # remove empty directory
209 rmdir "${pkgdir}/usr/include/php7/php/include"
213 pkgdesc='CGI and FCGI SAPI for PHP'
217 make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
220 package_php7-apache() {
221 pkgdesc='Apache SAPI for PHP'
222 depends=('php7' 'apache' 'libnsl')
223 backup=('etc/httpd/conf/extra/php7_module.conf')
225 install -D -m755 "${srcdir}/build-apache/libs/libphp7.so" "${pkgdir}/usr/lib/httpd/modules/libphp7.so"
226 install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php7_module.conf"
230 pkgdesc='FastCGI Process Manager for PHP'
231 depends=('php7' 'systemd')
232 backup=('etc/php7/php-fpm.conf' 'etc/php7/php-fpm.d/www.conf')
233 options=('!emptydirs')
236 make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
237 install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm7.service"
238 install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm7.conf"
241 package_php7-embed() {
242 pkgdesc='Embedded PHP SAPI library'
243 depends=('php7' 'systemd-libs' 'libnsl' 'libxcrypt')
244 options=('!emptydirs')
247 make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
250 package_php7-phpdbg() {
251 pkgdesc='Interactive PHP debugger'
253 options=('!emptydirs')
255 cd "${srcdir}/build-phpdbg"
256 make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
259 package_php7-dblib() {
260 pkgdesc='dblib module for PHP'
261 depends=('php7' 'freetds')
263 install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php7/modules/pdo_dblib.so"
266 package_php7-enchant() {
267 pkgdesc='enchant module for PHP'
268 depends=('php7' 'enchant')
270 install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php7/modules/enchant.so"
274 pkgdesc='gd module for PHP'
275 depends=('php7' 'gd')
277 install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php7/modules/gd.so"
280 package_php7-imap() {
281 pkgdesc='imap module for PHP'
282 depends=('php7' 'c-client' 'libxcrypt')
284 install -D -m755 "${srcdir}/build/modules/imap.so" "${pkgdir}/usr/lib/php7/modules/imap.so"
287 package_php7-intl() {
288 pkgdesc='intl module for PHP'
289 depends=('php7' 'icu')
291 install -D -m755 "${srcdir}/build/modules/intl.so" "${pkgdir}/usr/lib/php7/modules/intl.so"
294 package_php7-sodium() {
295 pkgdesc='sodium module for PHP'
296 depends=('php7' 'libsodium')
299 install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php7/modules/sodium.so"
302 package_php7-odbc() {
303 pkgdesc='ODBC modules for PHP'
304 depends=('php7' 'unixodbc')
306 install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php7/modules/odbc.so"
307 install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php7/modules/pdo_odbc.so"
310 package_php7-pgsql() {
311 pkgdesc='PostgreSQL modules for PHP'
312 depends=('php7' 'postgresql-libs')
314 install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php7/modules/pgsql.so"
315 install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php7/modules/pdo_pgsql.so"
318 package_php7-pspell() {
319 pkgdesc='pspell module for PHP'
320 depends=('php7' 'aspell')
322 install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php7/modules/pspell.so"
325 package_php7-snmp() {
326 pkgdesc='snmp module for PHP'
327 depends=('php7' 'net-snmp')
329 install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php7/modules/snmp.so"
332 package_php7-sqlite() {
333 pkgdesc='sqlite module for PHP'
334 depends=('php7' 'sqlite')
336 install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php7/modules/sqlite3.so"
337 install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php7/modules/pdo_sqlite.so"
340 package_php7-tidy() {
341 pkgdesc='tidy module for PHP'
342 depends=('php7' 'tidy')
344 install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php7/modules/tidy.so"
348 pkgdesc='xsl module for PHP'
349 depends=('php7' 'libxslt')
351 install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php7/modules/xsl.so"