PKGBUILDs/extra/php/PKGBUILD

342 lines
9.9 KiB
Bash
Raw Normal View History

2020-08-08 18:44:19 +00:00
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to CPPFLAGS
pkgbase=php
pkgname=('php'
'php-cgi'
'php-apache'
'php-fpm'
'php-embed'
'php-phpdbg'
'php-dblib'
'php-enchant'
'php-gd'
'php-sodium'
'php-odbc'
'php-pgsql'
'php-pspell'
'php-snmp'
'php-sqlite'
'php-tidy'
'php-xsl')
2024-02-17 00:41:57 +00:00
pkgver=8.3.3
2024-01-17 15:38:49 +00:00
pkgrel=1
2020-08-08 18:44:19 +00:00
arch=('x86_64')
license=('PHP')
url='https://www.php.net/'
2023-01-14 02:56:19 +00:00
makedepends=('apache' 'aspell' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2'
2020-08-08 18:44:19 +00:00
'oniguruma')
checkdepends=('procps-ng')
source=("https://php.net/distributions/${pkgbase}-${pkgver}.tar.xz"{,.asc}
2023-12-21 16:30:27 +00:00
'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch')
2024-02-17 00:41:57 +00:00
sha256sums=('b0a996276fe21fe9ca8f993314c8bc02750f464c7b0343f056fb0894a8dfa9d1'
2020-08-08 18:44:19 +00:00
'SKIP'
2021-01-29 01:12:46 +00:00
'702b163c66c65af92dcad8d79f41bda84bcd5d863235fcf1497c33a86db9e4ca'
'4a2add00d93fa991ccdf6356090264c1059c79935642afff6e8d4a2107fa037e'
2023-02-01 12:48:10 +00:00
'78b8074461cdfc5d4e0ba428a8387f308d60720c8ad35c6176801e5088f02090'
2021-01-29 01:12:46 +00:00
'640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
2024-01-13 01:01:01 +00:00
'bf1de5ae6014f0593dacca2c046eb5a2d7c179733859854713b6813ebc629b08')
2023-01-14 02:56:19 +00:00
validpgpkeys=('1198C0117593497A5EC5C199286AF1F9897469DC'
2024-01-13 01:01:01 +00:00
'AFD8691FDAEDF03BDF6E460563F15A9B715376CA'
'C28D937575603EB4ABB725861C0779DC5C0A9DE4')
2022-05-15 19:50:08 +00:00
_interpreter=${pkgver%.*}
2020-08-08 18:44:19 +00:00
prepare() {
2021-01-29 01:12:46 +00:00
cd "${srcdir}/${pkgbase}-${pkgver}"
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
patch -p0 -i "${srcdir}/apache.patch"
patch -p0 -i "${srcdir}/php-fpm.patch"
patch -p0 -i "${srcdir}/php.ini.patch"
2020-08-08 18:44:19 +00:00
autoconf
2021-01-29 01:12:46 +00:00
# Disable failing tests
2020-08-08 18:44:19 +00:00
rm tests/output/stream_isatty_*.phpt
2021-01-29 01:12:46 +00:00
rm Zend/tests/arginfo_zpp_mismatch*.phpt
2020-08-08 18:44:19 +00:00
}
build() {
2021-01-29 01:12:46 +00:00
CPPFLAGS+=' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
2020-08-08 18:44:19 +00:00
local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
--config-cache \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc/php \
--localstatedir=/var \
--with-layout=GNU \
--with-config-file-path=/etc/php \
--with-config-file-scan-dir=/etc/php/conf.d \
--disable-rpath \
--mandir=/usr/share/man \
2022-01-21 17:33:04 +00:00
--disable-gcc-global-regs \
2020-08-08 18:44:19 +00:00
"
local _phpextensions="\
--enable-bcmath=shared \
--enable-calendar=shared \
--enable-dba=shared \
--enable-exif=shared \
--enable-ftp=shared \
--enable-gd=shared \
--enable-intl=shared \
--enable-mbstring \
--enable-pcntl \
--enable-shmop=shared \
--enable-soap=shared \
--enable-sockets=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--with-bz2=shared \
--with-curl=shared \
--with-enchant=shared \
--with-external-gd \
--with-external-pcre \
--with-ffi=shared \
--with-gdbm \
--with-gettext=shared \
--with-gmp=shared \
--with-iconv=shared \
--with-kerberos \
--with-ldap=shared \
--with-ldap-sasl \
--with-mhash \
--with-mysql-sock=/run/mysqld/mysqld.sock \
2023-01-14 02:56:19 +00:00
--with-mysqli=shared \
2020-08-08 18:44:19 +00:00
--with-openssl \
--with-password-argon2 \
--with-pdo-dblib=shared,/usr \
2023-01-14 02:56:19 +00:00
--with-pdo-mysql=shared \
2020-08-08 18:44:19 +00:00
--with-pdo-odbc=shared,unixODBC,/usr \
--with-pdo-pgsql=shared \
--with-pdo-sqlite=shared \
--with-pgsql=shared \
--with-pspell=shared \
--with-readline \
--with-snmp=shared \
--with-sodium=shared \
--with-sqlite3=shared \
--with-tidy=shared \
--with-unixODBC=shared \
--with-xsl=shared \
--with-zip=shared \
--with-zlib \
"
EXTENSION_DIR=/usr/lib/php/modules
export EXTENSION_DIR
2021-01-29 01:12:46 +00:00
mkdir "${srcdir}/build"
cd "${srcdir}/build"
ln -s "../${pkgbase}-${pkgver}/configure"
2020-08-08 18:44:19 +00:00
./configure ${_phpconfig} \
--enable-cgi \
--enable-fpm \
--with-fpm-systemd \
--with-fpm-acl \
--with-fpm-user=http \
--with-fpm-group=http \
--enable-embed=shared \
${_phpextensions}
make
# apache
# reuse the previous run; this will save us a lot of time
2021-01-29 01:12:46 +00:00
cp -a "${srcdir}/build" "${srcdir}/build-apache"
cd "${srcdir}/build-apache"
2020-08-08 18:44:19 +00:00
./configure ${_phpconfig} \
--with-apxs2 \
${_phpextensions}
make
# phpdbg
2021-01-29 01:12:46 +00:00
cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
cd "${srcdir}/build-phpdbg"
2020-08-08 18:44:19 +00:00
./configure ${_phpconfig} \
--enable-phpdbg \
${_phpextensions}
make
}
check() {
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build"
2020-08-08 18:44:19 +00:00
# Check if sendmail was configured correctly (FS#47600)
sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
export REPORT_EXIT_STATUS=1
export NO_INTERACTION=1
export SKIP_ONLINE_TESTS=1
export SKIP_SLOW_TESTS=1
export TEST_PHP_ARGS="-j$(nproc)"
export TESTS='tests Zend'
make test
}
package_php() {
pkgdesc='A general-purpose scripting language that is especially suited to web development'
2023-01-14 02:56:19 +00:00
depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma')
provides=("php-interpreter=${_interpreter}" "php-intl=${pkgver}")
replaces=('php-intl')
conflicts=('php-intl')
2020-08-08 18:44:19 +00:00
backup=('etc/php/php.ini')
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
install -D -m644 "${srcdir}/${pkgbase}-${pkgver}/php.ini-production" "${pkgdir}/etc/php/php.ini"
install -d -m755 "${pkgdir}/etc/php/conf.d/"
2020-08-08 18:44:19 +00:00
# remove static modules
2021-01-29 01:12:46 +00:00
rm -f "${pkgdir}/usr/lib/php/modules/"*.a
2020-08-08 18:44:19 +00:00
# remove modules provided by sub packages
2023-01-14 02:56:19 +00:00
rm -f "${pkgdir}/usr/lib/php/modules/"{enchant,gd,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
2020-08-08 18:44:19 +00:00
# remove empty directory
2021-01-29 01:12:46 +00:00
rmdir "${pkgdir}/usr/include/php/include"
2020-08-08 18:44:19 +00:00
}
package_php-cgi() {
pkgdesc='CGI and FCGI SAPI for PHP'
depends=('php')
2023-04-03 02:50:24 +00:00
provides=("php-cgi-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
2020-08-08 18:44:19 +00:00
}
package_php-apache() {
pkgdesc='Apache SAPI for PHP'
2023-01-14 02:56:19 +00:00
depends=('php' 'apache')
2021-01-29 01:12:46 +00:00
backup=('etc/httpd/conf/extra/php_module.conf')
2023-04-03 02:50:24 +00:00
provides=("php-apache-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build-apache/libs/libphp.so" "${pkgdir}/usr/lib/httpd/modules/libphp.so"
install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php_module.conf"
2020-08-08 18:44:19 +00:00
}
package_php-fpm() {
pkgdesc='FastCGI Process Manager for PHP'
depends=('php' 'systemd')
backup=('etc/php/php-fpm.conf' 'etc/php/php-fpm.d/www.conf')
2023-04-03 02:50:24 +00:00
provides=("php-fpm-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
options=('!emptydirs')
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm.service"
install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf"
2020-08-08 18:44:19 +00:00
}
package_php-embed() {
pkgdesc='Embedded PHP SAPI library'
2023-01-14 02:56:19 +00:00
depends=('php' 'systemd-libs')
2023-04-03 02:50:24 +00:00
provides=("php-embed-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
options=('!emptydirs')
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
2020-08-08 18:44:19 +00:00
}
package_php-phpdbg() {
pkgdesc='Interactive PHP debugger'
depends=('php')
2023-04-03 02:50:24 +00:00
provides=("php-phpdbg-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
options=('!emptydirs')
2021-01-29 01:12:46 +00:00
cd "${srcdir}/build-phpdbg"
make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
2020-08-08 18:44:19 +00:00
}
package_php-dblib() {
pkgdesc='dblib module for PHP'
depends=('php' 'freetds')
2023-04-03 02:50:24 +00:00
provides=("php-dblib-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php/modules/pdo_dblib.so"
2020-08-08 18:44:19 +00:00
}
package_php-enchant() {
pkgdesc='enchant module for PHP'
depends=('php' 'enchant')
2023-04-03 02:50:24 +00:00
provides=("php-enchant-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php/modules/enchant.so"
2020-08-08 18:44:19 +00:00
}
package_php-gd() {
pkgdesc='gd module for PHP'
depends=('php' 'gd')
2023-04-03 02:50:24 +00:00
provides=("php-gd-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php/modules/gd.so"
2020-08-08 18:44:19 +00:00
}
package_php-sodium() {
pkgdesc='sodium module for PHP'
depends=('php' 'libsodium')
2023-04-03 02:50:24 +00:00
provides=("php-sodium-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php/modules/sodium.so"
2020-08-08 18:44:19 +00:00
}
package_php-odbc() {
pkgdesc='ODBC modules for PHP'
depends=('php' 'unixodbc')
2023-04-03 02:50:24 +00:00
provides=("php-odbc-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php/modules/odbc.so"
install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php/modules/pdo_odbc.so"
2020-08-08 18:44:19 +00:00
}
package_php-pgsql() {
pkgdesc='PostgreSQL modules for PHP'
depends=('php' 'postgresql-libs')
2023-04-03 02:50:24 +00:00
provides=("php-pgsql-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php/modules/pgsql.so"
install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php/modules/pdo_pgsql.so"
2020-08-08 18:44:19 +00:00
}
package_php-pspell() {
pkgdesc='pspell module for PHP'
depends=('php' 'aspell')
2023-04-03 02:50:24 +00:00
provides=("php-pspell-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php/modules/pspell.so"
2020-08-08 18:44:19 +00:00
}
package_php-snmp() {
pkgdesc='snmp module for PHP'
depends=('php' 'net-snmp')
2023-04-03 02:50:24 +00:00
provides=("php-snmp-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php/modules/snmp.so"
2020-08-08 18:44:19 +00:00
}
package_php-sqlite() {
pkgdesc='sqlite module for PHP'
depends=('php' 'sqlite')
2023-04-03 02:50:24 +00:00
provides=("php-sqlite-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php/modules/sqlite3.so"
install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php/modules/pdo_sqlite.so"
2020-08-08 18:44:19 +00:00
}
package_php-tidy() {
pkgdesc='tidy module for PHP'
depends=('php' 'tidy')
2023-04-03 02:50:24 +00:00
provides=("php-tidy-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php/modules/tidy.so"
2020-08-08 18:44:19 +00:00
}
package_php-xsl() {
pkgdesc='xsl module for PHP'
depends=('php' 'libxslt')
2023-04-03 02:50:24 +00:00
provides=("php-xsl-interpreter=${_interpreter}")
2020-08-08 18:44:19 +00:00
2021-01-29 01:12:46 +00:00
install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php/modules/xsl.so"
2020-08-08 18:44:19 +00:00
}