# Maintainer: Pierre Schmitz orig_pkg=php pkgname='php-32bits-fixes' pkgver=7.3.5 pkgrel=1 arch=('x86_64' 'armv7h') license=('PHP') url='https://secure.php.net/' makedepends=('apache' 'aspell' 'c-client' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp' 'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl') checkdepends=('procps-ng') replaces=('php' 'php-ldap') conflicts=('php' 'php-ldap') provides=("php=${pkgver}" "php-ldap=${pkgver}") pkgdesc='A general-purpose scripting language that is especially suited to web development, patched version to not error on large files on 32 bits.' source=("https://php.net/distributions/${orig_pkg}-${pkgver}.tar.xz"{,.asc} 'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch' 'enchant-2.patch' 'freetype.patch') sha256sums=('e1011838a46fd4a195c8453b333916622d7ff5bce4aca2d9d99afac142db2472' 'SKIP' '62e5ceea3c90a3c6eab1166488f876e766efcfd7d4e973c44060a9e72d51a98a' 'ebc0af1ef3a6baccb013d0ccb29923895a7b22ff2d032e3bba802dc6328301ce' '3de3c76930874c81824c23aa033cb9e66631659fd31f925d7c58f0479aeb18a9' '640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5' 'ba63ff727d911882726e4e5e513249d29e9ccc842ebee10a07b160b4718ba20d' '3992491eebaf5b31f6b00095a7276d11682f9a8aaff473bfb25afbdcfa6eba32' '07c4648669dc05afc3c1ad5a4739768079c423b817eabf5296ca3d1ea5ffd163') validpgpkeys=('CBAF69F173A0FEA4B537F470D66C9593118BCCB6' 'F38252826ACD957EF380D39F2F7956BC5DA04B5D') prepare() { cd ${srcdir}/${orig_pkg}-${pkgver} patch -p0 -i ${srcdir}/apache.patch patch -p0 -i ${srcdir}/php-fpm.patch patch -p0 -i ${srcdir}/php.ini.patch patch -p1 -i ${srcdir}/enchant-2.patch patch -p1 -i ${srcdir}/freetype.patch autoconf rm tests/output/stream_isatty_*.phpt } build() { # http://site.icu-project.org/download/61#TOC-Migration-Issues CPPFLAGS+=' -DU_USING_ICU_NAMESPACE=1' CFLAGS+=' -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE ' local _phpconfig="--srcdir=../${orig_pkg}-${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 \ --without-pear \ " local _phpextensions="\ --enable-bcmath=shared \ --enable-calendar=shared \ --enable-dba=shared \ --enable-exif=shared \ --enable-ftp=shared \ --enable-intl=shared \ --enable-mbstring \ --enable-shmop=shared \ --enable-soap=shared \ --enable-sockets=shared \ --enable-sysvmsg=shared \ --enable-sysvsem=shared \ --enable-sysvshm=shared \ --enable-zip=shared \ --with-bz2=shared \ --with-curl=shared \ --with-db4=/usr \ --with-enchant=shared,/usr \ --with-freetype-dir=/usr \ --with-gd=shared,/usr \ --with-gdbm \ --with-gettext=shared \ --with-gmp=shared \ --with-iconv=shared \ --with-imap-ssl \ --with-imap=shared \ --with-kerberos=/usr \ --with-ldap=shared \ --with-ldap-sasl \ --with-libzip \ --with-mhash \ --with-mysql-sock=/run/mysqld/mysqld.sock \ --with-mysqli=shared,mysqlnd \ --with-openssl \ --with-password-argon2 \ --with-pcre-regex=/usr \ --with-pdo-dblib=shared,/usr \ --with-pdo-mysql=shared,mysqlnd \ --with-pdo-odbc=shared,unixODBC,/usr \ --with-pdo-pgsql=shared \ --with-pdo-sqlite=shared,/usr \ --with-pgsql=shared \ --with-pspell=shared \ --with-readline \ --with-snmp=shared \ --with-sodium=shared \ --with-sqlite3=shared,/usr \ --with-tidy=shared \ --with-unixODBC=shared,/usr \ --with-xmlrpc=shared \ --with-xsl=shared \ --with-zlib \ --enable-pcntl \ " EXTENSION_DIR=/usr/lib/php/modules export EXTENSION_DIR mkdir ${srcdir}/build cd ${srcdir}/build ln -s ../${orig_pkg}-${pkgver}/configure ./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 cp -a ${srcdir}/build ${srcdir}/build-apache cd ${srcdir}/build-apache ./configure ${_phpconfig} \ --with-apxs2 \ ${_phpextensions} make # phpdbg cp -a ${srcdir}/build ${srcdir}/build-phpdbg cd ${srcdir}/build-phpdbg ./configure ${_phpconfig} \ --enable-phpdbg \ ${_phpextensions} make } check() { cd ${srcdir}/${orig_pkg}-${pkgver} # Check if sendmail was configured correctly (FS#47600) ${srcdir}/build/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 ${srcdir}/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend} } package() { backup=('etc/php/php.ini') cd ${srcdir}/build make -j1 INSTALL_ROOT=${pkgdir} install-{modules,cli,build,headers,programs,pharcmd} install -D -m644 ${srcdir}/${orig_pkg}-${pkgver}/php.ini-production ${pkgdir}/etc/php/php.ini install -d -m755 ${pkgdir}/etc/php/conf.d/ # remove static modules rm -f ${pkgdir}/usr/lib/php/modules/*.a # remove modules provided by sub packages 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 # remove empty directory rmdir ${pkgdir}/usr/include/php/include }