sbcl rebuild
[arch-packages.git] / php / trunk / PKGBUILD
blobdb3fa0669ec3ca644bf50cfdc1ad7b3134911e25
1 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
3 pkgbase=php
4 pkgname=('php'
5          'php-cgi'
6          'php-apache'
7          'php-fpm'
8          'php-embed'
9          'php-phpdbg'
10          'php-dblib'
11          'php-enchant'
12          'php-gd'
13          'php-imap'
14          'php-intl'
15          'php-sodium'
16          'php-odbc'
17          'php-pgsql'
18          'php-pspell'
19          'php-snmp'
20          'php-sqlite'
21          'php-tidy'
22          'php-xsl')
23 pkgver=8.1.10
24 pkgrel=1
25 arch=('x86_64')
26 license=('PHP')
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'
30              'oniguruma')
31 checkdepends=('procps-ng')
32 options=(debug)
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'
36             'SKIP'
37             '702b163c66c65af92dcad8d79f41bda84bcd5d863235fcf1497c33a86db9e4ca'
38             '4a2add00d93fa991ccdf6356090264c1059c79935642afff6e8d4a2107fa037e'
39             'aa55fa4fc5c2b2493065bbd00cfe3c97a1b22b3dc7d34f8fd303de18cafe844f'
40             '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
41             'b3b3385f1c36e272671c7db238b2a69896e11a82db90dafd74964f2eabbfa2f2')
42 validpgpkeys=('F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD'
43               '39B641343D8C104B2B146DC3F9C39DC0B9698544')
44 _interpreter=${pkgver%.*}
46 prepare() {
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"
52         autoconf
54         # Disable failing tests
55         rm tests/output/stream_isatty_*.phpt
56         rm Zend/tests/arginfo_zpp_mismatch*.phpt
59 build() {
60         local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
61                 --config-cache \
62                 --prefix=/usr \
63                 --sbindir=/usr/bin \
64                 --sysconfdir=/etc/php \
65                 --localstatedir=/var \
66                 --with-layout=GNU \
67                 --with-config-file-path=/etc/php \
68                 --with-config-file-scan-dir=/etc/php/conf.d \
69                 --disable-rpath \
70                 --mandir=/usr/share/man \
71                 --disable-gcc-global-regs \
72                 "
74         local _phpextensions="\
75                 --enable-bcmath=shared \
76                 --enable-calendar=shared \
77                 --enable-dba=shared \
78                 --enable-exif=shared \
79                 --enable-ftp=shared \
80                 --enable-gd=shared \
81                 --enable-intl=shared \
82                 --enable-mbstring \
83                 --enable-pcntl \
84                 --enable-shmop=shared \
85                 --enable-soap=shared \
86                 --enable-sockets=shared \
87                 --enable-sysvmsg=shared \
88                 --enable-sysvsem=shared \
89                 --enable-sysvshm=shared \
90                 --with-bz2=shared \
91                 --with-curl=shared \
92                 --with-db4=/usr \
93                 --with-enchant=shared \
94                 --with-external-gd \
95                 --with-external-pcre \
96                 --with-ffi=shared \
97                 --with-gdbm \
98                 --with-gettext=shared \
99                 --with-gmp=shared \
100                 --with-iconv=shared \
101                 --with-imap-ssl \
102                 --with-imap=shared \
103                 --with-kerberos \
104                 --with-ldap=shared \
105                 --with-ldap-sasl \
106                 --with-mhash \
107                 --with-mysql-sock=/run/mysqld/mysqld.sock \
108                 --with-mysqli=shared,mysqlnd \
109                 --with-openssl \
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 \
118                 --with-readline \
119                 --with-snmp=shared \
120                 --with-sodium=shared \
121                 --with-sqlite3=shared \
122                 --with-tidy=shared \
123                 --with-unixODBC=shared \
124                 --with-xsl=shared \
125                 --with-zip=shared \
126                 --with-zlib \
127                 "
129         EXTENSION_DIR=/usr/lib/php/modules
130         export EXTENSION_DIR
132         mkdir "${srcdir}/build"
133         cd "${srcdir}/build"
134         ln -s "../${pkgbase}-${pkgver}/configure"
135         ./configure ${_phpconfig} \
136                 --enable-cgi \
137                 --enable-fpm \
138                 --with-fpm-systemd \
139                 --with-fpm-acl \
140                 --with-fpm-user=http \
141                 --with-fpm-group=http \
142                 --enable-embed=shared \
143                 ${_phpextensions}
144         make
146         # apache
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} \
151                 --with-apxs2 \
152                 ${_phpextensions}
153         make
155         # phpdbg
156         cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
157         cd "${srcdir}/build-phpdbg"
158         ./configure ${_phpconfig} \
159                 --enable-phpdbg \
160                 ${_phpextensions}
161         make
164 check() {
165         cd "${srcdir}/build"
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'
177         make test
180 package_php() {
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')
188         cd "${srcdir}/build"
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"
201 package_php-cgi() {
202         pkgdesc='CGI and FCGI SAPI for PHP'
203         depends=('php')
205         cd "${srcdir}/build"
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"
218 package_php-fpm() {
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')
224         cd "${srcdir}/build"
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')
235         cd "${srcdir}/build"
236         make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
239 package_php-phpdbg() {
240         pkgdesc='Interactive PHP debugger'
241         depends=('php')
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"
262 package_php-gd() {
263         pkgdesc='gd module for PHP'
264         depends=('php' 'gd')
266         install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php/modules/gd.so"
269 package_php-imap() {
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"
276 package_php-intl() {
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"
290 package_php-odbc() {
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"
313 package_php-snmp() {
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"
328 package_php-tidy() {
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"
335 package_php-xsl() {
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"