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' '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')
33 source=("https://php.net/distributions/php-${pkgver}.tar.xz"{,.asc}
34 'php7-openssl3.patch::https://github.com/php/php-src/commit/a0972deb0f441fc7991001cb51efc994b70a3b51.patch'
35 'php7-openssl3-eof.patch::https://github.com/php/php-src/commit/74f75db0c3665677ec006cd379fd561feacffdc6.patch'
36 'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
37 'enchant-2.patch' 'php7.patch')
38 sha512sums=('499b63b99e5d8e8082ff89d3a91b4cb9a593ea7553b96e48863414c13d2e50275904ed29070e2232e529ee91160f505e6060a4d129cb5bf098aa5b6ea0928d3d'
40 '07b9ba019221cce6f73ebf1fdc6124f0730e42d19b9e0f846d132423da3b820439d4cba61fff8e65937c955ba985889f0c57ed2f94f380213e7279b0531c6444'
41 '46112bf170c6f1772792c02d6cabd1219aa0d5e3123551cd2bbed480f7cf87743eece89539e3d62eacd312fd025235bb9f5ac1c771bd18ae5b606ae48a7bf222'
42 '284e3c0fe3ded0ff3e7d53f2769ea207b4591ef42abeff2d8604e87fe379929bd3b19ff294a729834f339a9da85ae7d4a7d8605890677222f78601b4f2b22247'
43 'eccbe1a0c7b2757ab3c982c871cc591a66ad70f085aaa0d44f93cacacedc7b8fd21b8d0c66471327ff070db1bab1ab83a802f6fa190f33bdd74c134975e3910e'
44 'bf43a99b464a873986954233e2df4841eeab21a6d359a777b7514a4fa34462c9f0fd85243086122ed50c766d5b60fb83f9f181a9b43ae1b527672a4f3b8d8eed'
45 '7248e9a93faebb86b156130b6ecd8c9733ae8dfa2789c738f9db5a2ab2daee294132b7d8a5a59c860e9e235fdc1bc6a9e9b8b410a23ccc5c6627297d834d3120'
46 '642e9f84d9d0df96e5d9bafcd3aed7aab3b4374e7917be98e9fa386919c64e9a27ac2daace99b4fcaa7256cca60a87d22893c2ef5383e5353926d8869fda376d'
47 '5d7d44d692848fbb952e17e5bd6dffa79b764526e4940fbe0a5138ad62cb41abdb8c9bb8dd64cd1d0b488c74972bcf3f9c6d32a3bbeac90982fdf6321d3ec788'
48 'f8c197fb657958016340db87de3e3427cc692cccc791e88c650362ed89bfd3be6180e430e5c446d19566b7e66225f9fa8cbed46a0909c87d6e046e65135d3031')
49 validpgpkeys=('5A52880781F755608BF815FC910DEB46F53EA312'
50 '42670A7FE4D0441C8E4632349E4FDC074A4EF02D')
51 _interpreter=${pkgver%.*}
54 cd "${srcdir}/php-${pkgver}"
56 patch -p1 -i "${srcdir}/php7-openssl3.patch"
57 patch -p1 -i "${srcdir}/php7-openssl3-eof.patch"
59 patch -p0 -i "${srcdir}/apache.patch"
60 patch -p0 -i "${srcdir}/php-fpm.patch"
61 patch -p0 -i "${srcdir}/php.ini.patch"
62 patch -p0 -i "${srcdir}/enchant-2.patch"
63 patch -p0 -i "${srcdir}/php7.patch"
66 rm tests/output/stream_isatty_*.phpt
70 # http://site.icu-project.org/download/61#TOC-Migration-Issues
71 CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1'
73 local _phpconfig="--srcdir=../php-${pkgver} \
77 --sysconfdir=/etc/php7 \
78 --localstatedir=/var \
80 --with-config-file-path=/etc/php7 \
81 --with-config-file-scan-dir=/etc/php7/conf.d \
83 --mandir=/usr/share/man \
84 --libdir=/usr/lib/php7 \
85 --datarootdir=/usr/share/php7 \
86 --datadir=/usr/share/php7 \
88 --includedir=/usr/include/php7 \
89 --disable-gcc-global-regs \
92 local _phpextensions="\
93 --enable-bcmath=shared \
94 --enable-calendar=shared \
96 --enable-exif=shared \
99 --enable-intl=shared \
102 --enable-shmop=shared \
103 --enable-soap=shared \
104 --enable-sockets=shared \
105 --enable-sysvmsg=shared \
106 --enable-sysvsem=shared \
107 --enable-sysvshm=shared \
110 --with-enchant=shared \
112 --with-external-pcre \
115 --with-gettext=shared \
117 --with-iconv=shared \
124 --with-mysql-sock=/run/mysqld/mysqld.sock \
125 --with-mysqli=shared,mysqlnd \
127 --with-password-argon2 \
128 --with-pdo-dblib=shared,/usr \
129 --with-pdo-mysql=shared,mysqlnd \
130 --with-pdo-odbc=shared,unixODBC,/usr \
131 --with-pdo-pgsql=shared \
132 --with-pdo-sqlite=shared \
133 --with-pgsql=shared \
134 --with-pspell=shared \
137 --with-sodium=shared \
138 --with-sqlite3=shared \
140 --with-unixODBC=shared \
141 --with-xmlrpc=shared \
147 EXTENSION_DIR=/usr/lib/php7/modules
150 mkdir "${srcdir}/build"
152 ln -s ../php-${pkgver}/configure
153 ./configure ${_phpconfig} \
158 --with-fpm-user=http \
159 --with-fpm-group=http \
160 --enable-embed=shared \
165 # reuse the previous run; this will save us a lot of time
166 cp -a "${srcdir}/build" "${srcdir}/build-apache"
167 cd "${srcdir}/build-apache"
168 ./configure ${_phpconfig} \
174 cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
175 cd "${srcdir}/build-phpdbg"
176 ./configure ${_phpconfig} \
185 # Check if sendmail was configured correctly (FS#47600)
186 sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
188 export REPORT_EXIT_STATUS=1
189 export NO_INTERACTION=1
190 export SKIP_ONLINE_TESTS=1
191 export SKIP_SLOW_TESTS=1
192 export TEST_PHP_ARGS="-j$(nproc)"
193 export TESTS='tests Zend'
199 pkgdesc='A general-purpose scripting language that is especially suited to web development'
200 depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma')
201 provides=(php-interpreter=$_interpreter)
202 backup=('etc/php7/php.ini')
205 make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
206 install -D -m644 "${srcdir}/php-${pkgver}/php.ini-production" "${pkgdir}/etc/php7/php.ini"
207 install -d -m755 "${pkgdir}/etc/php7/conf.d/"
209 # remove static modules
210 rm -f "${pkgdir}/usr/lib/php7/modules/"*.a
211 # remove modules provided by sub packages
212 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
213 # remove empty directory
214 rmdir "${pkgdir}/usr/include/php7/php/include"
218 pkgdesc='CGI and FCGI SAPI for PHP'
222 make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
225 package_php7-apache() {
226 pkgdesc='Apache SAPI for PHP'
227 depends=('php7' 'apache' 'libnsl')
228 backup=('etc/httpd/conf/extra/php7_module.conf')
230 install -D -m755 "${srcdir}/build-apache/libs/libphp7.so" "${pkgdir}/usr/lib/httpd/modules/libphp7.so"
231 install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php7_module.conf"
235 pkgdesc='FastCGI Process Manager for PHP'
236 depends=('php7' 'systemd')
237 backup=('etc/php7/php-fpm.conf' 'etc/php7/php-fpm.d/www.conf')
238 options=('!emptydirs')
241 make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
242 install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm7.service"
243 install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm7.conf"
246 package_php7-embed() {
247 pkgdesc='Embedded PHP SAPI library'
248 depends=('php7' 'systemd-libs' 'libnsl' 'libxcrypt')
249 options=('!emptydirs')
252 make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
255 package_php7-phpdbg() {
256 pkgdesc='Interactive PHP debugger'
258 options=('!emptydirs')
260 cd "${srcdir}/build-phpdbg"
261 make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
264 package_php7-dblib() {
265 pkgdesc='dblib module for PHP'
266 depends=('php7' 'freetds')
268 install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php7/modules/pdo_dblib.so"
271 package_php7-enchant() {
272 pkgdesc='enchant module for PHP'
273 depends=('php7' 'enchant')
275 install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php7/modules/enchant.so"
279 pkgdesc='gd module for PHP'
280 depends=('php7' 'gd')
282 install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php7/modules/gd.so"
285 package_php7-imap() {
286 pkgdesc='imap module for PHP'
287 depends=('php7' 'c-client' 'libxcrypt')
289 install -D -m755 "${srcdir}/build/modules/imap.so" "${pkgdir}/usr/lib/php7/modules/imap.so"
292 package_php7-intl() {
293 pkgdesc='intl module for PHP'
294 depends=('php7' 'icu')
296 install -D -m755 "${srcdir}/build/modules/intl.so" "${pkgdir}/usr/lib/php7/modules/intl.so"
299 package_php7-sodium() {
300 pkgdesc='sodium module for PHP'
301 depends=('php7' 'libsodium')
304 install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php7/modules/sodium.so"
307 package_php7-odbc() {
308 pkgdesc='ODBC modules for PHP'
309 depends=('php7' 'unixodbc')
311 install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php7/modules/odbc.so"
312 install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php7/modules/pdo_odbc.so"
315 package_php7-pgsql() {
316 pkgdesc='PostgreSQL modules for PHP'
317 depends=('php7' 'postgresql-libs')
319 install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php7/modules/pgsql.so"
320 install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php7/modules/pdo_pgsql.so"
323 package_php7-pspell() {
324 pkgdesc='pspell module for PHP'
325 depends=('php7' 'aspell')
327 install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php7/modules/pspell.so"
330 package_php7-snmp() {
331 pkgdesc='snmp module for PHP'
332 depends=('php7' 'net-snmp')
334 install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php7/modules/snmp.so"
337 package_php7-sqlite() {
338 pkgdesc='sqlite module for PHP'
339 depends=('php7' 'sqlite')
341 install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php7/modules/sqlite3.so"
342 install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php7/modules/pdo_sqlite.so"
345 package_php7-tidy() {
346 pkgdesc='tidy module for PHP'
347 depends=('php7' 'tidy')
349 install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php7/modules/tidy.so"
353 pkgdesc='xsl module for PHP'
354 depends=('php7' 'libxslt')
356 install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php7/modules/xsl.so"