mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-11 14:26:38 +02:00
698 lines
20 KiB
Text
698 lines
20 KiB
Text
# Contributor: Valery Kartel <valery.kartel@gmail.com>
|
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
|
|
|
|
# Bundled libraries
|
|
#
|
|
# Name | License | Location | State
|
|
# ----------+---------------------+------------------------+---------
|
|
# bcmath | LGPL-2.1-or-later | ext/bcmath/libbcmath | used
|
|
# date | MIT | ext/date/lib | used
|
|
# fileinfo | BSD-2-Clause | ext/fileinfo/libmagic | used
|
|
# gd | BSD | ext/gd/libgd | used
|
|
# hash | CC0-1.0 | ext/hash/sha3 | used
|
|
# xxHash | BSD-2-Clause | ext/hash/xxhash | used
|
|
# libmbfl | LGPL-2.1-only | ext/mbstring/libmbfl | used
|
|
# pcre | BSD-3-Clause | ext/pcre/pcrelib | not used
|
|
# sqlite3 | Public | ext/sqlite3/libsqlite | not used
|
|
# libzip | BSD-3-Clause | ext/zip/lib | not used
|
|
|
|
# Static extensions
|
|
#
|
|
# Name | Reason
|
|
# ----------+--------------------------------------------
|
|
# zlib | https://bugs.alpinelinux.org/issues/8299
|
|
# json | https://wiki.php.net/rfc/always_enable_json
|
|
|
|
pkgname=php81
|
|
_pkgreal=php
|
|
pkgver=8.1.32
|
|
pkgrel=1
|
|
_apiver=20210902
|
|
_suffix=${pkgname#php}
|
|
# Is this package the default (latest) PHP version?
|
|
_default_php="no"
|
|
provides="$pkgname-cli php-cli php" # for backward compatibility
|
|
# priority of community/php82 is 100
|
|
provider_priority=50
|
|
pkgdesc="The PHP$_suffix language runtime engine"
|
|
url="https://www.php.net/"
|
|
arch="all"
|
|
license="PHP-3.01 BSD-3-Clause LGPL-2.0-or-later MIT Zend-2.0"
|
|
depends="$pkgname-common"
|
|
depends_dev="$pkgname=$pkgver-r$pkgrel autoconf pcre2-dev re2c"
|
|
# Most dependencies between extensions is auto-discovered (see _extension()).
|
|
_depends_mysqlnd="$pkgname-openssl"
|
|
_depends_pdo_mysql="$pkgname-pdo $pkgname-mysqlnd"
|
|
_depends_phar="$pkgname"
|
|
# openssl is actually transitive dependency here, but we need to because of
|
|
# load index based on number of dependencies.
|
|
_depends_mysqli="$pkgname-mysqlnd $pkgname-openssl"
|
|
_clang_ver=19
|
|
makedepends="
|
|
$depends_dev
|
|
acl-dev
|
|
apache2
|
|
apache2-dev
|
|
argon2-dev
|
|
aspell-dev
|
|
bison
|
|
bzip2-dev
|
|
clang$_clang_ver
|
|
curl-dev
|
|
enchant2-dev
|
|
freetds-dev
|
|
freetype-dev
|
|
gdbm-dev
|
|
gettext-dev
|
|
gmp-dev
|
|
icu-dev
|
|
imap-dev
|
|
krb5-dev
|
|
libavif-dev
|
|
libedit-dev
|
|
libical-dev
|
|
libjpeg-turbo-dev
|
|
libpng-dev
|
|
libpq-dev
|
|
lmdb-dev
|
|
oniguruma-dev
|
|
libsodium-dev
|
|
libwebp-dev
|
|
libxml2-dev
|
|
libxpm-dev
|
|
libxslt-dev
|
|
libzip-dev
|
|
net-snmp-dev
|
|
openldap-dev
|
|
openssl-dev>3
|
|
patchelf
|
|
sqlite-dev
|
|
tidyhtml-dev
|
|
unixodbc-dev
|
|
zlib-dev
|
|
"
|
|
checkdepends="icu-data-full"
|
|
subpackages="$pkgname-dev $pkgname-doc
|
|
$pkgname-phpdbg $pkgname-apache2
|
|
$pkgname-embed $pkgname-cgi $pkgname-fpm
|
|
$pkgname-pear::noarch
|
|
"
|
|
# sources for RC available at
|
|
# - https://downloads.php.net/~patrickallaert/php-${pkgver}RC1.tar.xz
|
|
# - https://downloads.php.net/~ramsey/php-${pkgver}RC1.tar.xz
|
|
source="$_pkgreal-$pkgver.tar.xz::https://php.net/distributions/$_pkgreal-$pkgver.tar.xz
|
|
$pkgname-fpm.initd
|
|
$pkgname-fpm.logrotate
|
|
$pkgname-module.conf
|
|
disabled-tests.list
|
|
disabled-tests.ppc64le.list
|
|
disabled-tests.riscv64.list
|
|
disabled-tests.s390x.list
|
|
disabled-tests.x86.list
|
|
disabled-tests.loongarch64.list
|
|
install-pear.patch
|
|
includedir.patch
|
|
sharedir.patch
|
|
$pkgname-fpm-version-suffix.patch
|
|
fix-tests-devserver.patch
|
|
fix-lfs64.patch
|
|
fix-s390x-test.patch
|
|
fix-icu74.patch
|
|
loongarch64-support-for-fibers.patch
|
|
fix-pear.patch
|
|
ext-intl-level-up-c++-runtime-std-for-icu.patch
|
|
Adapt-ext-intl-tests-for-ICU-75.1-and-76.1.patch
|
|
"
|
|
builddir="$srcdir/$_pkgreal-$pkgver"
|
|
|
|
_libdir="/usr/lib/$pkgname"
|
|
_extension_dir="$_libdir/modules"
|
|
_extension_confd="/etc/$pkgname/conf.d"
|
|
|
|
_extensions="
|
|
bcmath
|
|
bz2
|
|
calendar
|
|
ctype
|
|
curl
|
|
dba
|
|
dom
|
|
enchant
|
|
exif
|
|
ffi
|
|
fileinfo
|
|
ftp
|
|
gd
|
|
gettext
|
|
gmp
|
|
iconv
|
|
imap
|
|
intl
|
|
ldap
|
|
mbstring
|
|
mysqli
|
|
mysqlnd
|
|
odbc
|
|
opcache
|
|
openssl
|
|
pcntl
|
|
pdo
|
|
pdo_dblib
|
|
pdo_mysql
|
|
pdo_odbc
|
|
pdo_pgsql
|
|
pdo_sqlite
|
|
pgsql
|
|
phar
|
|
posix
|
|
pspell
|
|
session
|
|
shmop
|
|
simplexml
|
|
snmp
|
|
soap
|
|
sodium
|
|
sockets
|
|
sqlite3
|
|
sysvmsg
|
|
sysvsem
|
|
sysvshm
|
|
tidy
|
|
tokenizer
|
|
xml
|
|
xmlreader
|
|
xmlwriter
|
|
xsl
|
|
zip
|
|
"
|
|
for _ext in $_extensions; do
|
|
case "$_ext" in
|
|
phar) subpackages="$subpackages $pkgname-$_ext:$_ext";;
|
|
*) subpackages="$subpackages $pkgname-$_ext:_extension";;
|
|
esac
|
|
done
|
|
subpackages="$subpackages $pkgname-common::noarch"
|
|
subpackages="$subpackages $pkgname-litespeed"
|
|
|
|
# secfixes:
|
|
# 8.1.32-r0:
|
|
# - CVE-2025-1217
|
|
# - CVE-2025-1219
|
|
# - CVE-2025-1734
|
|
# - CVE-2025-1736
|
|
# - CVE-2025-1861
|
|
# 8.1.31-r0:
|
|
# - CVE-2024-8929
|
|
# - CVE-2024-8932
|
|
# - CVE-2024-11233
|
|
# - CVE-2024-11234
|
|
# - CVE-2024-11236
|
|
# 8.1.30-r0:
|
|
# - CVE-2024-8925
|
|
# - CVE-2024-8926
|
|
# - CVE-2024-8927
|
|
# - CVE-2024-9026
|
|
# 8.1.29-r0:
|
|
# - CVE-2024-4577
|
|
# - CVE-2024-5458
|
|
# - CVE-2024-5585
|
|
# 8.1.28-r0:
|
|
# - CVE-2024-1874
|
|
# - CVE-2024-2756
|
|
# - CVE-2024-3096
|
|
# 8.1.16-r0:
|
|
# - CVE-2023-0567
|
|
# - CVE-2023-0568
|
|
# - CVE-2023-0662
|
|
# 8.1.14-r0:
|
|
# - CVE-2022-31631
|
|
# 8.1.12-r0:
|
|
# - CVE-2022-31630
|
|
# - CVE-2022-37454
|
|
# 8.1.11-r0:
|
|
# - CVE-2022-31628
|
|
# - CVE-2022-31629
|
|
# 8.1.6-r2:
|
|
# - CVE-2022-31625
|
|
# - CVE-2022-31626
|
|
# 8.1.0-r0:
|
|
# - CVE-2021-21707
|
|
# 8.1.0_rc5-r0:
|
|
# - CVE-2021-21703
|
|
# 8.1.0_rc3-r0:
|
|
# - CVE-2021-21706
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
local vapi=$(sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h)
|
|
if [ "$vapi" != "$_apiver" ]; then
|
|
error "Upstream API version is now $vapi. Expecting $_apiver"
|
|
error "After updating _apiver, all 3rd-party extensions must be rebuilt."
|
|
return 1
|
|
fi
|
|
|
|
# https://bugs.php.net/63362 - Not needed but installed headers.
|
|
# Drop some Windows specific headers to avoid installation,
|
|
# before build to ensure they are really not needed.
|
|
rm -f TSRM/tsrm_win32.h \
|
|
TSRM/tsrm_config.w32.h \
|
|
Zend/zend_config.w32.h \
|
|
ext/mysqlnd/config-win.h \
|
|
ext/standard/winver.h
|
|
|
|
# Fix some bogus permissions.
|
|
find . -name '*.[ch]' -exec chmod 644 {} \;
|
|
|
|
# Remove failing tests includng arch specific ones.
|
|
local tests="disabled-tests.list disabled-tests.$CARCH.list"
|
|
local file; for file in $tests; do [ -f "$srcdir"/$file ] && \
|
|
sed -n '/^[^#]/p' "$srcdir"/$file | while read -r item; do
|
|
rm -r $item # do it in this way to apply globbing...
|
|
done
|
|
done
|
|
|
|
autoconf
|
|
}
|
|
|
|
# Notes:
|
|
# * gd-jis-conv breaks any non-latin font rendering (vakartel).
|
|
# * libxml cannot be build as shared.
|
|
# * -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php andypost)
|
|
# * -O2 optimize for apps usage (andypost)
|
|
_build() {
|
|
local _extra='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
|
|
export CFLAGS="${CFLAGS/-Os/-O2} $_extra"
|
|
export CXXFLAGS="${CXXFLAGS/-Os/-O2} $_extra"
|
|
|
|
local without_pcre_jit
|
|
[ "$CARCH" = "s390x" ] && without_pcre_jit="--without-pcre-jit"
|
|
|
|
case "$CARCH" in
|
|
arm*|aarch64|riscv64|loongarch64)
|
|
export CFLAGS="${CFLAGS/-fstack-clash-protection}"
|
|
export CXXFLAGS="${CXXFLAGS/-fstack-clash-protection}"
|
|
;;
|
|
esac
|
|
|
|
export CC=clang-$_clang_ver
|
|
export CXX=clang++-$_clang_ver
|
|
EXTENSION_DIR=$_extension_dir ./configure \
|
|
--build=$CBUILD \
|
|
--host=$CHOST \
|
|
--prefix=/usr \
|
|
--program-suffix=$_suffix \
|
|
--libdir=$_libdir \
|
|
--datadir=/usr/share/$pkgname \
|
|
--sysconfdir=/etc/$pkgname \
|
|
--localstatedir=/var \
|
|
--with-layout=GNU \
|
|
--with-pic \
|
|
--with-config-file-path=/etc/$pkgname \
|
|
--with-config-file-scan-dir=$_extension_confd \
|
|
--disable-rpath \
|
|
--disable-short-tags \
|
|
\
|
|
--enable-bcmath=shared \
|
|
--with-bz2=shared \
|
|
--enable-calendar=shared \
|
|
--enable-ctype=shared \
|
|
--with-curl=shared \
|
|
--enable-dba=shared \
|
|
--with-dbmaker=shared \
|
|
--with-gdbm \
|
|
--with-lmdb \
|
|
--enable-dom=shared \
|
|
--with-enchant=shared \
|
|
--enable-exif=shared \
|
|
--with-ffi=shared \
|
|
--enable-fileinfo=shared \
|
|
--enable-ftp=shared \
|
|
--enable-gd=shared \
|
|
--with-avif \
|
|
--with-freetype \
|
|
--with-jpeg \
|
|
--with-webp \
|
|
--with-xpm \
|
|
--disable-gd-jis-conv \
|
|
--with-gettext=shared \
|
|
--with-gmp=shared \
|
|
--with-iconv=shared \
|
|
--with-imap=shared \
|
|
--with-imap-ssl \
|
|
--enable-intl=shared \
|
|
--with-ldap=shared \
|
|
--with-ldap-sasl \
|
|
--with-libedit \
|
|
--with-libxml \
|
|
--enable-mbstring=shared \
|
|
--with-mysqli=shared,mysqlnd \
|
|
--with-mysql-sock=/run/mysqld/mysqld.sock \
|
|
--enable-mysqlnd=shared \
|
|
--enable-opcache=shared \
|
|
--with-openssl=shared \
|
|
--with-kerberos \
|
|
--with-system-ciphers \
|
|
--with-password-argon2 \
|
|
--enable-pcntl=shared \
|
|
--with-external-pcre \
|
|
$without_pcre_jit \
|
|
--enable-pdo=shared \
|
|
--with-pdo-dblib=shared,/usr \
|
|
--with-pdo-mysql=shared,mysqlnd \
|
|
--with-pdo-odbc=shared,unixODBC,/usr \
|
|
--with-pdo-pgsql=shared \
|
|
--with-pdo-sqlite=shared \
|
|
--with-pgsql=shared \
|
|
--enable-phar=shared \
|
|
--enable-posix=shared \
|
|
--with-pspell=shared \
|
|
--without-readline \
|
|
--enable-session=shared \
|
|
--enable-shmop=shared \
|
|
--enable-simplexml=shared \
|
|
--with-snmp=shared \
|
|
--enable-soap=shared \
|
|
--with-sodium=shared \
|
|
--enable-sockets=shared \
|
|
--with-sqlite3=shared \
|
|
--enable-sysvmsg=shared \
|
|
--enable-sysvsem=shared \
|
|
--enable-sysvshm=shared \
|
|
--with-tidy=shared \
|
|
--enable-tokenizer=shared \
|
|
--with-unixODBC=shared,/usr \
|
|
--enable-xml=shared \
|
|
--enable-xmlreader=shared \
|
|
--enable-xmlwriter=shared \
|
|
--with-xsl=shared \
|
|
--with-zip=shared \
|
|
--with-zlib \
|
|
--enable-zend-test=shared \
|
|
"$@"
|
|
rm -f modules/* # clean-up possible previous build
|
|
make
|
|
}
|
|
|
|
build() {
|
|
# build phpcgi and apache2 SAPIs first
|
|
# because not fixed https://bugs.php.net/bug.php?id=52419
|
|
# apache2 module
|
|
_build --disable-phpdbg \
|
|
--disable-cli \
|
|
--with-apxs2
|
|
mv libs/libphp.so sapi/apache2handler/mod_php$_suffix.so
|
|
|
|
local enable_litespeed
|
|
[ -z ${subpackages##*-litespeed*} ] && enable_litespeed=--enable-litespeed
|
|
# cgi, cli, fpm, embed, phpdbg, pear/pecl, litespeed
|
|
_build --enable-phpdbg \
|
|
--with-pear=/usr/share/$pkgname \
|
|
--enable-fpm \
|
|
--with-fpm-acl \
|
|
$enable_litespeed \
|
|
--enable-embed
|
|
}
|
|
|
|
check() {
|
|
# PHP is so stupid that it's not able to resolve dependencies
|
|
# between extensions and load them in correct order, so we must
|
|
# help it...
|
|
# opcache is Zend extension, it's handled specially in Makefile
|
|
local php_modules=$(_extensions_by_load_order \
|
|
| grep -vx opcache \
|
|
| xargs -n 1 printf "'$builddir/modules/%s.la' ")
|
|
sed -i "/^PHP_TEST_SHARED_EXTENSIONS/,/extension=/ \
|
|
s|in \$(PHP_MODULES)\"*|in $php_modules|" Makefile
|
|
|
|
# XXX: Few tests fail on the named platforms.
|
|
# Ignore it for now and continue build even on test failures.
|
|
local allow_fail='no'
|
|
case "$CARCH" in
|
|
no ) allow_fail='yes'
|
|
esac
|
|
|
|
TESTS="${TESTS:- --show-diff }" NO_INTERACTION=1 REPORT_EXIT_STATUS=1 \
|
|
SKIP_SLOW_TESTS=1 SKIP_ONLINE_TESTS=1 TEST_TIMEOUT=10 \
|
|
SKIP_PERF_SENSITIVE=1 \
|
|
TZ='' LANG='' LC_ALL='' TEST_FPM_EXTENSION_DIR=modules \
|
|
TRAVIS=true SKIP_IO_CAPTURE_TESTS=1 \
|
|
make test || [ "$allow_fail" = yes ]
|
|
|
|
echo 'NOTE: We have skipped quite a lot tests, see disabled-tests.list.'
|
|
}
|
|
|
|
package() {
|
|
make -j1 INSTALL_ROOT="$pkgdir" install
|
|
rm "$pkgdir"/usr/lib/php$_suffix/modules/zend_test.so
|
|
|
|
install -Dm644 php.ini-production "$pkgdir"/etc/$pkgname/php.ini
|
|
|
|
local file; for file in pear peardev pecl; do
|
|
sed -i -e "s|/usr/bin/php|/usr/bin/php$_suffix|g" \
|
|
-e "s|PHP=php|PHP=php$_suffix|" \
|
|
"$pkgdir"/usr/bin/$file
|
|
done
|
|
|
|
find "$pkgdir" -name '.*' -print0 | xargs -0 rm -rf
|
|
rmdir "$pkgdir"/var/run
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s php$_suffix "$pkgdir"/usr/bin/php
|
|
fi
|
|
}
|
|
|
|
dev() {
|
|
default_dev
|
|
replaces="php-dev"
|
|
|
|
amove \
|
|
usr/bin/php-config$_suffix \
|
|
usr/bin/phpize$_suffix \
|
|
$_libdir/build
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s phpize$_suffix "$subpkgdir"/usr/bin/phpize
|
|
ln -s php-config$_suffix "$subpkgdir"/usr/bin/php-config
|
|
fi
|
|
}
|
|
|
|
doc() {
|
|
default_doc
|
|
|
|
cd "$builddir"
|
|
|
|
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
|
|
cp CODING_STANDARDS.md EXTENSIONS LICENSE NEWS \
|
|
README* UPGRADING* \
|
|
"$subpkgdir"/usr/share/doc/$pkgname/
|
|
}
|
|
|
|
apache2() {
|
|
pkgdesc="PHP$_suffix Module for Apache2"
|
|
depends="$depends apache2"
|
|
provides="php-apache2"
|
|
|
|
install -D -m 755 "$builddir"/sapi/apache2handler/mod_php$_suffix.so \
|
|
"$subpkgdir"/usr/lib/apache2/mod_php$_suffix.so
|
|
|
|
install -D -m 644 "$srcdir"/php$_suffix-module.conf \
|
|
"$subpkgdir"/etc/apache2/conf.d/php$_suffix-module.conf
|
|
}
|
|
|
|
phpdbg() {
|
|
pkgdesc="Interactive PHP$_suffix debugger"
|
|
provides="php-phpdbg"
|
|
|
|
amove usr/bin/phpdbg$_suffix
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s phpdbg$_suffix "$subpkgdir"/usr/bin/phpdbg
|
|
fi
|
|
}
|
|
|
|
embed() {
|
|
pkgdesc="PHP$_suffix Embedded Library"
|
|
provides="php-embed"
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib
|
|
mv "$pkgdir"/usr/lib/libphp.so "$subpkgdir"/usr/lib/libphp$_suffix.so
|
|
# we do this so it matches the name, otherwise SONAME libphp.so conflicts
|
|
patchelf --set-soname libphp$_suffix.so "$subpkgdir"/usr/lib/libphp$_suffix.so
|
|
}
|
|
|
|
litespeed() {
|
|
pkgdesc="PHP$_suffix LiteSpeed SAPI"
|
|
provides="php-lightspeed"
|
|
|
|
amove usr/bin/lsphp$_suffix
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s lsphp$_suffix "$subpkgdir"/usr/bin/lsphp
|
|
fi
|
|
}
|
|
|
|
cgi() {
|
|
pkgdesc="PHP$_suffix Common Gateway Interface"
|
|
provides="php-cgi"
|
|
|
|
amove usr/bin/php-cgi$_suffix
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s php-cgi$_suffix "$subpkgdir"/usr/bin/php-cgi
|
|
fi
|
|
}
|
|
|
|
fpm() {
|
|
pkgdesc="PHP$_suffix FastCGI Process Manager"
|
|
provides="php-fpm"
|
|
|
|
amove etc/$pkgname/php-fpm* usr/sbin var
|
|
amove usr/share/$pkgname/fpm
|
|
|
|
local file; for file in php-fpm.conf php-fpm.d/www.conf; do
|
|
mv "$subpkgdir"/etc/$pkgname/$file.default \
|
|
"$subpkgdir"/etc/$pkgname/$file
|
|
done
|
|
|
|
install -D -m 755 "$srcdir"/$pkgname-fpm.initd \
|
|
"$subpkgdir"/etc/init.d/php-fpm$_suffix
|
|
|
|
install -D -m 644 "$srcdir"/$pkgname-fpm.logrotate \
|
|
"$subpkgdir"/etc/logrotate.d/php-fpm$_suffix
|
|
|
|
mkdir -p "$subpkgdir"/var/log/$pkgname
|
|
}
|
|
|
|
pear() {
|
|
pkgdesc="PHP$_suffix Extension and Application Repository"
|
|
depends="$pkgname $pkgname-xml"
|
|
provides="php-pear"
|
|
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
local file; for file in pecl pear peardev; do
|
|
mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin/$file$_suffix
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s $file$_suffix "$subpkgdir"/usr/bin/$file
|
|
fi
|
|
done
|
|
|
|
amove etc/$pkgname/pear.conf usr/share
|
|
}
|
|
|
|
common() {
|
|
pkgdesc="$pkgdesc (common config)"
|
|
provides="php-common $pkgname-zlib php-zlib $pkgname-json php-json" # for backward compatibility
|
|
depends=""
|
|
|
|
amove etc
|
|
mkdir -p "$subpkgdir"/$_extension_confd "$subpkgdir"/$_extension_dir
|
|
}
|
|
|
|
phar() {
|
|
_extension
|
|
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/phar$_suffix.phar "$subpkgdir"/usr/bin/phar.phar$_suffix
|
|
|
|
rm "$pkgdir"/usr/bin/phar$_suffix
|
|
ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar$_suffix
|
|
|
|
if [ "$_default_php" = yes ]; then
|
|
ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar.phar
|
|
ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar
|
|
fi
|
|
}
|
|
|
|
_extension() {
|
|
local extname="${subpkgname#"$pkgname"-}"
|
|
local extdepends="$(eval "echo \$_depends_$extname")"
|
|
local extdesc="$(head -n1 "$builddir"/ext/$extname/CREDITS 2>/dev/null ||:)"
|
|
pkgdesc="PHP$_suffix extension: ${extdesc:-$extname}"
|
|
provides="php-$extname"
|
|
|
|
: "${extdepends:=$(_resolve_extension_deps "$extname")}"
|
|
depends="$depends $extdepends"
|
|
|
|
local load_order=$(_extension_load_order "$extname")
|
|
|
|
# extension prefix
|
|
local prefix=
|
|
[ "$extname" != "opcache" ] || prefix="zend_"
|
|
|
|
amove $_extension_dir/$extname.so
|
|
|
|
mkdir -p "$subpkgdir"/$_extension_confd
|
|
echo "${prefix}extension=$extname" \
|
|
> "$subpkgdir"/$_extension_confd/"$(printf %02d $load_order)"_$extname.ini
|
|
}
|
|
|
|
# Resolves dependencies of the given extension name (without $pkgname- prefix)
|
|
# on other extensions in $_extensions and prints them with $pkgname- prefix.
|
|
_resolve_extension_deps() {
|
|
local name="$1"
|
|
|
|
# We use config.w32 just because it's more accurate than config.m4.
|
|
local config="$builddir/ext/$name/config.w32"
|
|
[ -f "$config" ] || return 0
|
|
|
|
sed -En "s/.*ADD_EXTENSION_DEP\('$name', ([^)]+)\).*/\1/p" "$config" \
|
|
| tr -d "'," | tr ' ' '\n' \
|
|
| sort -u \
|
|
| while read -r dep; do
|
|
if echo "$_extensions" | grep -qw "$dep"; then
|
|
echo "$pkgname-$dep"
|
|
fi
|
|
done
|
|
}
|
|
|
|
# Prints a load order (0-based integer) for the given extension name. Extension
|
|
# with lower load order should be loaded before exts with higher load order.
|
|
# It's based on number of dependencies of the extension (with exception for
|
|
# "imap"), which is flawed, but simple and good enough for now.
|
|
_extension_load_order() {
|
|
local name="$1"
|
|
local deps=$(eval "echo \$_depends_$name")
|
|
|
|
case "$name" in
|
|
# XXX: This must be loaded after recode, even though it does
|
|
# not depend on it. So we must use this hack...
|
|
*) echo "${deps:=$(_resolve_extension_deps $name)}" | wc -w;;
|
|
esac
|
|
}
|
|
|
|
# Prints $_extensions sorted by load order and name.
|
|
_extensions_by_load_order() {
|
|
local deps list name
|
|
|
|
for name in $_extensions; do
|
|
list="$list $(_extension_load_order $name);$name"
|
|
done
|
|
printf '%s\n' $list | sort -t ';' -k 1 | sed -E 's/\d+;//'
|
|
}
|
|
|
|
sha512sums="
|
|
d8084415ead65d685c68c4264e793abb1322b01e120c2ac09c2e33889a13513fb42401621fcb702e36bc1a3239b317a4c10e20c676bb19eb05749a6d6e646318 php-8.1.32.tar.xz
|
|
7dc9f55b12998355a6a6b5cf277285058e66928215f8d0109448d06fb696a74c674f83d18a81bf03f4f0bee06e77979e9a4ee5c81c7fdebff91447f8e697cc69 php81-fpm.initd
|
|
98bb27864f1ece80fef18cb286885c8c18de8f9d1076507b6a24df07e33aa400623b90401375e7ebe55d9ff802069d281642ec7d3a58ef8727121aabe7643241 php81-fpm.logrotate
|
|
2e3b22b4adbc81c6120757095c89e56642f3e8bf7724af2926f2667759ef082cdcff416334aad87f704a61fcb5b2c11830f17759ac771a3dd4e47d9bc5c7cf72 php81-module.conf
|
|
292f84376aa0152585002cace64722188b9efc1395b2debf52f1a1d66cbb8afbc2581a48aac560d65f5033944f3036e792117e93e48faa08753b0eec56f9c1fc disabled-tests.list
|
|
50c17583cb23891515df85eb2fffd623c2c95738cdd7cac1b39e205431b68ebf7329f1d1eb4c191cf0a6ac88cfd89f37f5710a863afbd313d7028d41c82019c9 disabled-tests.ppc64le.list
|
|
378db19d08cec29c4e56f2c82ee0a99b31e5ec3eaac56c40597de442da36a4d7efcc7551577e37a6ca22649d612d42714c93e16e3f7579aeb85a44090bde80fc disabled-tests.riscv64.list
|
|
54930246f22034e6a73020aa95915d14b2a2fcfe121df57eb17fdc663aceeb94c5c4b1800347149a8fb4eaa0edda4224a11133bdb7e0cd34a2065a2de121db0d disabled-tests.s390x.list
|
|
6d3bc15982e13ec4c065b6445e07818d589f2cc677147a57929d1739b3e6b119cc9be6a07d3a99bb5e989e47a62fa6047f967c3c962253845d4bab224b378db3 disabled-tests.x86.list
|
|
be3184e07ed3e12b0982b2ed68f12852dbff706031def4be76b89ecad51c23cf2bd4bbf7138b6d83252af4343de0b693724fac9b188941beb5e7cd89af9b07ee disabled-tests.loongarch64.list
|
|
ec206639d076ddac6c2d1db697a5428ed3be979157db39417af7fbe6ab837e8dc00315ae0e55aea4f92f45ca5827c88cc4933099fad9c962f029ca81bef779d7 install-pear.patch
|
|
e88ad17895742b74019912ad45c90af74817d75d7e1f71bd3d4a180b5f710a25d3c73c7410394f415eee0f428a8c5a0ea3702009ef9d2bffdebdd5da748f8b9b includedir.patch
|
|
8db38c523a8e0ed64298661d328372ea33ba0a56d23c023299ad94ee43a6db8c49393efcb679e74bbb936383dcacebdfb440bbacdf74068d78d071dd3f795101 sharedir.patch
|
|
f43ab399c3b4a2b9a3a329acd32d9cbc690cad697dd0a0e87f3d654028b88af7dd1cd80cbf970c6fe95a44d9b24646640bb4cc9eba15f36afc171504f1060066 php81-fpm-version-suffix.patch
|
|
1b64a7cef9e81387f955cb60ffa4e3d2277b4f6072e9328d779c0d447c202c8ee9dff0d8d8c34abc82c150311f51c4e9316a3b72a383ca6c9a6e683bc5b349a0 fix-tests-devserver.patch
|
|
73ad23e675c336b7607ff99fc3a3ffdb381779411c5503ef5a353ad43607070d889e441800abc54080d6be42032e94c3884d05d3bfbc46e5dda93b5e10fc40f7 fix-lfs64.patch
|
|
10c8da2e2ff24903c012b4df4f1fd7ed739429d0630260c398ed255cb45589ee170c29af09f5f57202a5fe37d4e82669196c813a5b916b7f2be2d46e9bfd1d85 fix-s390x-test.patch
|
|
16d283ac2373442f2fbbca4968df92e0114454c7645a797f1f04af27e546293f3312d45aef049357057facd4fb62339ebfe7f59e65d4278910c4195d873955d1 fix-icu74.patch
|
|
517441fdf14b7855b1843bd0d1c86126017af7a340fbf7177202db7c9e67912332abdb62e7477f45e7922c910672396ba4f953eb7dc052ed06624c682bd12791 loongarch64-support-for-fibers.patch
|
|
39b8a84098db50d76cac51438b869cc9c4f88881948bc0bac590f811889f6ca974b31153561a22642810d81ccb92d301580032d08fe911472b3f0350eae84450 fix-pear.patch
|
|
6050fe5d7c2095face8048f049060a8dc8eb6b7ba462db4590542f9e6ffab54ab3106ed6c091542252c0aa8edfe8a55a7f7ccc186c56ee672eaeeea5ed8dc87c ext-intl-level-up-c++-runtime-std-for-icu.patch
|
|
7e5f052119197d6056d5e57c864e614674727077f222d5e538a026c8f2997b2ecd78cd655a23c1d727360c386995fef84b9c64bf43780fcc092df59543c41580 Adapt-ext-intl-tests-for-ICU-75.1-and-76.1.patch
|
|
"
|