| 1 | # Contributor: Valery Kartel <[email protected]> |
| 2 | # Contributor: Jakub Jirutka <[email protected]> |
| 3 | # Maintainer: Andy Postnikov <[email protected]> |
| 4 | |
| 5 | # Bundled libraries |
| 6 | # |
| 7 | # Name | License | Location | State |
| 8 | # ----------+---------------------+------------------------+--------- |
| 9 | # bcmath | LGPL-2.1-or-later | ext/bcmath/libbcmath | used |
| 10 | # date | MIT | ext/date/lib | used |
| 11 | # fileinfo | BSD-2-Clause | ext/fileinfo/libmagic | used |
| 12 | # gd | BSD | ext/gd/libgd | used |
| 13 | # hash | CC0-1.0 | ext/hash/sha3 | used |
| 14 | # xxHash | BSD-2-Clause | ext/hash/xxhash | used |
| 15 | # libmbfl | LGPL-2.1-only | ext/mbstring/libmbfl | used |
| 16 | # pcre | BSD-3-Clause | ext/pcre/pcrelib | not used |
| 17 | # sqlite3 | Public | ext/sqlite3/libsqlite | not used |
| 18 | # libzip | BSD-3-Clause | ext/zip/lib | not used |
| 19 | |
| 20 | # Static extensions |
| 21 | # |
| 22 | # Name | Reason |
| 23 | # ----------+-------------------------------------------- |
| 24 | # zlib | https://bugs.alpinelinux.org/issues/8299 |
| 25 | # json | https://wiki.php.net/rfc/always_enable_json |
| 26 | |
| 27 | pkgname=php81 |
| 28 | _pkgreal=php |
| 29 | pkgver=8.1.34 |
| 30 | pkgrel=6 |
| 31 | _apiver=20210902 |
| 32 | _suffix=${pkgname#php} |
| 33 | # Is this package the default (latest) PHP version? |
| 34 | _default_php="no" |
| 35 | provides="$pkgname-cli php-cli php" # for backward compatibility |
| 36 | # priority of community/php82 is 100 |
| 37 | provider_priority=50 |
| 38 | pkgdesc="The PHP$_suffix language runtime engine" |
| 39 | url="https://www.php.net/" |
| 40 | arch="all" |
| 41 | license="PHP-3.01 BSD-3-Clause LGPL-2.0-or-later MIT Zend-2.0" |
| 42 | depends="$pkgname-common" |
| 43 | depends_dev="$pkgname=$pkgver-r$pkgrel autoconf pcre2-dev re2c" |
| 44 | # Most dependencies between extensions is auto-discovered (see _extension()). |
| 45 | _depends_mysqlnd="$pkgname-openssl" |
| 46 | _depends_pdo_mysql="$pkgname-pdo $pkgname-mysqlnd" |
| 47 | _depends_phar="$pkgname" |
| 48 | # openssl is actually transitive dependency here, but we need to because of |
| 49 | # load index based on number of dependencies. |
| 50 | _depends_mysqli="$pkgname-mysqlnd $pkgname-openssl" |
| 51 | _clang_ver=21 |
| 52 | makedepends=" |
| 53 | $depends_dev |
| 54 | acl-dev |
| 55 | apache2 |
| 56 | apache2-dev |
| 57 | argon2-dev |
| 58 | aspell-dev |
| 59 | bison |
| 60 | bzip2-dev |
| 61 | clang$_clang_ver |
| 62 | curl-dev |
| 63 | enchant2-dev |
| 64 | freetds-dev |
| 65 | freetype-dev |
| 66 | gdbm-dev |
| 67 | gettext-dev |
| 68 | gmp-dev |
| 69 | icu-dev |
| 70 | imap-dev |
| 71 | krb5-dev |
| 72 | libavif-dev |
| 73 | libedit-dev |
| 74 | libical-dev |
| 75 | libjpeg-turbo-dev |
| 76 | libpng-dev |
| 77 | libpq-dev |
| 78 | lmdb-dev |
| 79 | oniguruma-dev |
| 80 | libsodium-dev |
| 81 | libwebp-dev |
| 82 | libxml2-dev |
| 83 | libxpm-dev |
| 84 | libxslt-dev |
| 85 | libzip-dev |
| 86 | net-snmp-dev |
| 87 | openldap-dev |
| 88 | openssl-dev>3 |
| 89 | patchelf |
| 90 | sqlite-dev |
| 91 | tidyhtml-dev |
| 92 | unixodbc-dev |
| 93 | zlib-dev |
| 94 | " |
| 95 | checkdepends="icu-data-full" |
| 96 | subpackages="$pkgname-dev $pkgname-doc |
| 97 | $pkgname-phpdbg $pkgname-apache2 |
| 98 | $pkgname-embed $pkgname-cgi $pkgname-fpm |
| 99 | $pkgname-pear::noarch |
| 100 | " |
| 101 | # sources for RC available at |
| 102 | # - https://downloads.php.net/~patrickallaert/php-${pkgver}RC1.tar.xz |
| 103 | # - https://downloads.php.net/~ramsey/php-${pkgver}RC1.tar.xz |
| 104 | source="$_pkgreal-$pkgver.tar.xz::https://php.net/distributions/$_pkgreal-$pkgver.tar.xz |
| 105 | $pkgname-fpm.initd |
| 106 | $pkgname-fpm.logrotate |
| 107 | $pkgname-module.conf |
| 108 | disabled-tests.list |
| 109 | disabled-tests.ppc64le.list |
| 110 | disabled-tests.riscv64.list |
| 111 | disabled-tests.s390x.list |
| 112 | disabled-tests.x86.list |
| 113 | disabled-tests.loongarch64.list |
| 114 | install-pear.patch |
| 115 | includedir.patch |
| 116 | sharedir.patch |
| 117 | $pkgname-fpm-version-suffix.patch |
| 118 | fix-tests-devserver.patch |
| 119 | fix-lfs64.patch |
| 120 | fix-s390x-test.patch |
| 121 | fix-icu74.patch |
| 122 | loongarch64-support-for-fibers.patch |
| 123 | fix-pear.patch |
| 124 | fix-pcre.patch |
| 125 | fix-curl.patch |
| 126 | fix-ftp-expired-cert.patch |
| 127 | GHSA-m8rr-4c36-8gq4.patch |
| 128 | GHSA-96wq-48vp-hh57.patch |
| 129 | GHSA-wm6j-2649-pv75.patch |
| 130 | GHSA-7qg2-v9fj-4mwv.patch |
| 131 | GHSA-hmxp-6pc4-f3vv.patch |
| 132 | GHSA-m33r-qmcv-p97q.patch |
| 133 | GHSA-85c2-q967-79q5.patch |
| 134 | GHSA-8.2.32.patch |
| 135 | CVE-2026-9672.patch |
| 136 | GHSA-7qpv-r5mr-78m4.patch |
| 137 | GHSA-vc5h-9ppw-p5f3.patch |
| 138 | fix-dateperiod-double-construct-leak.patch |
| 139 | GHSA-88hq-2827-7pg6.patch |
| 140 | GHSA-62xp-839h-2637.patch |
| 141 | GHSA-vvx9-73fr-5jjx.patch |
| 142 | GHSA-xr7j-rvgx-xq5p.patch |
| 143 | GHSA-r6x9-5r99-36j7.patch |
| 144 | GHSA-fpwc-w8rq-cr92.patch |
| 145 | GHSA-rgrp-mwpx-f6rm.patch |
| 146 | GHSA-cj93-vc83-wgqv.patch |
| 147 | GHSA-j3wh-g957-2m85.patch |
| 148 | GHSA-ch8v-r6jh-4vvr.patch |
| 149 | GHSA-7875-c8px-7q5f.patch |
| 150 | GHSA-7875-c8px-7q5f-regression.patch |
| 151 | GHSA-cj93-vc83-wgqv-test.patch |
| 152 | GHSA-62xp-839h-2637-tests.patch |
| 153 | openssl-tests-worker-ini.patch |
| 154 | " |
| 155 | builddir="$srcdir/$_pkgreal-$pkgver" |
| 156 | |
| 157 | _libdir="usr/lib/$pkgname" |
| 158 | _extension_dir="$_libdir/modules" |
| 159 | _extension_confd="/etc/$pkgname/conf.d" |
| 160 | |
| 161 | _extensions=" |
| 162 | bcmath |
| 163 | bz2 |
| 164 | calendar |
| 165 | ctype |
| 166 | curl |
| 167 | dba |
| 168 | dom |
| 169 | enchant |
| 170 | exif |
| 171 | ffi |
| 172 | fileinfo |
| 173 | ftp |
| 174 | gd |
| 175 | gettext |
| 176 | gmp |
| 177 | iconv |
| 178 | imap |
| 179 | intl |
| 180 | ldap |
| 181 | mbstring |
| 182 | mysqli |
| 183 | mysqlnd |
| 184 | odbc |
| 185 | opcache |
| 186 | openssl |
| 187 | pcntl |
| 188 | pdo |
| 189 | pdo_dblib |
| 190 | pdo_mysql |
| 191 | pdo_odbc |
| 192 | pdo_pgsql |
| 193 | pdo_sqlite |
| 194 | pgsql |
| 195 | phar |
| 196 | posix |
| 197 | pspell |
| 198 | session |
| 199 | shmop |
| 200 | simplexml |
| 201 | snmp |
| 202 | soap |
| 203 | sodium |
| 204 | sockets |
| 205 | sqlite3 |
| 206 | sysvmsg |
| 207 | sysvsem |
| 208 | sysvshm |
| 209 | tidy |
| 210 | tokenizer |
| 211 | xml |
| 212 | xmlreader |
| 213 | xmlwriter |
| 214 | xsl |
| 215 | zip |
| 216 | " |
| 217 | for _ext in $_extensions; do |
| 218 | case "$_ext" in |
| 219 | phar) subpackages="$subpackages $pkgname-$_ext:$_ext";; |
| 220 | *) subpackages="$subpackages $pkgname-$_ext:_extension";; |
| 221 | esac |
| 222 | done |
| 223 | subpackages="$subpackages $pkgname-common::noarch" |
| 224 | subpackages="$subpackages $pkgname-litespeed" |
| 225 | |
| 226 | # secfixes: |
| 227 | # 8.1.34-r6: |
| 228 | # - CVE-2025-1218 |
| 229 | # - CVE-2025-14181 |
| 230 | # - CVE-2026-6103 |
| 231 | # - CVE-2026-91765 |
| 232 | # - CVE-2026-91766 |
| 233 | # - CVE-2026-91767 |
| 234 | # - CVE-2026-91768 |
| 235 | # - CVE-2026-91769 |
| 236 | # - CVE-2026-92842 |
| 237 | # - CVE-2026-93682 |
| 238 | # 8.1.34-r5: |
| 239 | # - CVE-2026-17543 |
| 240 | # - CVE-2026-7260 |
| 241 | # - CVE-2026-9672 |
| 242 | # 8.1.34-r3: |
| 243 | # - CVE-2026-14355 |
| 244 | # 8.1.34-r2: |
| 245 | # - CVE-2026-7258 |
| 246 | # - CVE-2026-7568 |
| 247 | # - CVE-2026-7259 |
| 248 | # - CVE-2026-6735 |
| 249 | # - CVE-2026-7262 |
| 250 | # - CVE-2026-7261 |
| 251 | # - CVE-2026-6722 |
| 252 | # 8.1.34-r0: |
| 253 | # - CVE-2025-14177 |
| 254 | # - CVE-2025-14178 |
| 255 | # - CVE-2025-14180 |
| 256 | # 8.1.33-r0: |
| 257 | # - CVE-2025-1220 |
| 258 | # - CVE-2025-1735 |
| 259 | # - CVE-2025-6491 |
| 260 | # 8.1.32-r0: |
| 261 | # - CVE-2025-1217 |
| 262 | # - CVE-2025-1219 |
| 263 | # - CVE-2025-1734 |
| 264 | # - CVE-2025-1736 |
| 265 | # - CVE-2025-1861 |
| 266 | # 8.1.31-r0: |
| 267 | # - CVE-2024-8929 |
| 268 | # - CVE-2024-8932 |
| 269 | # - CVE-2024-11233 |
| 270 | # - CVE-2024-11234 |
| 271 | # - CVE-2024-11236 |
| 272 | # 8.1.30-r0: |
| 273 | # - CVE-2024-8925 |
| 274 | # - CVE-2024-8926 |
| 275 | # - CVE-2024-8927 |
| 276 | # - CVE-2024-9026 |
| 277 | # 8.1.29-r0: |
| 278 | # - CVE-2024-4577 |
| 279 | # - CVE-2024-5458 |
| 280 | # - CVE-2024-5585 |
| 281 | # 8.1.28-r0: |
| 282 | # - CVE-2024-1874 |
| 283 | # - CVE-2024-2756 |
| 284 | # - CVE-2024-3096 |
| 285 | # 8.1.16-r0: |
| 286 | # - CVE-2023-0567 |
| 287 | # - CVE-2023-0568 |
| 288 | # - CVE-2023-0662 |
| 289 | # 8.1.14-r0: |
| 290 | # - CVE-2022-31631 |
| 291 | # 8.1.12-r0: |
| 292 | # - CVE-2022-31630 |
| 293 | # - CVE-2022-37454 |
| 294 | # 8.1.11-r0: |
| 295 | # - CVE-2022-31628 |
| 296 | # - CVE-2022-31629 |
| 297 | # 8.1.6-r2: |
| 298 | # - CVE-2022-31625 |
| 299 | # - CVE-2022-31626 |
| 300 | # 8.1.0-r0: |
| 301 | # - CVE-2021-21707 |
| 302 | # 8.1.0_rc5-r0: |
| 303 | # - CVE-2021-21703 |
| 304 | # 8.1.0_rc3-r0: |
| 305 | # - CVE-2021-21706 |
| 306 | |
| 307 | prepare() { |
| 308 | default_prepare |
| 309 | |
| 310 | local vapi=$(sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h) |
| 311 | if [ "$vapi" != "$_apiver" ]; then |
| 312 | error "Upstream API version is now $vapi. Expecting $_apiver" |
| 313 | error "After updating _apiver, all 3rd-party extensions must be rebuilt." |
| 314 | return 1 |
| 315 | fi |
| 316 | |
| 317 | # https://bugs.php.net/63362 - Not needed but installed headers. |
| 318 | # Drop some Windows specific headers to avoid installation, |
| 319 | # before build to ensure they are really not needed. |
| 320 | rm -f TSRM/tsrm_win32.h \ |
| 321 | TSRM/tsrm_config.w32.h \ |
| 322 | Zend/zend_config.w32.h \ |
| 323 | ext/mysqlnd/config-win.h \ |
| 324 | ext/standard/winver.h |
| 325 | |
| 326 | # Fix some bogus permissions. |
| 327 | find . -name '*.[ch]' -exec chmod 644 {} \; |
| 328 | |
| 329 | # Remove failing tests includng arch specific ones. |
| 330 | local tests="disabled-tests.list disabled-tests.$CARCH.list" |
| 331 | local file; for file in $tests; do [ -f "$srcdir"/$file ] && \ |
| 332 | sed -n '/^[^#]/p' "$srcdir"/$file | while read -r item; do |
| 333 | rm -r $item # do it in this way to apply globbing... |
| 334 | done |
| 335 | done |
| 336 | |
| 337 | autoconf |
| 338 | } |
| 339 | |
| 340 | # Notes: |
| 341 | # * gd-jis-conv breaks any non-latin font rendering (vakartel). |
| 342 | # * libxml cannot be build as shared. |
| 343 | # * -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php andypost) |
| 344 | # * -O2 optimize for apps usage (andypost) |
| 345 | _build() { |
| 346 | local _extra='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' |
| 347 | export CFLAGS="${CFLAGS/-Os/-O2} $_extra" |
| 348 | export CXXFLAGS="${CXXFLAGS/-Os/-O2} $_extra" |
| 349 | |
| 350 | local without_pcre_jit |
| 351 | [ "$CARCH" = "s390x" ] && without_pcre_jit="--without-pcre-jit" |
| 352 | |
| 353 | case "$CARCH" in |
| 354 | arm*|aarch64|riscv64|loongarch64) |
| 355 | export CFLAGS="${CFLAGS/-fstack-clash-protection}" |
| 356 | export CXXFLAGS="${CXXFLAGS/-fstack-clash-protection}" |
| 357 | ;; |
| 358 | esac |
| 359 | |
| 360 | export CC=clang-$_clang_ver |
| 361 | export CXX=clang++-$_clang_ver |
| 362 | PHP_BUILD_PROVIDER="Alpine Linux aports" \ |
| 363 | EXTENSION_DIR=/$_extension_dir ./configure \ |
| 364 | --build=$CBUILD \ |
| 365 | --host=$CHOST \ |
| 366 | --prefix=/usr \ |
| 367 | --program-suffix=$_suffix \ |
| 368 | --libdir=/$_libdir \ |
| 369 | --datadir=/usr/share/$pkgname \ |
| 370 | --sysconfdir=/etc/$pkgname \ |
| 371 | --localstatedir=/var \ |
| 372 | --with-layout=GNU \ |
| 373 | --with-pic \ |
| 374 | --with-config-file-path=/etc/$pkgname \ |
| 375 | --with-config-file-scan-dir=$_extension_confd \ |
| 376 | --disable-rpath \ |
| 377 | --disable-short-tags \ |
| 378 | \ |
| 379 | --enable-bcmath=shared \ |
| 380 | --with-bz2=shared \ |
| 381 | --enable-calendar=shared \ |
| 382 | --enable-ctype=shared \ |
| 383 | --with-curl=shared \ |
| 384 | --enable-dba=shared \ |
| 385 | --with-dbmaker=shared \ |
| 386 | --with-gdbm \ |
| 387 | --with-lmdb \ |
| 388 | --enable-dom=shared \ |
| 389 | --with-enchant=shared \ |
| 390 | --enable-exif=shared \ |
| 391 | --with-ffi=shared \ |
| 392 | --enable-fileinfo=shared \ |
| 393 | --enable-ftp=shared \ |
| 394 | --enable-gd=shared \ |
| 395 | --with-avif \ |
| 396 | --with-freetype \ |
| 397 | --with-jpeg \ |
| 398 | --with-webp \ |
| 399 | --with-xpm \ |
| 400 | --disable-gd-jis-conv \ |
| 401 | --with-gettext=shared \ |
| 402 | --with-gmp=shared \ |
| 403 | --with-iconv=shared \ |
| 404 | --with-imap=shared \ |
| 405 | --with-imap-ssl \ |
| 406 | --enable-intl=shared \ |
| 407 | --with-ldap=shared \ |
| 408 | --with-ldap-sasl \ |
| 409 | --with-libedit \ |
| 410 | --with-libxml \ |
| 411 | --enable-mbstring=shared \ |
| 412 | --with-mysqli=shared,mysqlnd \ |
| 413 | --with-mysql-sock=/run/mysqld/mysqld.sock \ |
| 414 | --enable-mysqlnd=shared \ |
| 415 | --enable-opcache=shared \ |
| 416 | --with-openssl=shared \ |
| 417 | --with-kerberos \ |
| 418 | --with-system-ciphers \ |
| 419 | --with-password-argon2 \ |
| 420 | --enable-pcntl=shared \ |
| 421 | --with-external-pcre \ |
| 422 | $without_pcre_jit \ |
| 423 | --enable-pdo=shared \ |
| 424 | --with-pdo-dblib=shared,/usr \ |
| 425 | --with-pdo-mysql=shared,mysqlnd \ |
| 426 | --with-pdo-odbc=shared,unixODBC,/usr \ |
| 427 | --with-pdo-pgsql=shared \ |
| 428 | --with-pdo-sqlite=shared \ |
| 429 | --with-pgsql=shared \ |
| 430 | --enable-phar=shared \ |
| 431 | --enable-posix=shared \ |
| 432 | --with-pspell=shared \ |
| 433 | --without-readline \ |
| 434 | --enable-session=shared \ |
| 435 | --enable-shmop=shared \ |
| 436 | --enable-simplexml=shared \ |
| 437 | --with-snmp=shared \ |
| 438 | --enable-soap=shared \ |
| 439 | --with-sodium=shared \ |
| 440 | --enable-sockets=shared \ |
| 441 | --with-sqlite3=shared \ |
| 442 | --enable-sysvmsg=shared \ |
| 443 | --enable-sysvsem=shared \ |
| 444 | --enable-sysvshm=shared \ |
| 445 | --with-tidy=shared \ |
| 446 | --enable-tokenizer=shared \ |
| 447 | --with-unixODBC=shared,/usr \ |
| 448 | --enable-xml=shared \ |
| 449 | --enable-xmlreader=shared \ |
| 450 | --enable-xmlwriter=shared \ |
| 451 | --with-xsl=shared \ |
| 452 | --with-zip=shared \ |
| 453 | --with-zlib \ |
| 454 | --enable-zend-test=shared \ |
| 455 | "$@" |
| 456 | rm -f modules/* # clean-up possible previous build |
| 457 | make |
| 458 | } |
| 459 | |
| 460 | build() { |
| 461 | # build phpcgi and apache2 SAPIs first |
| 462 | # because not fixed https://bugs.php.net/bug.php?id=52419 |
| 463 | # apache2 module |
| 464 | _build --disable-phpdbg \ |
| 465 | --disable-cli \ |
| 466 | --with-apxs2 |
| 467 | mv libs/libphp.so sapi/apache2handler/mod_php$_suffix.so |
| 468 | |
| 469 | local enable_litespeed |
| 470 | [ -z ${subpackages##*-litespeed*} ] && enable_litespeed=--enable-litespeed |
| 471 | # cgi, cli, fpm, embed, phpdbg, pear/pecl, litespeed |
| 472 | _build --enable-phpdbg \ |
| 473 | --with-pear=/usr/share/$pkgname \ |
| 474 | --enable-fpm \ |
| 475 | --with-fpm-acl \ |
| 476 | $enable_litespeed \ |
| 477 | --enable-embed |
| 478 | } |
| 479 | |
| 480 | check() { |
| 481 | # PHP is so stupid that it's not able to resolve dependencies |
| 482 | # between extensions and load them in correct order, so we must |
| 483 | # help it... |
| 484 | # opcache is Zend extension, it's handled specially in Makefile |
| 485 | local php_modules=$(_extensions_by_load_order \ |
| 486 | | grep -vx opcache \ |
| 487 | | xargs -n 1 printf "'$builddir/modules/%s.la' ") |
| 488 | sed -i "/^PHP_TEST_SHARED_EXTENSIONS/,/extension=/ \ |
| 489 | s|in \$(PHP_MODULES)\"*|in $php_modules|" Makefile |
| 490 | |
| 491 | # XXX: Few tests fail on the named platforms. |
| 492 | # Ignore it for now and continue build even on test failures. |
| 493 | local allow_fail='no' |
| 494 | case "$CARCH" in |
| 495 | no ) allow_fail='yes' |
| 496 | esac |
| 497 | |
| 498 | TESTS="${TESTS:- --show-diff }" NO_INTERACTION=1 REPORT_EXIT_STATUS=1 \ |
| 499 | SKIP_SLOW_TESTS=1 SKIP_ONLINE_TESTS=1 TEST_TIMEOUT=10 \ |
| 500 | SKIP_PERF_SENSITIVE=1 \ |
| 501 | TZ='' LANG='' LC_ALL='' TEST_FPM_EXTENSION_DIR=modules \ |
| 502 | TRAVIS=true SKIP_IO_CAPTURE_TESTS=1 \ |
| 503 | make test || [ "$allow_fail" = yes ] |
| 504 | |
| 505 | echo 'NOTE: We have skipped quite a lot tests, see disabled-tests.list.' |
| 506 | } |
| 507 | |
| 508 | package() { |
| 509 | make -j1 INSTALL_ROOT="$pkgdir" install |
| 510 | rm "$pkgdir"/usr/lib/php$_suffix/modules/zend_test.so |
| 511 | |
| 512 | install -Dm644 php.ini-production "$pkgdir"/etc/$pkgname/php.ini |
| 513 | |
| 514 | local file; for file in pear peardev pecl; do |
| 515 | sed -i -e "s|/usr/bin/php|/usr/bin/php$_suffix|g" \ |
| 516 | -e "s|PHP=php|PHP=php$_suffix|" \ |
| 517 | "$pkgdir"/usr/bin/$file |
| 518 | done |
| 519 | |
| 520 | find "$pkgdir" -name '.*' -print0 | xargs -0 rm -rf |
| 521 | rmdir "$pkgdir"/var/run |
| 522 | |
| 523 | if [ "$_default_php" = yes ]; then |
| 524 | ln -s php$_suffix "$pkgdir"/usr/bin/php |
| 525 | fi |
| 526 | } |
| 527 | |
| 528 | dev() { |
| 529 | default_dev |
| 530 | replaces="php-dev" |
| 531 | |
| 532 | amove \ |
| 533 | usr/bin/php-config$_suffix \ |
| 534 | usr/bin/phpize$_suffix \ |
| 535 | $_libdir/build |
| 536 | |
| 537 | if [ "$_default_php" = yes ]; then |
| 538 | ln -s phpize$_suffix "$subpkgdir"/usr/bin/phpize |
| 539 | ln -s php-config$_suffix "$subpkgdir"/usr/bin/php-config |
| 540 | fi |
| 541 | } |
| 542 | |
| 543 | doc() { |
| 544 | default_doc |
| 545 | |
| 546 | cd "$builddir" |
| 547 | |
| 548 | mkdir -p "$subpkgdir"/usr/share/doc/$pkgname |
| 549 | cp CODING_STANDARDS.md EXTENSIONS LICENSE NEWS \ |
| 550 | README* UPGRADING* \ |
| 551 | "$subpkgdir"/usr/share/doc/$pkgname/ |
| 552 | } |
| 553 | |
| 554 | apache2() { |
| 555 | pkgdesc="PHP$_suffix Module for Apache2" |
| 556 | depends="$depends apache2" |
| 557 | provides="php-apache2" |
| 558 | |
| 559 | install -D -m 755 "$builddir"/sapi/apache2handler/mod_php$_suffix.so \ |
| 560 | "$subpkgdir"/usr/lib/apache2/mod_php$_suffix.so |
| 561 | |
| 562 | install -D -m 644 "$srcdir"/php$_suffix-module.conf \ |
| 563 | "$subpkgdir"/etc/apache2/conf.d/php$_suffix-module.conf |
| 564 | } |
| 565 | |
| 566 | phpdbg() { |
| 567 | pkgdesc="Interactive PHP$_suffix debugger" |
| 568 | provides="php-phpdbg" |
| 569 | |
| 570 | amove usr/bin/phpdbg$_suffix |
| 571 | |
| 572 | if [ "$_default_php" = yes ]; then |
| 573 | ln -s phpdbg$_suffix "$subpkgdir"/usr/bin/phpdbg |
| 574 | fi |
| 575 | } |
| 576 | |
| 577 | embed() { |
| 578 | pkgdesc="PHP$_suffix Embedded Library" |
| 579 | provides="php-embed" |
| 580 | |
| 581 | mkdir -p "$subpkgdir"/usr/lib |
| 582 | mv "$pkgdir"/usr/lib/libphp.so "$subpkgdir"/usr/lib/libphp$_suffix.so |
| 583 | # we do this so it matches the name, otherwise SONAME libphp.so conflicts |
| 584 | patchelf --set-soname libphp$_suffix.so "$subpkgdir"/usr/lib/libphp$_suffix.so |
| 585 | } |
| 586 | |
| 587 | litespeed() { |
| 588 | pkgdesc="PHP$_suffix LiteSpeed SAPI" |
| 589 | provides="php-lightspeed" |
| 590 | |
| 591 | amove usr/bin/lsphp$_suffix |
| 592 | |
| 593 | if [ "$_default_php" = yes ]; then |
| 594 | ln -s lsphp$_suffix "$subpkgdir"/usr/bin/lsphp |
| 595 | fi |
| 596 | } |
| 597 | |
| 598 | cgi() { |
| 599 | pkgdesc="PHP$_suffix Common Gateway Interface" |
| 600 | provides="php-cgi" |
| 601 | |
| 602 | amove usr/bin/php-cgi$_suffix |
| 603 | |
| 604 | if [ "$_default_php" = yes ]; then |
| 605 | ln -s php-cgi$_suffix "$subpkgdir"/usr/bin/php-cgi |
| 606 | fi |
| 607 | } |
| 608 | |
| 609 | fpm() { |
| 610 | pkgdesc="PHP$_suffix FastCGI Process Manager" |
| 611 | provides="php-fpm" |
| 612 | |
| 613 | amove etc/$pkgname/php-fpm* usr/sbin var |
| 614 | amove usr/share/$pkgname/fpm |
| 615 | |
| 616 | local file; for file in php-fpm.conf php-fpm.d/www.conf; do |
| 617 | mv "$subpkgdir"/etc/$pkgname/$file.default \ |
| 618 | "$subpkgdir"/etc/$pkgname/$file |
| 619 | done |
| 620 | |
| 621 | install -D -m 755 "$srcdir"/$pkgname-fpm.initd \ |
| 622 | "$subpkgdir"/etc/init.d/php-fpm$_suffix |
| 623 | |
| 624 | install -D -m 644 "$srcdir"/$pkgname-fpm.logrotate \ |
| 625 | "$subpkgdir"/etc/logrotate.d/php-fpm$_suffix |
| 626 | |
| 627 | mkdir -p "$subpkgdir"/var/log/$pkgname |
| 628 | } |
| 629 | |
| 630 | pear() { |
| 631 | pkgdesc="PHP$_suffix Extension and Application Repository" |
| 632 | depends="$pkgname $pkgname-xml" |
| 633 | provides="php-pear" |
| 634 | |
| 635 | mkdir -p "$subpkgdir"/usr/bin |
| 636 | local file; for file in pecl pear peardev; do |
| 637 | mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin/$file$_suffix |
| 638 | if [ "$_default_php" = yes ]; then |
| 639 | ln -s $file$_suffix "$subpkgdir"/usr/bin/$file |
| 640 | fi |
| 641 | done |
| 642 | |
| 643 | amove etc/$pkgname/pear.conf usr/share |
| 644 | } |
| 645 | |
| 646 | common() { |
| 647 | pkgdesc="$pkgdesc (common config)" |
| 648 | provides="php-common $pkgname-zlib php-zlib $pkgname-json php-json" # for backward compatibility |
| 649 | depends="" |
| 650 | |
| 651 | amove etc |
| 652 | mkdir -p "$subpkgdir"/$_extension_confd "$subpkgdir"/$_extension_dir |
| 653 | } |
| 654 | |
| 655 | phar() { |
| 656 | _extension |
| 657 | |
| 658 | mkdir -p "$subpkgdir"/usr/bin |
| 659 | mv "$pkgdir"/usr/bin/phar$_suffix.phar "$subpkgdir"/usr/bin/phar.phar$_suffix |
| 660 | |
| 661 | rm "$pkgdir"/usr/bin/phar$_suffix |
| 662 | ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar$_suffix |
| 663 | |
| 664 | if [ "$_default_php" = yes ]; then |
| 665 | ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar.phar |
| 666 | ln -s phar.phar$_suffix "$subpkgdir"/usr/bin/phar |
| 667 | fi |
| 668 | } |
| 669 | |
| 670 | _extension() { |
| 671 | local extname="${subpkgname#"$pkgname"-}" |
| 672 | local extdepends="$(eval "echo \$_depends_$extname")" |
| 673 | local extdesc="$(head -n1 "$builddir"/ext/$extname/CREDITS 2>/dev/null ||:)" |
| 674 | pkgdesc="PHP$_suffix extension: ${extdesc:-$extname}" |
| 675 | provides="php-$extname" |
| 676 | |
| 677 | : "${extdepends:=$(_resolve_extension_deps "$extname")}" |
| 678 | depends="$depends $extdepends" |
| 679 | |
| 680 | local load_order=$(_extension_load_order "$extname") |
| 681 | |
| 682 | # extension prefix |
| 683 | local prefix= |
| 684 | [ "$extname" != "opcache" ] || prefix="zend_" |
| 685 | |
| 686 | amove $_extension_dir/$extname.so |
| 687 | |
| 688 | mkdir -p "$subpkgdir"/$_extension_confd |
| 689 | echo "${prefix}extension=$extname" \ |
| 690 | > "$subpkgdir"/$_extension_confd/"$(printf %02d $load_order)"_$extname.ini |
| 691 | } |
| 692 | |
| 693 | # Resolves dependencies of the given extension name (without $pkgname- prefix) |
| 694 | # on other extensions in $_extensions and prints them with $pkgname- prefix. |
| 695 | _resolve_extension_deps() { |
| 696 | local name="$1" |
| 697 | |
| 698 | # We use config.w32 just because it's more accurate than config.m4. |
| 699 | local config="$builddir/ext/$name/config.w32" |
| 700 | [ -f "$config" ] || return 0 |
| 701 | |
| 702 | sed -En "s/.*ADD_EXTENSION_DEP\('$name', ([^)]+)\).*/\1/p" "$config" \ |
| 703 | | tr -d "'," | tr ' ' '\n' \ |
| 704 | | sort -u \ |
| 705 | | while read -r dep; do |
| 706 | if echo "$_extensions" | grep -qw "$dep"; then |
| 707 | echo "$pkgname-$dep" |
| 708 | fi |
| 709 | done |
| 710 | } |
| 711 | |
| 712 | # Prints a load order (0-based integer) for the given extension name. Extension |
| 713 | # with lower load order should be loaded before exts with higher load order. |
| 714 | # It's based on number of dependencies of the extension (with exception for |
| 715 | # "imap"), which is flawed, but simple and good enough for now. |
| 716 | _extension_load_order() { |
| 717 | local name="$1" |
| 718 | local deps=$(eval "echo \$_depends_$name") |
| 719 | |
| 720 | case "$name" in |
| 721 | # XXX: This must be loaded after recode, even though it does |
| 722 | # not depend on it. So we must use this hack... |
| 723 | *) echo "${deps:=$(_resolve_extension_deps $name)}" | wc -w;; |
| 724 | esac |
| 725 | } |
| 726 | |
| 727 | # Prints $_extensions sorted by load order and name. |
| 728 | _extensions_by_load_order() { |
| 729 | local deps list name |
| 730 | |
| 731 | for name in $_extensions; do |
| 732 | list="$list $(_extension_load_order $name);$name" |
| 733 | done |
| 734 | printf '%s\n' $list | sort -t ';' -k 1 | sed -E 's/\d+;//' |
| 735 | } |
| 736 | |
| 737 | sha512sums=" |
| 738 | 7d24948b22e63268e728d9719e4b3f83496313ec5b47130a3eab109ce7b67447b581792d7384018aaccd5188a0614000ade444ef6adc853f49d2aa043bde4b12 php-8.1.34.tar.xz |
| 739 | 7dc9f55b12998355a6a6b5cf277285058e66928215f8d0109448d06fb696a74c674f83d18a81bf03f4f0bee06e77979e9a4ee5c81c7fdebff91447f8e697cc69 php81-fpm.initd |
| 740 | 98bb27864f1ece80fef18cb286885c8c18de8f9d1076507b6a24df07e33aa400623b90401375e7ebe55d9ff802069d281642ec7d3a58ef8727121aabe7643241 php81-fpm.logrotate |
| 741 | 2e3b22b4adbc81c6120757095c89e56642f3e8bf7724af2926f2667759ef082cdcff416334aad87f704a61fcb5b2c11830f17759ac771a3dd4e47d9bc5c7cf72 php81-module.conf |
| 742 | 549824a9319d826a12ca950f82661ec93e3c1b9af71e5c3c48e4889a9fbd4b06031af7d21119cc183e04e6c4aefe9ad4c5c43cec90aab96f2a09b4030871cf9a disabled-tests.list |
| 743 | 50c17583cb23891515df85eb2fffd623c2c95738cdd7cac1b39e205431b68ebf7329f1d1eb4c191cf0a6ac88cfd89f37f5710a863afbd313d7028d41c82019c9 disabled-tests.ppc64le.list |
| 744 | 378db19d08cec29c4e56f2c82ee0a99b31e5ec3eaac56c40597de442da36a4d7efcc7551577e37a6ca22649d612d42714c93e16e3f7579aeb85a44090bde80fc disabled-tests.riscv64.list |
| 745 | 54930246f22034e6a73020aa95915d14b2a2fcfe121df57eb17fdc663aceeb94c5c4b1800347149a8fb4eaa0edda4224a11133bdb7e0cd34a2065a2de121db0d disabled-tests.s390x.list |
| 746 | 6d3bc15982e13ec4c065b6445e07818d589f2cc677147a57929d1739b3e6b119cc9be6a07d3a99bb5e989e47a62fa6047f967c3c962253845d4bab224b378db3 disabled-tests.x86.list |
| 747 | be3184e07ed3e12b0982b2ed68f12852dbff706031def4be76b89ecad51c23cf2bd4bbf7138b6d83252af4343de0b693724fac9b188941beb5e7cd89af9b07ee disabled-tests.loongarch64.list |
| 748 | ec206639d076ddac6c2d1db697a5428ed3be979157db39417af7fbe6ab837e8dc00315ae0e55aea4f92f45ca5827c88cc4933099fad9c962f029ca81bef779d7 install-pear.patch |
| 749 | e88ad17895742b74019912ad45c90af74817d75d7e1f71bd3d4a180b5f710a25d3c73c7410394f415eee0f428a8c5a0ea3702009ef9d2bffdebdd5da748f8b9b includedir.patch |
| 750 | 8db38c523a8e0ed64298661d328372ea33ba0a56d23c023299ad94ee43a6db8c49393efcb679e74bbb936383dcacebdfb440bbacdf74068d78d071dd3f795101 sharedir.patch |
| 751 | f43ab399c3b4a2b9a3a329acd32d9cbc690cad697dd0a0e87f3d654028b88af7dd1cd80cbf970c6fe95a44d9b24646640bb4cc9eba15f36afc171504f1060066 php81-fpm-version-suffix.patch |
| 752 | 1b64a7cef9e81387f955cb60ffa4e3d2277b4f6072e9328d779c0d447c202c8ee9dff0d8d8c34abc82c150311f51c4e9316a3b72a383ca6c9a6e683bc5b349a0 fix-tests-devserver.patch |
| 753 | 73ad23e675c336b7607ff99fc3a3ffdb381779411c5503ef5a353ad43607070d889e441800abc54080d6be42032e94c3884d05d3bfbc46e5dda93b5e10fc40f7 fix-lfs64.patch |
| 754 | 10c8da2e2ff24903c012b4df4f1fd7ed739429d0630260c398ed255cb45589ee170c29af09f5f57202a5fe37d4e82669196c813a5b916b7f2be2d46e9bfd1d85 fix-s390x-test.patch |
| 755 | 16d283ac2373442f2fbbca4968df92e0114454c7645a797f1f04af27e546293f3312d45aef049357057facd4fb62339ebfe7f59e65d4278910c4195d873955d1 fix-icu74.patch |
| 756 | 517441fdf14b7855b1843bd0d1c86126017af7a340fbf7177202db7c9e67912332abdb62e7477f45e7922c910672396ba4f953eb7dc052ed06624c682bd12791 loongarch64-support-for-fibers.patch |
| 757 | f25e4ac7b4a4d286a9a1c9f4da4441c218d23cde6717466a12295a927a70b3a9c4f3d0b62f798196dc5c9edcc43d985ababe5d1d25779d964af2df0d5ee54ce1 fix-pear.patch |
| 758 | a043374289211c50c74fc6b52288558424e43c235ffa3c461eec40ad63800fb87e836b64318c99727df15af3cc51ff073ab1e25da431592ebde1e254a1930d9c fix-pcre.patch |
| 759 | 270b8890cb2e1036b1d0acf8b1d4fc1ff629fd8e96e3f334d17c4e94b7c283b21c66cbc5e55daf02d0f1cb8ca9bffc77ae528349fcdd742a6522baf683346fa3 fix-curl.patch |
| 760 | 526f54b9e37043d546838e63ca4476184b11133f8f3b575b693b3e417151c233efa0f279fa9f886eb833ccbb9c170924183a232a1f6c9ba58c9d8b02568f359d fix-ftp-expired-cert.patch |
| 761 | 1f32c10112f27d389a6a3953e82b2a0476695af869352619399b79ed34f3224a35de58e5c4f9f5e9fc67cfc475f2dd069f25cf3175ac45798fe0f4343bff9306 GHSA-m8rr-4c36-8gq4.patch |
| 762 | 1a64380d8bce22655d31f718de9c86d0cdd9edf8d89c53033d3d21f592e3211ba3016e8fd7209ac1b0d6293a40ea60b24954d1f4e17a5f82e7722fb3c8e22a3c GHSA-96wq-48vp-hh57.patch |
| 763 | 89de8e3fece6df62ac4e67ae57c0a3c8c94ff92c081d755419928782f8f858915c158542085c89af5d94460d72a00361df02c451202fd1faa7ff6638a06f8865 GHSA-wm6j-2649-pv75.patch |
| 764 | 1b5c1fa8c0e71ce224d8d0056bdebc629ff0712ac5d3ba14faa9b159fe99d7b24056c7ed28b920cdc217d9ba6d22059924ebb9e3972380cf8e034f8912b8f556 GHSA-7qg2-v9fj-4mwv.patch |
| 765 | 659f46c9771d4fecc9b0376319e02551e6080df47799adca4472a9e01e7c35bb94b00aac9320782abe70a1239b7ff4907f0dd556aea7cdd9132238e6f5c73529 GHSA-hmxp-6pc4-f3vv.patch |
| 766 | 3028c89af0f0aac4efafed2ca27b00920ed82f1af6868d1961f8d69b85d9de978f6e881d79e3fcf57a86d61f8683df5a74cd6db1be5266bf6f4fada2e7986885 GHSA-m33r-qmcv-p97q.patch |
| 767 | a639b8c93fc44a6333efbff01bb3843727c519f4cfc5cccfe3869a73753c293de454de744422c6dbc3bb3f8ab7eca1f4a17dfa38a2daa5a8074721b2bf59eb8d GHSA-85c2-q967-79q5.patch |
| 768 | 55d8c17f014731d0cd2b8f532d94e35728565aa738977f24ba27ffe455a7bfe0a7e6e99f480bb5798aefbe50c723d9a31f2bc3f1e871137ff47d6d9bdf0a8b03 GHSA-8.2.32.patch |
| 769 | 565a9f5f124a9ad7d123cdbb1898cf224cead2a71c49b157eac53ab4e17bd1b2166dad963276c162c2a81cd5483a16f639b19c9b06e43a590be9a2ce30e57eb8 CVE-2026-9672.patch |
| 770 | 7fca22944646b2d9fc3618ae857266cb2c765a1ce9a6c57cdc9f36c35504e99b5baa6368f35358efac49740cac1c522df63e2b69c43e22e092aaf036be4e372a GHSA-7qpv-r5mr-78m4.patch |
| 771 | 6d845bd9344891ed1e18d522aafdb98e4d48f728df8bbd5e34b0296571a9ba42e35077de0dc2ba8ed36314063bc6b127b1b53d6e959df84c8800d32185880313 GHSA-vc5h-9ppw-p5f3.patch |
| 772 | 28cae12a42cae8aa0a56d45bf5641ec56b877fd5844b24c532a5017dd5b3e2564a18b14e76319074a37b47ee52c9f01ad5d9d2a9537eba3cbb55e38ad3f35c35 fix-dateperiod-double-construct-leak.patch |
| 773 | 3e657ef71163c47c146eb1b4d4392a61c2853285ead1463b246a865d42ac07438e69237ff54e93c86a7a3ff6ba421d8d7fca06cac538cdf9bd50f750db0fa866 GHSA-88hq-2827-7pg6.patch |
| 774 | 2985384cd638dd4b14e1ca67a69527a23779860d5551b7012d4a713d8781f2ecd9aa53f603c195106b0a0d425ce72ffcb912bdd88602e3fb93697e11ce115b56 GHSA-62xp-839h-2637.patch |
| 775 | 494a15446bf743af74f36ab04e846560693ea8b195f346466a452dd3fff7772debabc7cfa7250fa4189d07923d3a3456dc69aa27c022cb28a6a120f361ca3630 GHSA-vvx9-73fr-5jjx.patch |
| 776 | 0c101fb631278b366b8daa9f0fb2f010d5916072df298162a37c164abc9e7562bf434141b3c217483c24f280994e275624473aeb2a014476a477b06af99bb161 GHSA-xr7j-rvgx-xq5p.patch |
| 777 | 5b5efb95fb39abaaf934149fa233f7790f01b3fa251fc0eee9d1dec2b1ea34407f4c3bc21897d86af994c291d6031d5004481c4dbc42cd08641f00cd0a155490 GHSA-r6x9-5r99-36j7.patch |
| 778 | 71a676928bcdba74920ecd4b4d31803a2898a191fa4927d347291284d711434e29273a0a24b03a380d403d659610a128d5a0fd0626cc16926bba9fb95b1bcb23 GHSA-fpwc-w8rq-cr92.patch |
| 779 | ee844ec10918b22824364caefe1859e1ebd2a3d8098e34ce7ecfadfc56457141a7a5956834cbee7a6546b6d68e2799ea83a54d92df593d46a1140ff968052139 GHSA-rgrp-mwpx-f6rm.patch |
| 780 | d0ee9c9811336c03272b3b08fd1428c046604732740af6aad682c2b3e6218a115363a5014f6f4297c76b4a3d8242503f0a4df423b0696b177aa1d68988a33a08 GHSA-cj93-vc83-wgqv.patch |
| 781 | 1d5c4ef5882b9aeb98c1857466593b3ecbf7a3858bafe135b332e618fd4591c4ede4361b8c29b0cc374a01ee2c1f7c029872e3355ab5e32a74516c29c81156aa GHSA-j3wh-g957-2m85.patch |
| 782 | 2274a847c7348fd6f1a902860043841b181933f4b1dccdf06d512fd8589599fc3a4f62d16d0fc9fd249f73bf2e1d2d90b38829f3c6c2c2ad72b847377f364ba9 GHSA-ch8v-r6jh-4vvr.patch |
| 783 | 92fadafe870633568ac067838985e225d883a5b51f3d0439e568f2f1c385b7fb76f250a9dc5e961a3e0fbc096fc3a09c7d92d05bff4534df2a5c6d9d5c7500d3 GHSA-7875-c8px-7q5f.patch |
| 784 | c1ca70ac4eefbe09d9be7e02d01c06d5329e9a8e8559f2c25a9d5e45092e24e51c6dd5ab5feb9ab3fd0c7ff3f1192d97662e94f592248d3f29f14011b9a369d3 GHSA-7875-c8px-7q5f-regression.patch |
| 785 | 7276a613caae5bb6705616b5aa1ba5db320a5eab6bd66095bdc823c44c519b048020e4fb9385082b1bfc17bf57603a5900cf88aff2e1cd8951f5f997c513cf2f GHSA-cj93-vc83-wgqv-test.patch |
| 786 | 0878a24297604b0021b2c53a9d319ee0b438ac861bf32f7e1201d653ae1bbe021b99ba201891f8d88e9f3a5928708fdbdfb4a15bc102272494acfb663818fcde GHSA-62xp-839h-2637-tests.patch |
| 787 | efc580bb21325509592e798bccdc9eb5fc30ae98d8c633cdfe720aa16f2439ae0e6238ffbe088acf453193c210f02341de92cbd2849862b2a0219eacae029d38 openssl-tests-worker-ini.patch |
| 788 | " |