1 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
27 url='https://www.php.net/'
28 makedepends=('apache' 'aspell' 'c-client' 'db' 'gdbm' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
29 'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl'
31 checkdepends=('procps-ng')
33 source=("https://php.net/distributions/${pkgbase}-${pkgver}.tar.xz"{,.asc}
34 'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch')
35 sha256sums=('90e7120c77ee83630e6ac928d23bc6396603d62d83a3cf5df8a450d2e3070162'
37 '702b163c66c65af92dcad8d79f41bda84bcd5d863235fcf1497c33a86db9e4ca'
38 '4a2add00d93fa991ccdf6356090264c1059c79935642afff6e8d4a2107fa037e'
39 'aa55fa4fc5c2b2493065bbd00cfe3c97a1b22b3dc7d34f8fd303de18cafe844f'
40 '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
41 'b3b3385f1c36e272671c7db238b2a69896e11a82db90dafd74964f2eabbfa2f2')
42 validpgpkeys=('F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD'
43 '39B641343D8C104B2B146DC3F9C39DC0B9698544')
44 _interpreter=${pkgver%.*}
47 cd "${srcdir}/${pkgbase}-${pkgver}"
49 patch -p0 -i "${srcdir}/apache.patch"
50 patch -p0 -i "${srcdir}/php-fpm.patch"
51 patch -p0 -i "${srcdir}/php.ini.patch"
54 # Disable failing tests
55 rm tests/output/stream_isatty_*.phpt
56 rm Zend/tests/arginfo_zpp_mismatch*.phpt
60 local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
64 --sysconfdir=/etc/php \
65 --localstatedir=/var \
67 --with-config-file-path=/etc/php \
68 --with-config-file-scan-dir=/etc/php/conf.d \
70 --mandir=/usr/share/man \
71 --disable-gcc-global-regs \
74 local _phpextensions="\
75 --enable-bcmath=shared \
76 --enable-calendar=shared \
78 --enable-exif=shared \
81 --enable-intl=shared \
84 --enable-shmop=shared \
85 --enable-soap=shared \
86 --enable-sockets=shared \
87 --enable-sysvmsg=shared \
88 --enable-sysvsem=shared \
89 --enable-sysvshm=shared \
93 --with-enchant=shared \
95 --with-external-pcre \
98 --with-gettext=shared \
100 --with-iconv=shared \
107 --with-mysql-sock=/run/mysqld/mysqld.sock \
108 --with-mysqli=shared,mysqlnd \
110 --with-password-argon2 \
111 --with-pdo-dblib=shared,/usr \
112 --with-pdo-mysql=shared,mysqlnd \
113 --with-pdo-odbc=shared,unixODBC,/usr \
114 --with-pdo-pgsql=shared \
115 --with-pdo-sqlite=shared \
116 --with-pgsql=shared \
117 --with-pspell=shared \
120 --with-sodium=shared \
121 --with-sqlite3=shared \
123 --with-unixODBC=shared \
129 EXTENSION_DIR=/usr/lib/php/modules
132 mkdir "${srcdir}/build"
134 ln -s "../${pkgbase}-${pkgver}/configure"
135 ./configure ${_phpconfig} \
140 --with-fpm-user=http \
141 --with-fpm-group=http \
142 --enable-embed=shared \
147 # reuse the previous run; this will save us a lot of time
148 cp -a "${srcdir}/build" "${srcdir}/build-apache"
149 cd "${srcdir}/build-apache"
150 ./configure ${_phpconfig} \
156 cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
157 cd "${srcdir}/build-phpdbg"
158 ./configure ${_phpconfig} \
167 # Check if sendmail was configured correctly (FS#47600)
168 sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
170 export REPORT_EXIT_STATUS=1
171 export NO_INTERACTION=1
172 export SKIP_ONLINE_TESTS=1
173 export SKIP_SLOW_TESTS=1
174 export TEST_PHP_ARGS="-j$(nproc)"
175 export TESTS='tests Zend'
181 pkgdesc='A general-purpose scripting language that is especially suited to web development'
182 depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma' 'db' 'gdbm')
183 replaces=('php-ldap')
184 conflicts=('php-ldap')
185 provides=("php-interpreter=$_interpreter" "php-ldap=${pkgver}")
186 backup=('etc/php/php.ini')
189 make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
190 install -D -m644 "${srcdir}/${pkgbase}-${pkgver}/php.ini-production" "${pkgdir}/etc/php/php.ini"
191 install -d -m755 "${pkgdir}/etc/php/conf.d/"
193 # remove static modules
194 rm -f "${pkgdir}/usr/lib/php/modules/"*.a
195 # remove modules provided by sub packages
196 rm -f "${pkgdir}/usr/lib/php/modules/"{enchant,gd,imap,intl,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
197 # remove empty directory
198 rmdir "${pkgdir}/usr/include/php/include"
202 pkgdesc='CGI and FCGI SAPI for PHP'
206 make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
209 package_php-apache() {
210 pkgdesc='Apache SAPI for PHP'
211 depends=('php' 'apache' 'libnsl')
212 backup=('etc/httpd/conf/extra/php_module.conf')
214 install -D -m755 "${srcdir}/build-apache/libs/libphp.so" "${pkgdir}/usr/lib/httpd/modules/libphp.so"
215 install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php_module.conf"
219 pkgdesc='FastCGI Process Manager for PHP'
220 depends=('php' 'systemd')
221 backup=('etc/php/php-fpm.conf' 'etc/php/php-fpm.d/www.conf')
222 options=('!emptydirs')
225 make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
226 install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm.service"
227 install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf"
230 package_php-embed() {
231 pkgdesc='Embedded PHP SAPI library'
232 depends=('php' 'systemd-libs' 'libnsl' 'libxcrypt')
233 options=('!emptydirs')
236 make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
239 package_php-phpdbg() {
240 pkgdesc='Interactive PHP debugger'
242 options=('!emptydirs')
244 cd "${srcdir}/build-phpdbg"
245 make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
248 package_php-dblib() {
249 pkgdesc='dblib module for PHP'
250 depends=('php' 'freetds')
252 install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php/modules/pdo_dblib.so"
255 package_php-enchant() {
256 pkgdesc='enchant module for PHP'
257 depends=('php' 'enchant')
259 install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php/modules/enchant.so"
263 pkgdesc='gd module for PHP'
266 install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php/modules/gd.so"
270 pkgdesc='imap module for PHP'
271 depends=('php' 'c-client' 'libxcrypt')
273 install -D -m755 "${srcdir}/build/modules/imap.so" "${pkgdir}/usr/lib/php/modules/imap.so"
277 pkgdesc='intl module for PHP'
278 depends=('php' 'icu')
280 install -D -m755 "${srcdir}/build/modules/intl.so" "${pkgdir}/usr/lib/php/modules/intl.so"
283 package_php-sodium() {
284 pkgdesc='sodium module for PHP'
285 depends=('php' 'libsodium')
287 install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php/modules/sodium.so"
291 pkgdesc='ODBC modules for PHP'
292 depends=('php' 'unixodbc')
294 install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php/modules/odbc.so"
295 install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php/modules/pdo_odbc.so"
298 package_php-pgsql() {
299 pkgdesc='PostgreSQL modules for PHP'
300 depends=('php' 'postgresql-libs')
302 install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php/modules/pgsql.so"
303 install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php/modules/pdo_pgsql.so"
306 package_php-pspell() {
307 pkgdesc='pspell module for PHP'
308 depends=('php' 'aspell')
310 install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php/modules/pspell.so"
314 pkgdesc='snmp module for PHP'
315 depends=('php' 'net-snmp')
317 install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php/modules/snmp.so"
320 package_php-sqlite() {
321 pkgdesc='sqlite module for PHP'
322 depends=('php' 'sqlite')
324 install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php/modules/sqlite3.so"
325 install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php/modules/pdo_sqlite.so"
329 pkgdesc='tidy module for PHP'
330 depends=('php' 'tidy')
332 install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php/modules/tidy.so"
336 pkgdesc='xsl module for PHP'
337 depends=('php' 'libxslt')
339 install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php/modules/xsl.so"