upgpkg: ocaml-integers 0.5.0-1
[arch-packages.git] / php / repos / extra-x86_64 / PKGBUILD
blob5abc75e00320f9e4bf9f9b73f8f2997c3dee9c61
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.0.13
24 pkgrel=2
25 arch=('x86_64')
26 license=('PHP')
27 url='https://www.php.net/'
28 makedepends=('apache' 'aspell' 'c-client' 'db' '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 source=("https://php.net/distributions/${pkgbase}-${pkgver}.tar.xz"{,.asc}
33         'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch')
34 sha256sums=('cd976805ec2e9198417651027dfe16854ba2c2c388151ab9d4d268513d52ed52'
35             'SKIP'
36             '702b163c66c65af92dcad8d79f41bda84bcd5d863235fcf1497c33a86db9e4ca'
37             '4a2add00d93fa991ccdf6356090264c1059c79935642afff6e8d4a2107fa037e'
38             '2228131cc65139bd819b617bba06c2406e559c55fbfb38a29f9853ce48c58eeb'
39             '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
40             'b538a7c974adde626c35481e4a66d506dc12c598f369dfe79f3fcb9585d8b920')
41 validpgpkeys=('1729F83938DA44E27BA0F4D3DBDB397470D12172'
42               'BFDDD28642824F8118EF77909B67A5C12229118F')
44 prepare() {
45         cd "${srcdir}/${pkgbase}-${pkgver}"
47         patch -p0 -i "${srcdir}/apache.patch"
48         patch -p0 -i "${srcdir}/php-fpm.patch"
49         patch -p0 -i "${srcdir}/php.ini.patch"
50         autoconf
52         # Disable failing tests
53         rm tests/output/stream_isatty_*.phpt
54         rm Zend/tests/arginfo_zpp_mismatch*.phpt
57 build() {
58         local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
59                 --config-cache \
60                 --prefix=/usr \
61                 --sbindir=/usr/bin \
62                 --sysconfdir=/etc/php \
63                 --localstatedir=/var \
64                 --with-layout=GNU \
65                 --with-config-file-path=/etc/php \
66                 --with-config-file-scan-dir=/etc/php/conf.d \
67                 --disable-rpath \
68                 --mandir=/usr/share/man \
69                 "
71         local _phpextensions="\
72                 --enable-bcmath=shared \
73                 --enable-calendar=shared \
74                 --enable-dba=shared \
75                 --enable-exif=shared \
76                 --enable-ftp=shared \
77                 --enable-gd=shared \
78                 --enable-intl=shared \
79                 --enable-mbstring \
80                 --enable-pcntl \
81                 --enable-shmop=shared \
82                 --enable-soap=shared \
83                 --enable-sockets=shared \
84                 --enable-sysvmsg=shared \
85                 --enable-sysvsem=shared \
86                 --enable-sysvshm=shared \
87                 --with-bz2=shared \
88                 --with-curl=shared \
89                 --with-db4=/usr \
90                 --with-enchant=shared \
91                 --with-external-gd \
92                 --with-external-pcre \
93                 --with-ffi=shared \
94                 --with-gdbm \
95                 --with-gettext=shared \
96                 --with-gmp=shared \
97                 --with-iconv=shared \
98                 --with-imap-ssl \
99                 --with-imap=shared \
100                 --with-kerberos \
101                 --with-ldap=shared \
102                 --with-ldap-sasl \
103                 --with-mhash \
104                 --with-mysql-sock=/run/mysqld/mysqld.sock \
105                 --with-mysqli=shared,mysqlnd \
106                 --with-openssl \
107                 --with-password-argon2 \
108                 --with-pdo-dblib=shared,/usr \
109                 --with-pdo-mysql=shared,mysqlnd \
110                 --with-pdo-odbc=shared,unixODBC,/usr \
111                 --with-pdo-pgsql=shared \
112                 --with-pdo-sqlite=shared \
113                 --with-pgsql=shared \
114                 --with-pspell=shared \
115                 --with-readline \
116                 --with-snmp=shared \
117                 --with-sodium=shared \
118                 --with-sqlite3=shared \
119                 --with-tidy=shared \
120                 --with-unixODBC=shared \
121                 --with-xsl=shared \
122                 --with-zip=shared \
123                 --with-zlib \
124                 "
126         EXTENSION_DIR=/usr/lib/php/modules
127         export EXTENSION_DIR
129         mkdir "${srcdir}/build"
130         cd "${srcdir}/build"
131         ln -s "../${pkgbase}-${pkgver}/configure"
132         ./configure ${_phpconfig} \
133                 --enable-cgi \
134                 --enable-fpm \
135                 --with-fpm-systemd \
136                 --with-fpm-acl \
137                 --with-fpm-user=http \
138                 --with-fpm-group=http \
139                 --enable-embed=shared \
140                 ${_phpextensions}
141         make
143         # apache
144         # reuse the previous run; this will save us a lot of time
145         cp -a "${srcdir}/build" "${srcdir}/build-apache"
146         cd "${srcdir}/build-apache"
147         ./configure ${_phpconfig} \
148                 --with-apxs2 \
149                 ${_phpextensions}
150         make
152         # phpdbg
153         cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
154         cd "${srcdir}/build-phpdbg"
155         ./configure ${_phpconfig} \
156                 --enable-phpdbg \
157                 ${_phpextensions}
158         make
161 check() {
162         cd "${srcdir}/build"
164         # Check if sendmail was configured correctly (FS#47600)
165         sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
167         export REPORT_EXIT_STATUS=1
168         export NO_INTERACTION=1
169         export SKIP_ONLINE_TESTS=1
170         export SKIP_SLOW_TESTS=1
171         export TEST_PHP_ARGS="-j$(nproc)"
172         export TESTS='tests Zend'
174         make test
177 package_php() {
178         pkgdesc='A general-purpose scripting language that is especially suited to web development'
179         depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma')
180         replaces=('php-ldap')
181         conflicts=('php-ldap')
182         provides=("php-ldap=${pkgver}")
183         backup=('etc/php/php.ini')
185         cd "${srcdir}/build"
186         make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
187         install -D -m644 "${srcdir}/${pkgbase}-${pkgver}/php.ini-production" "${pkgdir}/etc/php/php.ini"
188         install -d -m755 "${pkgdir}/etc/php/conf.d/"
190         # remove static modules
191         rm -f "${pkgdir}/usr/lib/php/modules/"*.a
192         # remove modules provided by sub packages
193         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
194         # remove empty directory
195         rmdir "${pkgdir}/usr/include/php/include"
198 package_php-cgi() {
199         pkgdesc='CGI and FCGI SAPI for PHP'
200         depends=('php')
202         cd "${srcdir}/build"
203         make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
206 package_php-apache() {
207         pkgdesc='Apache SAPI for PHP'
208         depends=('php' 'apache' 'libnsl')
209         backup=('etc/httpd/conf/extra/php_module.conf')
211         install -D -m755 "${srcdir}/build-apache/libs/libphp.so" "${pkgdir}/usr/lib/httpd/modules/libphp.so"
212         install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php_module.conf"
215 package_php-fpm() {
216         pkgdesc='FastCGI Process Manager for PHP'
217         depends=('php' 'systemd')
218         backup=('etc/php/php-fpm.conf' 'etc/php/php-fpm.d/www.conf')
219         options=('!emptydirs')
221         cd "${srcdir}/build"
222         make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
223         install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm.service"
224         install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf"
227 package_php-embed() {
228         pkgdesc='Embedded PHP SAPI library'
229         depends=('php' 'systemd-libs' 'libnsl' 'libxcrypt')
230         options=('!emptydirs')
232         cd "${srcdir}/build"
233         make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
236 package_php-phpdbg() {
237         pkgdesc='Interactive PHP debugger'
238         depends=('php')
239         options=('!emptydirs')
241         cd "${srcdir}/build-phpdbg"
242         make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
245 package_php-dblib() {
246         pkgdesc='dblib module for PHP'
247         depends=('php' 'freetds')
249         install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php/modules/pdo_dblib.so"
252 package_php-enchant() {
253         pkgdesc='enchant module for PHP'
254         depends=('php' 'enchant')
256         install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php/modules/enchant.so"
259 package_php-gd() {
260         pkgdesc='gd module for PHP'
261         depends=('php' 'gd')
263         install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php/modules/gd.so"
266 package_php-imap() {
267         pkgdesc='imap module for PHP'
268         depends=('php' 'c-client' 'libxcrypt')
270         install -D -m755 "${srcdir}/build/modules/imap.so" "${pkgdir}/usr/lib/php/modules/imap.so"
273 package_php-intl() {
274         pkgdesc='intl module for PHP'
275         depends=('php' 'icu')
277         install -D -m755 "${srcdir}/build/modules/intl.so" "${pkgdir}/usr/lib/php/modules/intl.so"
280 package_php-sodium() {
281         pkgdesc='sodium module for PHP'
282         depends=('php' 'libsodium')
284         install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php/modules/sodium.so"
287 package_php-odbc() {
288         pkgdesc='ODBC modules for PHP'
289         depends=('php' 'unixodbc')
291         install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php/modules/odbc.so"
292         install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php/modules/pdo_odbc.so"
295 package_php-pgsql() {
296         pkgdesc='PostgreSQL modules for PHP'
297         depends=('php' 'postgresql-libs')
299         install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php/modules/pgsql.so"
300         install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php/modules/pdo_pgsql.so"
303 package_php-pspell() {
304         pkgdesc='pspell module for PHP'
305         depends=('php' 'aspell')
307         install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php/modules/pspell.so"
310 package_php-snmp() {
311         pkgdesc='snmp module for PHP'
312         depends=('php' 'net-snmp')
314         install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php/modules/snmp.so"
317 package_php-sqlite() {
318         pkgdesc='sqlite module for PHP'
319         depends=('php' 'sqlite')
321         install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php/modules/sqlite3.so"
322         install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php/modules/pdo_sqlite.so"
325 package_php-tidy() {
326         pkgdesc='tidy module for PHP'
327         depends=('php' 'tidy')
329         install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php/modules/tidy.so"
332 package_php-xsl() {
333         pkgdesc='xsl module for PHP'
334         depends=('php' 'libxslt')
336         install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php/modules/xsl.so"