Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
@ 2022-08-08 16:45 TinfoilSubmarine
  2022-08-08 23:37 ` paper42
                   ` (48 more replies)
  0 siblings, 49 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-08 16:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

There is a new pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 14638 bytes --]

From d1ccca853c7c68f285d172e37385768e7c9586ae Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 1/6] php: add php alternatives group.

---
 srcpkgs/php/template | 40 ++++++++++++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a15151a6512e 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,7 +1,8 @@
 # Template file for 'php'
 pkgname=php
 version=7.4.30
-revision=2
+revision=3
+_php_version=7.4
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
  gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
@@ -34,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -47,6 +56,7 @@ do_build() {
 		--disable-rpath \
 		--mandir=/usr/share/man \
 		--with-pear=/usr/share/pear \
+		--program-suffix=${_php_version} \
 		"
 
 	local _phpextensions="--enable-bcmath=shared \
@@ -106,7 +116,7 @@ do_build() {
 		${configure_args} \
 		"
 	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php/modules"
 	fi
 
 	EXTENSION_DIR=/usr/lib/php/modules
@@ -145,7 +155,7 @@ do_install() {
 	cd ${wrksrc}/build
 	local _env="INSTALL_ROOT=${DESTDIR}"
 	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
+		_env+=" PHAR_PHP=/usr/bin/php${_php_version}"
 	fi
 	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
 
@@ -157,19 +167,27 @@ do_install() {
 
 php-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
+		vmove "usr/bin/php-config${_php_version}"
+		vmove "usr/bin/phpize${_php_version}"
+		vmove "usr/share/man/man1/phpize${_php_version}.1"
+		vmove "usr/share/man/man1/php-config${_php_version}.1"
 	}
 }
 
 php-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -179,6 +197,9 @@ php-phpdbg_package() {
 php-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -199,6 +220,9 @@ php-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php-${version}_${revision}"
 	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,7 +249,7 @@ php-pear_package() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR}"
 		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
 		fi
 		make install-pear ${_env}
 		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}

From 0b5e3dfce9d9f0a5b9aff9af0e8ba04f1f72df60 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/6] php8.0: update to 8.0.22

Add php alternatives group.
---
 srcpkgs/php8.0/template | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 48c8f2d386cc..608a66e60242 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,6 +1,6 @@
 # Template file for 'php8.0'
 pkgname=php8.0
-version=8.0.21
+version=8.0.22
 revision=1
 _php_version=8.0
 wrksrc="php-${version}"
@@ -16,7 +16,7 @@ license="PHP-3.01"
 homepage="https://www.php.net"
 changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
-checksum=2f51f6e90e2e8efd3a20db08f0dd61d7f8d5a9362f8c7325f1ad28ccea5be0ac
+checksum=56fce7529a9798fd0895bca3539d2a65b9cac5d23ffbdf6338419c62ed083519
 
 conf_files="/etc/php${_php_version}/php.ini"
 
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 3d4d63686b37e37e5b50427d1952e6f0c2c66ef5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 3/6] php8.1: update to 8.1.9.

Add php alternatives group.
---
 srcpkgs/php8.1/template | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index c307e3315505..ddd662aa01f4 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,6 +1,6 @@
 # Template file for 'php8.1'
 pkgname=php8.1
-version=8.1.8
+version=8.1.9
 revision=1
 _php_version=8.1
 wrksrc="php-${version}"
@@ -16,7 +16,7 @@ license="PHP-3.01"
 homepage="https://www.php.net"
 changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
-checksum=889d910558d2492f7f2236921b9bcde620674c8b684ec02d126060f8ca45dc8d
+checksum=954cf77f7e0a70dc765e7639acdfdccd164be5cd1bce3dbe9d10c58dca631e76
 
 conf_files="/etc/php${_php_version}/php.ini"
 
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 10156988e9f89ebbb68a7d9439e012aa2885bb20 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 4/6] composer: update to 2.3.10.

Add composer alternatives group.
---
 srcpkgs/composer/files/composer7.4 | 2 ++
 srcpkgs/composer/template          | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/composer/files/composer7.4

diff --git a/srcpkgs/composer/files/composer7.4 b/srcpkgs/composer/files/composer7.4
new file mode 100644
index 000000000000..52db75d49a47
--- /dev/null
+++ b/srcpkgs/composer/files/composer7.4
@@ -0,0 +1,2 @@
+#!/bin/sh
+php7.4 -f /usr/libexec/composer.phar7.4 "$@"
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..f28f498c4e80 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,6 +1,6 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=2.3.10
 revision=1
 build_style=fetch
 depends="php"
@@ -11,11 +11,14 @@ homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
 distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
+checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer7.4"
 
 do_install() {
-	vbin composer.phar composer
+	vbin ${FILESDIR}/composer7.4
+
+	vinstall composer.phar 644 usr/libexec composer.phar7.4
 	vlicense LICENSE
 
 	vmkdir /etc/php/conf.d

From 616a67f8175db87242039b9f024432a9f16ed322 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 5/6] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index ac5fc310df4a..602557d016f3 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.3.10
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 471ceed4fd0865cf975111cb5caa17863ff7b230 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 6/6] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index e78c09bd575f..302c5fbb6e4e 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.3.10
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
@ 2022-08-08 23:37 ` paper42
  2022-08-09 18:08 ` Chocimier
                   ` (47 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-08-08 23:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1208728017

Comment:
I think this is a bit too fragile and we should wait with this for php 7.4 EOL which should be in November. Which /usr/bin/php gets chosen when the user has php (7) and php8.0 installed? Are we sure it always works as expected and won't break the setup for some users who rely on /usr/bin/php being php7, etc?

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
  2022-08-08 23:37 ` paper42
@ 2022-08-09 18:08 ` Chocimier
  2022-08-09 18:43 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (46 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: Chocimier @ 2022-08-09 18:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1209708881

Comment:
It does not work correctly: 

before:

    composer --version
    Composer version 2.2.4 2022-01-08 12:30:42

after:

    composer --version
    PHP 7.4.30 (cli) (built: Aug  9 2022 17:56:39) ( NTS )
    Copyright (c) The PHP Group
    
    composer -h       
    Usage: php [options] [-f] <file> [--] [args...]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
  2022-08-08 23:37 ` paper42
  2022-08-09 18:08 ` Chocimier
@ 2022-08-09 18:43 ` TinfoilSubmarine
  2022-08-09 18:45 ` TinfoilSubmarine
                   ` (45 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-09 18:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 15419 bytes --]

From aafecebe0187239b7fa5aace10050cc7b0b1510a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 1/6] php: add php alternatives group.

---
 srcpkgs/php/template | 40 ++++++++++++++++++++++++++++++++--------
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a15151a6512e 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,7 +1,8 @@
 # Template file for 'php'
 pkgname=php
 version=7.4.30
-revision=2
+revision=3
+_php_version=7.4
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
  gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
@@ -34,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -47,6 +56,7 @@ do_build() {
 		--disable-rpath \
 		--mandir=/usr/share/man \
 		--with-pear=/usr/share/pear \
+		--program-suffix=${_php_version} \
 		"
 
 	local _phpextensions="--enable-bcmath=shared \
@@ -106,7 +116,7 @@ do_build() {
 		${configure_args} \
 		"
 	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php/modules"
 	fi
 
 	EXTENSION_DIR=/usr/lib/php/modules
@@ -145,7 +155,7 @@ do_install() {
 	cd ${wrksrc}/build
 	local _env="INSTALL_ROOT=${DESTDIR}"
 	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
+		_env+=" PHAR_PHP=/usr/bin/php${_php_version}"
 	fi
 	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
 
@@ -157,19 +167,27 @@ do_install() {
 
 php-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
+		vmove "usr/bin/php-config${_php_version}"
+		vmove "usr/bin/phpize${_php_version}"
+		vmove "usr/share/man/man1/phpize${_php_version}.1"
+		vmove "usr/share/man/man1/php-config${_php_version}.1"
 	}
 }
 
 php-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -179,6 +197,9 @@ php-phpdbg_package() {
 php-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -199,6 +220,9 @@ php-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php-${version}_${revision}"
 	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,7 +249,7 @@ php-pear_package() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR}"
 		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
 		fi
 		make install-pear ${_env}
 		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}

From 763389b4aa8cb21ced49cc22a6bc0aa30d3d9cdc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/6] php8.0: update to 8.0.22

Add php alternatives group.
---
 srcpkgs/php8.0/template | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 48c8f2d386cc..608a66e60242 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,6 +1,6 @@
 # Template file for 'php8.0'
 pkgname=php8.0
-version=8.0.21
+version=8.0.22
 revision=1
 _php_version=8.0
 wrksrc="php-${version}"
@@ -16,7 +16,7 @@ license="PHP-3.01"
 homepage="https://www.php.net"
 changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
-checksum=2f51f6e90e2e8efd3a20db08f0dd61d7f8d5a9362f8c7325f1ad28ccea5be0ac
+checksum=56fce7529a9798fd0895bca3539d2a65b9cac5d23ffbdf6338419c62ed083519
 
 conf_files="/etc/php${_php_version}/php.ini"
 
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From bf906f32e9d384cee6e4f7606ffa91dec9712343 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 3/6] php8.1: update to 8.1.9.

Add php alternatives group.
---
 srcpkgs/php8.1/template | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index c307e3315505..ddd662aa01f4 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,6 +1,6 @@
 # Template file for 'php8.1'
 pkgname=php8.1
-version=8.1.8
+version=8.1.9
 revision=1
 _php_version=8.1
 wrksrc="php-${version}"
@@ -16,7 +16,7 @@ license="PHP-3.01"
 homepage="https://www.php.net"
 changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
-checksum=889d910558d2492f7f2236921b9bcde620674c8b684ec02d126060f8ca45dc8d
+checksum=954cf77f7e0a70dc765e7639acdfdccd164be5cd1bce3dbe9d10c58dca631e76
 
 conf_files="/etc/php${_php_version}/php.ini"
 
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 74896736bf1310e43034232b7ada5e5ab7eb98e7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 4/6] composer: update to 2.3.10.

Add composer alternatives group.
---
 srcpkgs/composer/files/composer7.4 | 2 ++
 srcpkgs/composer/template          | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/composer/files/composer7.4

diff --git a/srcpkgs/composer/files/composer7.4 b/srcpkgs/composer/files/composer7.4
new file mode 100644
index 000000000000..1f977284adf4
--- /dev/null
+++ b/srcpkgs/composer/files/composer7.4
@@ -0,0 +1,2 @@
+#!/bin/sh
+php7.4 /usr/libexec/composer.phar7.4 "$@"
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..f28f498c4e80 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,6 +1,6 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=2.3.10
 revision=1
 build_style=fetch
 depends="php"
@@ -11,11 +11,14 @@ homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
 distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
+checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer7.4"
 
 do_install() {
-	vbin composer.phar composer
+	vbin ${FILESDIR}/composer7.4
+
+	vinstall composer.phar 644 usr/libexec composer.phar7.4
 	vlicense LICENSE
 
 	vmkdir /etc/php/conf.d

From 24787771a8291fb2f2721ca3976d13dca40f92a8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 5/6] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/files/composer8.0 | 2 +-
 srcpkgs/composer8.0/template          | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
index 2a3236b4a5ff..1a70e9dcde46 100644
--- a/srcpkgs/composer8.0/files/composer8.0
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -1,2 +1,2 @@
 #!/bin/sh
-php8.0 -f /usr/libexec/composer.phar8.0 "$@"
+php8.0 /usr/libexec/composer.phar8.0 "$@"
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index ac5fc310df4a..602557d016f3 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.3.10
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From efda04bdad68a4a5440b4e102ecba8d199f4779a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 6/6] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/files/composer8.1 | 2 +-
 srcpkgs/composer8.1/template          | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
index a3f41b8b5578..a42b58d7bf15 100644
--- a/srcpkgs/composer8.1/files/composer8.1
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -1,2 +1,2 @@
 #!/bin/sh
-php8.1 -f /usr/libexec/composer.phar8.1 "$@"
+php8.1 /usr/libexec/composer.phar8.1 "$@"
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index e78c09bd575f..302c5fbb6e4e 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.3.10
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (2 preceding siblings ...)
  2022-08-09 18:43 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-08-09 18:45 ` TinfoilSubmarine
  2022-08-29 12:37 ` [PR PATCH] [Updated] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: " TinfoilSubmarine
                   ` (44 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-09 18:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1209750393

Comment:
> It does not work correctly:
> 
> before:
> 
> ```
> composer --version
> Composer version 2.2.4 2022-01-08 12:30:42
> ```
> 
> after:
> 
> ```
> composer --version
> PHP 7.4.30 (cli) (built: Aug  9 2022 17:56:39) ( NTS )
> Copyright (c) The PHP Group
> 
> composer -h       
> Usage: php [options] [-f] <file> [--] [args...]
> ```

Should be fixed, I dropped the `-f` from `/usr/bin/composer${_php_version}`

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (3 preceding siblings ...)
  2022-08-09 18:45 ` TinfoilSubmarine
@ 2022-08-29 12:37 ` TinfoilSubmarine
  2022-08-29 12:49 ` TinfoilSubmarine
                   ` (43 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 12:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 37562 bytes --]

From b43415bb525c2ded41fa5de765d5b60c441bfa05 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 1/6] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 332 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 43 insertions(+), 621 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a958bfc070ca 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,105 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
 
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From 855c72a2ce1d03f04382690250db4f245543cc40 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 2/6] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..692365205536 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,15 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="comoser${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
 license="MIT"
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
 
 do_install() {
-	vbin composer.phar composer
 	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
 }

From 379f9217fb70718cc05e3db7dba892879e659249 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 3/6] php8.0: add php alternatives group.

---
 srcpkgs/php8.0/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..e13e69dcffa5 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 17f4731586438592e90a3df36d970743ddbd764d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 4/6] php8.1: add php alternatives group.

---
 srcpkgs/php8.1/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..9132bfa16b1b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From bd085a9e359c8b98bacd5c0ca52ad6b763db9090 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 5/6] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From fcbf96129aa09959bbd3505c73abf7865bb6cfd4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 6/6] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (4 preceding siblings ...)
  2022-08-29 12:37 ` [PR PATCH] [Updated] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: " TinfoilSubmarine
@ 2022-08-29 12:49 ` TinfoilSubmarine
  2022-08-29 12:58 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
                   ` (42 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 12:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1230242989

Comment:
So, the one thing that I'm unsure of is for composer. Currently, there is a package for each PHP version with a shim script to invoke composer with the right interpreter:
https://github.com/void-linux/void-packages/blob/b1800a91d5d6054e6981eccdfdde0979d059448b/srcpkgs/composer8.0/files/composer8.0#L2
https://github.com/void-linux/void-packages/blob/b1800a91d5d6054e6981eccdfdde0979d059448b/srcpkgs/composer8.1/files/composer8.1#L2

This could also be handled by having a single composer package with the shim script, but call `php` which is handled by alternatives. But I think that may be confusing since it isn't as explicit.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (5 preceding siblings ...)
  2022-08-29 12:49 ` TinfoilSubmarine
@ 2022-08-29 12:58 ` TinfoilSubmarine
  2022-08-29 13:10 ` TinfoilSubmarine
                   ` (41 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 12:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 37563 bytes --]

From 8691113d1e7b31ce74b787f2c6d588c2cdc9755c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 1/6] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 332 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 43 insertions(+), 621 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a958bfc070ca 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,105 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
 
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From c4cebf1f56c87cadc514b153c5b43ff356926a55 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 2/6] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..2c1105f956e9 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,15 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="composer${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
 license="MIT"
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
 
 do_install() {
-	vbin composer.phar composer
 	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
 }

From 4e46df0161f67ac5bd19ba99a88ffbc0fddf162c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 3/6] php8.0: add php alternatives group.

---
 srcpkgs/php8.0/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..e13e69dcffa5 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From b0900d5bd950e2fca7a21a7fa657530a7416ad94 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 4/6] php8.1: add php alternatives group.

---
 srcpkgs/php8.1/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..9132bfa16b1b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From d8544089ca9d9470dd0083c85e71271516e39bfa Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 5/6] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 230f30f2401a7721025c0a95457567ba1f7849b4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 6/6] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (6 preceding siblings ...)
  2022-08-29 12:58 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
@ 2022-08-29 13:10 ` TinfoilSubmarine
  2022-08-29 13:18 ` TinfoilSubmarine
                   ` (40 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 13:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 45573 bytes --]

From 8691113d1e7b31ce74b787f2c6d588c2cdc9755c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 01/10] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 332 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 43 insertions(+), 621 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a958bfc070ca 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,105 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
 
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From aac006b33e64e3c8e055a39fe58be6c6d04a87f5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 02/10] php-apcu: turn into meta package

7.4 is EOL
---
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 +++++-----------------------
 2 files changed, 5 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg

diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
index 16c7b707761e..25ba3264f76d 100644
--- a/srcpkgs/php-apcu/template
+++ b/srcpkgs/php-apcu/template
@@ -1,28 +1,10 @@
 # Template file for 'php-apcu'
 pkgname=php-apcu
-version=5.1.17
-revision=2
-wrksrc="apcu-${version}"
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-apcu"
+short_desc="PHP in-memory key-value store meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=6b11b477890a9c096ad856e0251920d1d8b9558b7d115256c027e0223755c793
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From e1b9e6b15e039583fc9ef415208ec0f1e56f5a3e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 03/10] php-ast: turn into meta package

7.4 is EOL
---
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 18 ++++--------------
 2 files changed, 4 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg

diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
index 2d63572004f6..66851ccc5af5 100644
--- a/srcpkgs/php-ast/template
+++ b/srcpkgs/php-ast/template
@@ -1,24 +1,14 @@
 # Template file for 'php-ast'
 pkgname=php-ast
-version=1.0.6
+version=8.1
 revision=1
-wrksrc="ast-${version}"
-build_style=gnu-configure
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
+build_style=meta
+depends="php${version}-ast"
+short_desc="PHP abstract syntax tree meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=70347b04d5ab6223106bb098483a74ac0aa23e3e7fd41549ae95d56ccb15631e
-
-pre_configure() {
-	phpize
-}
 
 do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }

From a7ce36cd9998a9e1879f7756917335d3ebcc66de Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 04/10] php-igbinary: turn into meta package

7.4 is EOL
---
 srcpkgs/php-igbinary/template | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
index d969703a7c37..4b66ba9465c9 100644
--- a/srcpkgs/php-igbinary/template
+++ b/srcpkgs/php-igbinary/template
@@ -1,24 +1,14 @@
 # Template file for 'php-igbinary'
 pkgname=php-igbinary
-version=3.1.2
+version=8.1
 revision=1
-wrksrc="igbinary-${version}"
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
+build_style=meta
+depends="php${version}-igbinary"
+short_desc="PHP igbinary drop-in replacement serializer meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=e78b327dad5397ed42f7b0c6fe017eddcde8c3c24ab8b59562cb691c411fa90b
-
-pre_configure() {
-	phpize
-}
 
 do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
 	vlicense COPYING
 }

From 6495d7ca5b959a38038432c70a084564afba1fe8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 05/10] php-imagick: turn into meta package

7.4 is EOL
---
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 -----------
 srcpkgs/php-imagick/template                  | 28 ++++---------------
 3 files changed, 5 insertions(+), 43 deletions(-)
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch

diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
index 6dc33ff938bd..fce0f16ce4c7 100644
--- a/srcpkgs/php-imagick/template
+++ b/srcpkgs/php-imagick/template
@@ -1,28 +1,10 @@
 # Template file for 'php-imagick'
 pkgname=php-imagick
-version=3.4.4
-revision=5
-wrksrc="imagick-$version"
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-imagick"
+short_desc="PHP ImageMagick library wrapper meta package"
 maintainer="Alin Dobre <alin.dobre@outlook.com>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From 0614094abc2334388f84a1baaac88759e6a8a4bb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 06/10] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..2c1105f956e9 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,15 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="composer${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
 license="MIT"
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
 
 do_install() {
-	vbin composer.phar composer
 	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
 }

From 31b794e1bd0e46a469cfa915c17460d358d4e5c6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 07/10] php8.0: add php alternatives group.

---
 srcpkgs/php8.0/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..e13e69dcffa5 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 092a7d6854739b885d60809fae0362aa8a6a3328 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 08/10] php8.1: add php alternatives group.

---
 srcpkgs/php8.1/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..9132bfa16b1b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 1fcab3b4fe672ce79d30299cf19c83ec29892cd8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 09/10] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 739aad39d5a4515db15369c4967530a5a7b35cd1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 10/10] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (7 preceding siblings ...)
  2022-08-29 13:10 ` TinfoilSubmarine
@ 2022-08-29 13:18 ` TinfoilSubmarine
  2022-08-29 13:47 ` TinfoilSubmarine
                   ` (39 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 13:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 47402 bytes --]

From 8691113d1e7b31ce74b787f2c6d588c2cdc9755c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 01/11] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 332 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 43 insertions(+), 621 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a958bfc070ca 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,105 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
 
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From aac006b33e64e3c8e055a39fe58be6c6d04a87f5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 02/11] php-apcu: turn into meta package

7.4 is EOL
---
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 +++++-----------------------
 2 files changed, 5 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg

diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
index 16c7b707761e..25ba3264f76d 100644
--- a/srcpkgs/php-apcu/template
+++ b/srcpkgs/php-apcu/template
@@ -1,28 +1,10 @@
 # Template file for 'php-apcu'
 pkgname=php-apcu
-version=5.1.17
-revision=2
-wrksrc="apcu-${version}"
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-apcu"
+short_desc="PHP in-memory key-value store meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=6b11b477890a9c096ad856e0251920d1d8b9558b7d115256c027e0223755c793
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From e1b9e6b15e039583fc9ef415208ec0f1e56f5a3e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 03/11] php-ast: turn into meta package

7.4 is EOL
---
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 18 ++++--------------
 2 files changed, 4 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg

diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
index 2d63572004f6..66851ccc5af5 100644
--- a/srcpkgs/php-ast/template
+++ b/srcpkgs/php-ast/template
@@ -1,24 +1,14 @@
 # Template file for 'php-ast'
 pkgname=php-ast
-version=1.0.6
+version=8.1
 revision=1
-wrksrc="ast-${version}"
-build_style=gnu-configure
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
+build_style=meta
+depends="php${version}-ast"
+short_desc="PHP abstract syntax tree meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=70347b04d5ab6223106bb098483a74ac0aa23e3e7fd41549ae95d56ccb15631e
-
-pre_configure() {
-	phpize
-}
 
 do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }

From a7ce36cd9998a9e1879f7756917335d3ebcc66de Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 04/11] php-igbinary: turn into meta package

7.4 is EOL
---
 srcpkgs/php-igbinary/template | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
index d969703a7c37..4b66ba9465c9 100644
--- a/srcpkgs/php-igbinary/template
+++ b/srcpkgs/php-igbinary/template
@@ -1,24 +1,14 @@
 # Template file for 'php-igbinary'
 pkgname=php-igbinary
-version=3.1.2
+version=8.1
 revision=1
-wrksrc="igbinary-${version}"
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
+build_style=meta
+depends="php${version}-igbinary"
+short_desc="PHP igbinary drop-in replacement serializer meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=e78b327dad5397ed42f7b0c6fe017eddcde8c3c24ab8b59562cb691c411fa90b
-
-pre_configure() {
-	phpize
-}
 
 do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
 	vlicense COPYING
 }

From 6495d7ca5b959a38038432c70a084564afba1fe8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 05/11] php-imagick: turn into meta package

7.4 is EOL
---
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 -----------
 srcpkgs/php-imagick/template                  | 28 ++++---------------
 3 files changed, 5 insertions(+), 43 deletions(-)
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch

diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
index 6dc33ff938bd..fce0f16ce4c7 100644
--- a/srcpkgs/php-imagick/template
+++ b/srcpkgs/php-imagick/template
@@ -1,28 +1,10 @@
 # Template file for 'php-imagick'
 pkgname=php-imagick
-version=3.4.4
-revision=5
-wrksrc="imagick-$version"
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-imagick"
+short_desc="PHP ImageMagick library wrapper meta package"
 maintainer="Alin Dobre <alin.dobre@outlook.com>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From ae8c16fe110d4ce19282acde641ef9b58d50ddf9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 06/11] xdebug: turn into meta package

7.4 is EOL
---
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 20 ++++----------------
 srcpkgs/xdebug/update      |  1 -
 3 files changed, 4 insertions(+), 18 deletions(-)
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
index c9b33a8fb79b..4e8bc90cb6be 100644
--- a/srcpkgs/xdebug/template
+++ b/srcpkgs/xdebug/template
@@ -1,26 +1,14 @@
 # Template file for 'xdebug'
 pkgname=xdebug
-version=2.9.3
+version=8.1
 revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
+build_style=meta
+depends="xdebug${version}"
+short_desc="PHP debugging extension meta package"
 maintainer="Alexander Mamay <alexander@mamay.su>"
 license="PHP-3.0"
 homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" php-devel"
-fi
-
-pre_configure() {
-	phpize
-}
 
 do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From 80c0d71b89f61a12964056fcb5d43d18ad298b1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 07/11] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..2c1105f956e9 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,15 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="composer${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
 license="MIT"
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
 
 do_install() {
-	vbin composer.phar composer
 	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
 }

From c6c8e6a1876fc908d0edfd47e956e17230b19ae4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 08/11] php8.0: add php alternatives group.

---
 srcpkgs/php8.0/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..e13e69dcffa5 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 33a54a6717f451ae0ba031ff2ffbbc0e600f7135 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 09/11] php8.1: add php alternatives group.

---
 srcpkgs/php8.1/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..9132bfa16b1b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 04ac0dab357ab32659cdfa2b8ac02af476c9dcf4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 10/11] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From d11da385f49a1900483d2fcc82b9f0fabc9a0f06 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 11/11] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (8 preceding siblings ...)
  2022-08-29 13:18 ` TinfoilSubmarine
@ 2022-08-29 13:47 ` TinfoilSubmarine
  2022-08-29 14:57 ` TinfoilSubmarine
                   ` (38 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 13:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [ ] ampache
- [ ] composer
- [ ] phoronix-test-suite
- [ ] phpMyAdmin

Packages depending on `php-gd`:
- [ ] zabbix-frontend-php

Packages depending on `php-mysql`:
- [ ] zabbix-frontend-php

Other things to take care of:
- [ ] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 47932 bytes --]

From 8691113d1e7b31ce74b787f2c6d588c2cdc9755c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 01/11] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 332 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 43 insertions(+), 621 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..a958bfc070ca 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,105 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
 
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From 2bad8324f666d622ed81cf16b9c23fdc98df8f61 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 02/11] php-apcu: turn into meta package

7.4 is EOL
---
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 +++++-----------------------
 srcpkgs/php-apcu/update      |  2 --
 3 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/update

diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
index 16c7b707761e..25ba3264f76d 100644
--- a/srcpkgs/php-apcu/template
+++ b/srcpkgs/php-apcu/template
@@ -1,28 +1,10 @@
 # Template file for 'php-apcu'
 pkgname=php-apcu
-version=5.1.17
-revision=2
-wrksrc="apcu-${version}"
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-apcu"
+short_desc="PHP in-memory key-value store meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=6b11b477890a9c096ad856e0251920d1d8b9558b7d115256c027e0223755c793
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"

From f4df256d55f83234c895ee531b0359866a77bddf Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 03/11] php-ast: turn into meta package

7.4 is EOL
---
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 24 +++++-------------------
 2 files changed, 5 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg

diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
index 2d63572004f6..9efb854eff2c 100644
--- a/srcpkgs/php-ast/template
+++ b/srcpkgs/php-ast/template
@@ -1,24 +1,10 @@
 # Template file for 'php-ast'
 pkgname=php-ast
-version=1.0.6
+version=8.1
 revision=1
-wrksrc="ast-${version}"
-build_style=gnu-configure
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
+build_style=meta
+depends="php${version}-ast"
+short_desc="PHP abstract syntax tree meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
+license="BSD-3-Clause" # Suppress xlint warning: vlicense
 homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=70347b04d5ab6223106bb098483a74ac0aa23e3e7fd41549ae95d56ccb15631e
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}

From 4f37d57bb7437fb79b1b69a1b18580ae1c9a87fe Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 04/11] php-igbinary: turn into meta package

7.4 is EOL
---
 srcpkgs/php-igbinary/template | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
index d969703a7c37..821688cc1561 100644
--- a/srcpkgs/php-igbinary/template
+++ b/srcpkgs/php-igbinary/template
@@ -1,24 +1,10 @@
 # Template file for 'php-igbinary'
 pkgname=php-igbinary
-version=3.1.2
+version=8.1
 revision=1
-wrksrc="igbinary-${version}"
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
+build_style=meta
+depends="php${version}-igbinary"
+short_desc="PHP igbinary drop-in replacement serializer meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
+license="BSD-3-Clause" # Suppress xlint warning: vlicense
 homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=e78b327dad5397ed42f7b0c6fe017eddcde8c3c24ab8b59562cb691c411fa90b
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}

From b99f679266cc40a00d52dec794ecf305309fa01d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 05/11] php-imagick: turn into meta package

7.4 is EOL
---
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 -----------
 srcpkgs/php-imagick/template                  | 28 ++++---------------
 3 files changed, 5 insertions(+), 43 deletions(-)
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch

diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
index 6dc33ff938bd..fce0f16ce4c7 100644
--- a/srcpkgs/php-imagick/template
+++ b/srcpkgs/php-imagick/template
@@ -1,28 +1,10 @@
 # Template file for 'php-imagick'
 pkgname=php-imagick
-version=3.4.4
-revision=5
-wrksrc="imagick-$version"
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-imagick"
+short_desc="PHP ImageMagick library wrapper meta package"
 maintainer="Alin Dobre <alin.dobre@outlook.com>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From 5c7dca5f1a964d259e0c604ccfb2b42751c2f202 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 06/11] xdebug: turn into meta package

7.4 is EOL
---
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 24 ++++--------------------
 srcpkgs/xdebug/update      |  1 -
 3 files changed, 4 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
index c9b33a8fb79b..ab03c06b6a8d 100644
--- a/srcpkgs/xdebug/template
+++ b/srcpkgs/xdebug/template
@@ -1,26 +1,10 @@
 # Template file for 'xdebug'
 pkgname=xdebug
-version=2.9.3
+version=8.1
 revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
+build_style=meta
+depends="xdebug${version}"
+short_desc="PHP debugging extension meta package"
 maintainer="Alexander Mamay <alexander@mamay.su>"
 license="PHP-3.0"
 homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" php-devel"
-fi
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From 3f39527974763868370f56e8fdd7ef146b8327da Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 07/11] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..f27228a3f869 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,11 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="composer${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
+license="MIT" # Suppress xlint warning: vlicense
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}

From 9fa1a625c5c991883c36a6dd05b2c9c133f21eb9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 08/11] php8.0: add php alternatives group.

---
 srcpkgs/php8.0/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..e13e69dcffa5 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From b2d53d53b7e0de0a19f75652a0d5210e594c710d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 09/11] php8.1: add php alternatives group.

---
 srcpkgs/php8.1/template | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..9132bfa16b1b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm

From 3af15446160f8ba5a328691ba26ff52bb963e741 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 10/11] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 07ee36ff01b48443d16b099a9fcb467ca1a0ca6d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 11/11] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (9 preceding siblings ...)
  2022-08-29 13:47 ` TinfoilSubmarine
@ 2022-08-29 14:57 ` TinfoilSubmarine
  2022-08-30 18:42 ` TinfoilSubmarine
                   ` (37 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-29 14:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [ ] ampache
- [ ] composer
- [ ] phoronix-test-suite
- [ ] phpMyAdmin

Packages depending on `php-gd`:
- [ ] zabbix-frontend-php

Packages depending on `php-mysql`:
- [ ] zabbix-frontend-php

Other things to take care of:
- [ ] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 52449 bytes --]

From a3e5f8f34bed55e3cacda3e55c7c80d11600cfdc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 01/11] php: turn into meta package

7.4 is EOL
---
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 ---
 srcpkgs/php/patches/php-enchant2.patch        | 103 ------
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 ---
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 329 +++---------------
 srcpkgs/php/update                            |   1 -
 13 files changed, 45 insertions(+), 616 deletions(-)
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 3eb8e38cd928..6b75a28242f3 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,351 +1,112 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}"
+short_desc="PHP scripting language meta package"
 maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
 
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	short_desc="PHP FFI module meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"

From c8c902d5427f498fbbf9772b81bf2ed17a8f8492 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 02/11] php-apcu: turn into meta package

7.4 is EOL
---
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 +++++-----------------------
 srcpkgs/php-apcu/update      |  2 --
 3 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/update

diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
index 16c7b707761e..25ba3264f76d 100644
--- a/srcpkgs/php-apcu/template
+++ b/srcpkgs/php-apcu/template
@@ -1,28 +1,10 @@
 # Template file for 'php-apcu'
 pkgname=php-apcu
-version=5.1.17
-revision=2
-wrksrc="apcu-${version}"
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-apcu"
+short_desc="PHP in-memory key-value store meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=6b11b477890a9c096ad856e0251920d1d8b9558b7d115256c027e0223755c793
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 12ec3d570f23545e8b5437a5fcc4569a84a2186f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 03/11] php-ast: turn into meta package

7.4 is EOL
---
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 24 +++++-------------------
 2 files changed, 5 insertions(+), 21 deletions(-)
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg

diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
index 2d63572004f6..9efb854eff2c 100644
--- a/srcpkgs/php-ast/template
+++ b/srcpkgs/php-ast/template
@@ -1,24 +1,10 @@
 # Template file for 'php-ast'
 pkgname=php-ast
-version=1.0.6
+version=8.1
 revision=1
-wrksrc="ast-${version}"
-build_style=gnu-configure
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
+build_style=meta
+depends="php${version}-ast"
+short_desc="PHP abstract syntax tree meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
+license="BSD-3-Clause" # Suppress xlint warning: vlicense
 homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=70347b04d5ab6223106bb098483a74ac0aa23e3e7fd41549ae95d56ccb15631e
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}

From 228cba723cc5430111074ea24fdf53b2f6d07df7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 04/11] php-igbinary: turn into meta package

7.4 is EOL
---
 srcpkgs/php-igbinary/template | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
index d969703a7c37..821688cc1561 100644
--- a/srcpkgs/php-igbinary/template
+++ b/srcpkgs/php-igbinary/template
@@ -1,24 +1,10 @@
 # Template file for 'php-igbinary'
 pkgname=php-igbinary
-version=3.1.2
+version=8.1
 revision=1
-wrksrc="igbinary-${version}"
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
+build_style=meta
+depends="php${version}-igbinary"
+short_desc="PHP igbinary drop-in replacement serializer meta package"
 maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
+license="BSD-3-Clause" # Suppress xlint warning: vlicense
 homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=e78b327dad5397ed42f7b0c6fe017eddcde8c3c24ab8b59562cb691c411fa90b
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}

From d2e7da7a5d0aada884c3e572a3d0358c2ad0b61e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 05/11] php-imagick: turn into meta package

7.4 is EOL
---
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 -----------
 srcpkgs/php-imagick/template                  | 28 ++++---------------
 3 files changed, 5 insertions(+), 43 deletions(-)
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch

diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
index 6dc33ff938bd..fce0f16ce4c7 100644
--- a/srcpkgs/php-imagick/template
+++ b/srcpkgs/php-imagick/template
@@ -1,28 +1,10 @@
 # Template file for 'php-imagick'
 pkgname=php-imagick
-version=3.4.4
-revision=5
-wrksrc="imagick-$version"
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
+version=8.1
+revision=1
+build_style=meta
+depends="php${version}-imagick"
+short_desc="PHP ImageMagick library wrapper meta package"
 maintainer="Alin Dobre <alin.dobre@outlook.com>"
 license="PHP-3.01"
 homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}

From 4eaf4279b5837c9c1c4731e56874e17df581d75f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 06/11] xdebug: turn into meta package

7.4 is EOL
---
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 24 ++++--------------------
 srcpkgs/xdebug/update      |  1 -
 3 files changed, 4 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
index c9b33a8fb79b..ab03c06b6a8d 100644
--- a/srcpkgs/xdebug/template
+++ b/srcpkgs/xdebug/template
@@ -1,26 +1,10 @@
 # Template file for 'xdebug'
 pkgname=xdebug
-version=2.9.3
+version=8.1
 revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
+build_style=meta
+depends="xdebug${version}"
+short_desc="PHP debugging extension meta package"
 maintainer="Alexander Mamay <alexander@mamay.su>"
 license="PHP-3.0"
 homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" php-devel"
-fi
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From efe44ef8e1b1e60c4b583a1af022b0b253c20da0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 07/11] composer: turn into meta package

7.4 is EOL
---
 srcpkgs/composer/template | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
index 81da2bf03aa2..f27228a3f869 100644
--- a/srcpkgs/composer/template
+++ b/srcpkgs/composer/template
@@ -1,24 +1,11 @@
 # Template file for 'composer'
 pkgname=composer
-version=2.2.4
+version=8.1
 revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
+build_style=meta
+depends="composer${version}"
+short_desc="Composer Dependency manager for PHP meta package"
 maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
+license="MIT" # Suppress xlint warning: vlicense
 homepage="https://getcomposer.org/"
 changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}

From eed2daca3956b6dfe865cea39aa73d6c84dcd3e7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 08/11] php8.0: add php alternatives group and pear.

---
 srcpkgs/php8.0-pear     |  1 +
 srcpkgs/php8.0/template | 54 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 4 deletions(-)
 create mode 120000 srcpkgs/php8.0-pear

diff --git a/srcpkgs/php8.0-pear b/srcpkgs/php8.0-pear
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pear
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..79218295e191 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -23,7 +23,7 @@ conf_files="/etc/php${_php_version}/php.ini"
 lib32disabled=yes
 
 if [ -n "$CROSS_BUILD" ]; then
-	# phar needs php to build
+	# phar, pear need php to build
 	hostmakedepends+=" php${_php_version}"
 	CFLAGS+=" -DHAVE_LIBDL
 		 -DHAVE_DLOPEN
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -90,7 +98,7 @@ do_build() {
 		--with-mysqli=shared,mysqlnd \
 		--with-openssl=shared \
 		--with-external-pcre \
-		--without-pear \
+		--with-pear=/usr/share/pear${_php_version} \
 		--with-pdo-mysql=shared,mysqlnd \
 		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
 		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
@@ -112,7 +120,7 @@ do_build() {
 
 	EXTENSION_DIR="/usr/lib/php${_php_version}/modules"
 	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
+	PEAR_INSTALLDIR=/usr/share/pear${_php_version}
 	export PEAR_INSTALLDIR
 	EXTRA_LIBS="-ldl"
 	export EXTRA_LIBS
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -218,6 +240,30 @@ php8.0-embed_package() {
 	}
 }
 
+php8.0-pear_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PHP Extension and Application Repository'
+	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		local _env="INSTALL_ROOT=${PKGDESTDIR}"
+		if [ -n "$CROSS_BUILD" ]; then
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
+		fi
+		make install-pear ${_env}
+		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
+		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
+		mv ${PKGDESTDIR}/usr/bin/pear{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/peardev{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/pecl{,${_php_version}}
+	}
+}
+
 php8.0-enchant_package() {
 	lib32disabled=yes
 	depends="php${_php_version}-${version}_${revision}"

From 67f78540c332a7e9f4dd70e3765149ad5f6e6837 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:37:33 -0400
Subject: [PATCH 09/11] php8.1: add php alternatives group and pear.

---
 srcpkgs/php8.1-pear     |  1 +
 srcpkgs/php8.1/template | 54 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 4 deletions(-)
 create mode 120000 srcpkgs/php8.1-pear

diff --git a/srcpkgs/php8.1-pear b/srcpkgs/php8.1-pear
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pear
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..6d81b29afdc0 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -23,7 +23,7 @@ conf_files="/etc/php${_php_version}/php.ini"
 lib32disabled=yes
 
 if [ -n "$CROSS_BUILD" ]; then
-	# phar needs php to build
+	# phar, pear need php to build
 	hostmakedepends+=" php${_php_version}"
 	CFLAGS+=" -DHAVE_LIBDL
 		 -DHAVE_DLOPEN
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -90,7 +98,7 @@ do_build() {
 		--with-mysqli=shared,mysqlnd \
 		--with-openssl=shared \
 		--with-external-pcre \
-		--without-pear \
+		--with-pear=/usr/share/pear${_php_version} \
 		--with-pdo-mysql=shared,mysqlnd \
 		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
 		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
@@ -112,7 +120,7 @@ do_build() {
 
 	EXTENSION_DIR="/usr/lib/php${_php_version}/modules"
 	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
+	PEAR_INSTALLDIR=/usr/share/pear${_php_version}
 	export PEAR_INSTALLDIR
 	EXTRA_LIBS="-ldl"
 	export EXTRA_LIBS
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -218,6 +240,30 @@ php8.1-embed_package() {
 	}
 }
 
+php8.1-pear_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PHP Extension and Application Repository'
+	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		local _env="INSTALL_ROOT=${PKGDESTDIR}"
+		if [ -n "$CROSS_BUILD" ]; then
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
+		fi
+		make install-pear ${_env}
+		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
+		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
+		mv ${PKGDESTDIR}/usr/bin/pear{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/peardev{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/pecl{,${_php_version}}
+	}
+}
+
 php8.1-enchant_package() {
 	lib32disabled=yes
 	depends="php${_php_version}-${version}_${revision}"

From 91e0dd89847cef79c5ecee8415a696a43e1cfaa1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 10/11] composer8.0: add composer alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From fb6fe09f23c80fe868ae32d0369dbb5c21340cdf Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:48 -0400
Subject: [PATCH 11/11] composer8.1: add composer alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..476abf9b9b56 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (10 preceding siblings ...)
  2022-08-29 14:57 ` TinfoilSubmarine
@ 2022-08-30 18:42 ` TinfoilSubmarine
  2022-08-30 21:19 ` [PR REVIEW] " paper42
                   ` (36 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-30 18:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1232029560

Comment:
> So, the one thing that I'm unsure of is for composer. Currently, there is a package for each PHP version with a shim script to invoke composer with the right interpreter:
> 
> https://github.com/void-linux/void-packages/blob/b1800a91d5d6054e6981eccdfdde0979d059448b/srcpkgs/composer8.0/files/composer8.0#L2
> 
> https://github.com/void-linux/void-packages/blob/b1800a91d5d6054e6981eccdfdde0979d059448b/srcpkgs/composer8.1/files/composer8.1#L2
> 
> This could also be handled by having a single composer package with the shim script, but call `php` which is handled by alternatives. But I think that may be confusing since it isn't as explicit.

After thinking about this, I think that it's best to keep the separate composer packages, since collapsing into one and relying on xbps-alternatives to choose a php version restricts the utility of having alternatives in the first place. If I want to have both a PHP 8.0 and 8.1 installation on a single machine, I would still like to be able to use composer with both 8.0 and 8.1.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (11 preceding siblings ...)
  2022-08-30 18:42 ` TinfoilSubmarine
@ 2022-08-30 21:19 ` paper42
  2022-08-31 12:41 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (35 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-08-30 21:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r958696597

Comment:
That's not really composer's version, I understand why you did it this way, but this would be confusing. I think making this a subpackage of composer8.1 might be better. (the same applies to all metapackages in this PR)

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (12 preceding siblings ...)
  2022-08-30 21:19 ` [PR REVIEW] " paper42
@ 2022-08-31 12:41 ` TinfoilSubmarine
  2022-08-31 12:44 ` [PR REVIEW] " TinfoilSubmarine
                   ` (34 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-31 12:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [ ] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [ ] phoronix-test-suite (should be able to switch to `php8.1` as changelog indicates it is able to run with 8.1)
- [ ] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [ ] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [ ] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 63413 bytes --]

From a636a94994bacce3d59e98151cc48892e75c6fb8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 1/9] php8.1-apcu: add php-apcu subpackage

7.4 is EOL
---
 srcpkgs/php-apcu             |  1 +
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 ----------------------------
 srcpkgs/php-apcu/update      |  2 --
 srcpkgs/php8.1-apcu/template |  8 +++++++-
 5 files changed, 8 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update

diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..cc955450a456
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php8.1-apcu
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 16c7b707761e..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.17
-revision=2
-wrksrc="apcu-${version}"
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=6b11b477890a9c096ad856e0251920d1d8b9558b7d115256c027e0223755c793
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
index 60d5ca79143d..56e4d2c1be52 100644
--- a/srcpkgs/php8.1-apcu/template
+++ b/srcpkgs/php8.1-apcu/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-apcu'
 pkgname=php8.1-apcu
 version=5.1.21
-revision=1
+revision=2
 wrksrc="apcu-${version}"
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -27,3 +27,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-apcu_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}

From e14ee7ddd8570f5fb80c7b2072a0be0ef9011cbb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 2/9] php8.1-ast: add php-ast subpackage

7.4 is EOL
---
 srcpkgs/php-ast             |  1 +
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 24 ------------------------
 srcpkgs/php8.1-ast/template |  8 +++++++-
 4 files changed, 8 insertions(+), 27 deletions(-)
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template

diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..532b48da0b0e
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php8.1-ast
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 2d63572004f6..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.0.6
-revision=1
-wrksrc="ast-${version}"
-build_style=gnu-configure
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=70347b04d5ab6223106bb098483a74ac0aa23e3e7fd41549ae95d56ccb15631e
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
index 549b8fcc1bce..17ce62f9dbd9 100644
--- a/srcpkgs/php8.1-ast/template
+++ b/srcpkgs/php8.1-ast/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-ast'
 pkgname=php8.1-ast
 version=1.0.16
-revision=1
+revision=2
 wrksrc="ast-${version}"
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -23,3 +23,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+php-ast_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}

From 357389d7a977d242c3797d3f0f48aeff382b9174 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 3/9] php8.1-igbinary: add php-igbinary subpackage

7.4 is EOL
---
 srcpkgs/php-igbinary             |  1 +
 srcpkgs/php-igbinary/template    | 24 ------------------------
 srcpkgs/php8.1-igbinary/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template

diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..b390d93b2cd5
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php8.1-igbinary
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d969703a7c37..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.1.2
-revision=1
-wrksrc="igbinary-${version}"
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=e78b327dad5397ed42f7b0c6fe017eddcde8c3c24ab8b59562cb691c411fa90b
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
index 14fadb10e252..00cd268c3f14 100644
--- a/srcpkgs/php8.1-igbinary/template
+++ b/srcpkgs/php8.1-igbinary/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-igbinary'
 pkgname=php8.1-igbinary
 version=3.2.7
-revision=1
+revision=2
 wrksrc="igbinary-${version}"
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -23,3 +23,9 @@ do_install() {
 	make INSTALL_ROOT="${DESTDIR}" install
 	vlicense COPYING
 }
+
+php-igbinary_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}

From e029511bbb05a0e4943f3fcff10b3f7aa6b17e71 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 4/9] php8.1-imagick: add php-imagick subpackage

7.4 is EOL
---
 srcpkgs/php-imagick                           |  1 +
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 -----------
 srcpkgs/php-imagick/template                  | 28 -------------------
 srcpkgs/php8.1-imagick/template               |  8 +++++-
 5 files changed, 8 insertions(+), 49 deletions(-)
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template

diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..e151bf267a74
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php8.1-imagick
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 6dc33ff938bd..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-wrksrc="imagick-$version"
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
index 6cd0c4098d69..dbf025d0c374 100644
--- a/srcpkgs/php8.1-imagick/template
+++ b/srcpkgs/php8.1-imagick/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-imagick'
 pkgname=php8.1-imagick
 version=3.7.0
-revision=1
+revision=2
 wrksrc="imagick-$version"
 build_style=gnu-configure
 configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
@@ -27,3 +27,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-imagick_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}

From eafccf2aa992b2278ff5f3fc133c69c1fb8ef95d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 5/9] xdebug8.1: add xdebug subpackage

7.4 is EOL
---
 srcpkgs/xdebug             |  1 +
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 26 --------------------------
 srcpkgs/xdebug/update      |  1 -
 srcpkgs/xdebug8.1/template |  8 +++++++-
 5 files changed, 8 insertions(+), 29 deletions(-)
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..7db7bcf6f806
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+xdebug8.1
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index c9b33a8fb79b..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" php-devel"
-fi
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
index 2c3168dbbc65..751d21662a29 100644
--- a/srcpkgs/xdebug8.1/template
+++ b/srcpkgs/xdebug8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'xdebug8.1'
 pkgname=xdebug8.1
 version=3.1.5
-revision=1
+revision=2
 wrksrc="xdebug-${version}"
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -27,3 +27,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+xdebug_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}

From 0585ab69a19f0f598f6de0d08ab09ed2b4c02f2a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 6/9] php8.0: add alternatives groups, pear.

---
 srcpkgs/php8.0-pear     |  1 +
 srcpkgs/php8.0/template | 54 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 4 deletions(-)
 create mode 120000 srcpkgs/php8.0-pear

diff --git a/srcpkgs/php8.0-pear b/srcpkgs/php8.0-pear
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pear
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 9aa552c38e3a..79218295e191 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.22
-revision=1
+revision=2
 _php_version=8.0
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -23,7 +23,7 @@ conf_files="/etc/php${_php_version}/php.ini"
 lib32disabled=yes
 
 if [ -n "$CROSS_BUILD" ]; then
-	# phar needs php to build
+	# phar, pear need php to build
 	hostmakedepends+=" php${_php_version}"
 	CFLAGS+=" -DHAVE_LIBDL
 		 -DHAVE_DLOPEN
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -90,7 +98,7 @@ do_build() {
 		--with-mysqli=shared,mysqlnd \
 		--with-openssl=shared \
 		--with-external-pcre \
-		--without-pear \
+		--with-pear=/usr/share/pear${_php_version} \
 		--with-pdo-mysql=shared,mysqlnd \
 		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
 		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
@@ -112,7 +120,7 @@ do_build() {
 
 	EXTENSION_DIR="/usr/lib/php${_php_version}/modules"
 	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
+	PEAR_INSTALLDIR=/usr/share/pear${_php_version}
 	export PEAR_INSTALLDIR
 	EXTRA_LIBS="-ldl"
 	export EXTRA_LIBS
@@ -158,6 +166,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -218,6 +240,30 @@ php8.0-embed_package() {
 	}
 }
 
+php8.0-pear_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PHP Extension and Application Repository'
+	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		local _env="INSTALL_ROOT=${PKGDESTDIR}"
+		if [ -n "$CROSS_BUILD" ]; then
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
+		fi
+		make install-pear ${_env}
+		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
+		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
+		mv ${PKGDESTDIR}/usr/bin/pear{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/peardev{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/pecl{,${_php_version}}
+	}
+}
+
 php8.0-enchant_package() {
 	lib32disabled=yes
 	depends="php${_php_version}-${version}_${revision}"

From d338d54cf981802c310b4993c6c619cb3af6034e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 7/9] php8.1: add php* subpackages, alternatives groups, pear.

7.4 is EOL
---
 srcpkgs/php                                   |   1 +
 srcpkgs/php-apache                            |   2 +-
 srcpkgs/php-cgi                               |   2 +-
 srcpkgs/php-devel                             |   2 +-
 srcpkgs/php-embed                             |   2 +-
 srcpkgs/php-enchant                           |   2 +-
 srcpkgs/php-ffi                               |   2 +-
 srcpkgs/php-fpm                               |   2 +-
 srcpkgs/php-gd                                |   2 +-
 srcpkgs/php-intl                              |   2 +-
 srcpkgs/php-ldap                              |   2 +-
 srcpkgs/php-mysql                             |   2 +-
 srcpkgs/php-odbc                              |   2 +-
 srcpkgs/php-pear                              |   2 +-
 srcpkgs/php-pgsql                             |   2 +-
 srcpkgs/php-phpdbg                            |   2 +-
 srcpkgs/php-snmp                              |   2 +-
 srcpkgs/php-sodium                            |   2 +-
 srcpkgs/php-sqlite                            |   2 +-
 srcpkgs/php-tidy                              |   2 +-
 srcpkgs/php-xsl                               |   2 +-
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 351 ------------------
 srcpkgs/php/update                            |   1 -
 srcpkgs/php8.1-pear                           |   1 +
 srcpkgs/php8.1/template                       | 181 ++++++++-
 36 files changed, 199 insertions(+), 707 deletions(-)
 create mode 120000 srcpkgs/php
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/template
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/php8.1-pear

diff --git a/srcpkgs/php b/srcpkgs/php
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-apache b/srcpkgs/php-apache
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-apache
+++ b/srcpkgs/php-apache
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-cgi b/srcpkgs/php-cgi
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-cgi
+++ b/srcpkgs/php-cgi
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-devel b/srcpkgs/php-devel
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-devel
+++ b/srcpkgs/php-devel
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-embed b/srcpkgs/php-embed
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-embed
+++ b/srcpkgs/php-embed
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-enchant b/srcpkgs/php-enchant
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-enchant
+++ b/srcpkgs/php-enchant
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-ffi b/srcpkgs/php-ffi
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-ffi
+++ b/srcpkgs/php-ffi
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-fpm b/srcpkgs/php-fpm
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-fpm
+++ b/srcpkgs/php-fpm
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-gd b/srcpkgs/php-gd
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-gd
+++ b/srcpkgs/php-gd
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-intl b/srcpkgs/php-intl
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-intl
+++ b/srcpkgs/php-intl
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-ldap b/srcpkgs/php-ldap
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-ldap
+++ b/srcpkgs/php-ldap
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-mysql b/srcpkgs/php-mysql
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-mysql
+++ b/srcpkgs/php-mysql
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-odbc b/srcpkgs/php-odbc
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-odbc
+++ b/srcpkgs/php-odbc
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-pear b/srcpkgs/php-pear
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-pear
+++ b/srcpkgs/php-pear
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-pgsql b/srcpkgs/php-pgsql
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-pgsql
+++ b/srcpkgs/php-pgsql
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-phpdbg b/srcpkgs/php-phpdbg
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-phpdbg
+++ b/srcpkgs/php-phpdbg
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-snmp b/srcpkgs/php-snmp
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-snmp
+++ b/srcpkgs/php-snmp
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-sodium b/srcpkgs/php-sodium
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-sodium
+++ b/srcpkgs/php-sodium
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-sqlite b/srcpkgs/php-sqlite
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-sqlite
+++ b/srcpkgs/php-sqlite
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-tidy b/srcpkgs/php-tidy
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-tidy
+++ b/srcpkgs/php-tidy
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php-xsl b/srcpkgs/php-xsl
index fa557ad95d0a..4ad857cc7c08 120000
--- a/srcpkgs/php-xsl
+++ b/srcpkgs/php-xsl
@@ -1 +1 @@
-php
\ No newline at end of file
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
deleted file mode 100644
index 3eb8e38cd928..000000000000
--- a/srcpkgs/php/template
+++ /dev/null
@@ -1,351 +0,0 @@
-# Template file for 'php'
-pkgname=php
-version=7.4.30
-revision=2
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
-license="PHP-3.01"
-homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
-checksum=ea72a34f32c67e79ac2da7dfe96177f3c451c3eefae5810ba13312ed398ba70d
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
-php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
-}
-
-php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
-}
-
-php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
-}
-
-php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
-}
-
-php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
-}
-
-php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
-}
-
-php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
-}
-
-php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
-}
-
-php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
-}
-
-php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
-}
-
-php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
-}
-
-php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
-}
-
-php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
-}
-
-php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
-}
-
-php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
-}
-
-php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
-}
-
-php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
-}
-
-php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
-}
-
-php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
-}
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index ac2289b24b76..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="8.*"
diff --git a/srcpkgs/php8.1-pear b/srcpkgs/php8.1-pear
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pear
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index ae058f5fefdb..f5e8c063dd5c 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.9
-revision=1
+revision=2
 _php_version=8.1
 wrksrc="php-${version}"
 hostmakedepends="bison pkg-config apache-devel"
@@ -23,7 +23,7 @@ conf_files="/etc/php${_php_version}/php.ini"
 lib32disabled=yes
 
 if [ -n "$CROSS_BUILD" ]; then
-	# phar needs php to build
+	# phar, pear need php to build
 	hostmakedepends+=" php${_php_version}"
 	CFLAGS+=" -DHAVE_LIBDL
 		 -DHAVE_DLOPEN
@@ -35,6 +35,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -90,7 +98,7 @@ do_build() {
 		--with-mysqli=shared,mysqlnd \
 		--with-openssl=shared \
 		--with-external-pcre \
-		--without-pear \
+		--with-pear=/usr/share/pear${_php_version} \
 		--with-pdo-mysql=shared,mysqlnd \
 		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
 		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
@@ -112,7 +120,7 @@ do_build() {
 
 	EXTENSION_DIR="/usr/lib/php${_php_version}/modules"
 	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
+	PEAR_INSTALLDIR=/usr/share/pear${_php_version}
 	export PEAR_INSTALLDIR
 	EXTRA_LIBS="-ldl"
 	export EXTRA_LIBS
@@ -158,6 +166,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,6 +184,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,6 +196,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -200,6 +219,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -218,6 +240,30 @@ php8.1-embed_package() {
 	}
 }
 
+php8.1-pear_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PHP Extension and Application Repository'
+	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		local _env="INSTALL_ROOT=${PKGDESTDIR}"
+		if [ -n "$CROSS_BUILD" ]; then
+			_env+=" PEAR_PHP=/usr/bin/php${_php_version}"
+		fi
+		make install-pear ${_env}
+		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
+		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
+		mv ${PKGDESTDIR}/usr/bin/pear{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/peardev{,${_php_version}}
+		mv ${PKGDESTDIR}/usr/bin/pecl{,${_php_version}}
+	}
+}
+
 php8.1-enchant_package() {
 	lib32disabled=yes
 	depends="php${_php_version}-${version}_${revision}"
@@ -334,3 +380,130 @@ php8.1-ffi_package() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"
 	}
 }
+
+php_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP scripting language meta package"
+	replaces="php-mcrypt<7.2.0"
+}
+
+php-devel_package() {
+	depends="${sourcepkg}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
+}
+
+php-phpdbg_package() {
+	depends="${sourcepkg}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
+}
+
+php-cgi_package() {
+	depends="${sourcepkg}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
+}
+
+php-apache_package() {
+	depends="${sourcepkg}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
+}
+
+php-fpm_package() {
+	depends="${sourcepkg}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
+}
+
+php-embed_package() {
+	depends="${sourcepkg}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
+}
+
+php-pear_package() {
+	depends="${sourcepkg}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
+}
+
+php-enchant_package() {
+	depends="${sourcepkg}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
+}
+
+php-gd_package() {
+	depends="${sourcepkg}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
+}
+
+php-intl_package() {
+	depends="${sourcepkg}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
+}
+
+php-ldap_package() {
+	depends="${sourcepkg}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
+}
+
+php-mysql_package() {
+	depends="${sourcepkg}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
+}
+
+php-odbc_package() {
+	depends="${sourcepkg}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
+}
+
+php-pgsql_package() {
+	depends="${sourcepkg}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
+}
+
+php-snmp_package() {
+	depends="${sourcepkg}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
+}
+
+php-sqlite_package() {
+	depends="${sourcepkg}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
+}
+
+php-tidy_package() {
+	depends="${sourcepkg}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
+}
+
+php-xsl_package() {
+	depends="${sourcepkg}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
+}
+
+php-sodium_package() {
+	depends="${sourcepkg}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
+}
+
+php-ffi_package() {
+	depends="${sourcepkg}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}

From 2d0976cb3a6b81752f025d2718e4d655fd86f619 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 8/9] composer8.0: add alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 4425abb2d320..de3c0f924142 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 533ce6a6def67cdc4fc5c4d24d760e7f39b43569 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 9/9] composer8.1: add composer subpackage, alternatives group.

7.4 is EOL
---
 srcpkgs/composer             |  1 +
 srcpkgs/composer/template    | 24 ------------------------
 srcpkgs/composer8.1/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..bcd1a1900fcb
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+composer8.1
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 81da2bf03aa2..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.2.4
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="ba04e246960d193237d5ed6542bd78456898e7787fafb586f500c6807af7458d
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index a8068ac00d06..b999fb418e0e 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.1
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="ea8cf6308ec76ff9645c3818841a7588096b9dc2767345fbd4bd492dd8a6dca6
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1
@@ -24,3 +25,8 @@ do_install() {
 	printf 'extension=%s\n' phar iconv openssl zip \
 		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
 }
+
+composer_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+}

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (13 preceding siblings ...)
  2022-08-31 12:41 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-08-31 12:44 ` TinfoilSubmarine
  2022-11-17 14:33 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (33 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-08-31 12:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r959538158

Comment:
Thanks, I was trying to think of a better way to do that. I changed all of the metapackages to subpackages.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (14 preceding siblings ...)
  2022-08-31 12:44 ` [PR REVIEW] " TinfoilSubmarine
@ 2022-11-17 14:33 ` TinfoilSubmarine
  2022-11-27 10:33 ` paper42
                   ` (32 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-11-17 14:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 54985 bytes --]

From 5a2a9448be1e7fa4bb59513e7248a6917cc3cc3e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 1/9] php8.1-apcu: add php-apcu subpackage

7.4 is EOL
---
 srcpkgs/php-apcu             |  1 +
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 ----------------------------
 srcpkgs/php-apcu/update      |  2 --
 srcpkgs/php8.1-apcu/template |  8 +++++++-
 5 files changed, 8 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update

diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..cc955450a456
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php8.1-apcu
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
index 2b1ed3a177ed..7dd822a9c70f 100644
--- a/srcpkgs/php8.1-apcu/template
+++ b/srcpkgs/php8.1-apcu/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-apcu'
 pkgname=php8.1-apcu
 version=5.1.22
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 make_check_target=test
@@ -30,3 +30,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-apcu_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}

From 5779126a213fba6b9d4bd77c149ed34373570b02 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 2/9] php8.1-ast: add php-ast subpackage

7.4 is EOL
---
 srcpkgs/php-ast             |  1 +
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 30 ------------------------------
 srcpkgs/php8.1-ast/template |  8 +++++++-
 4 files changed, 8 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template

diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..532b48da0b0e
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php8.1-ast
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
index d7620467e2ee..35ed0d6d14e8 100644
--- a/srcpkgs/php8.1-ast/template
+++ b/srcpkgs/php8.1-ast/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-ast'
 pkgname=php8.1-ast
 version=1.1.0
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 make_check_target="test"
@@ -29,3 +29,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+php-ast_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}

From 8eccbee4d339c8a094f51597271e0e21bad30781 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 3/9] php8.1-igbinary: add php-igbinary subpackage

7.4 is EOL
---
 srcpkgs/php-igbinary             |  1 +
 srcpkgs/php-igbinary/template    | 24 ------------------------
 srcpkgs/php8.1-igbinary/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template

diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..b390d93b2cd5
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php8.1-igbinary
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
index fbccec917236..431e65f74820 100644
--- a/srcpkgs/php8.1-igbinary/template
+++ b/srcpkgs/php8.1-igbinary/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-igbinary'
 pkgname=php8.1-igbinary
 version=3.2.12
-revision=1
+revision=2
 build_wrksrc=igbinary-$version
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -23,3 +23,9 @@ do_install() {
 	make INSTALL_ROOT="${DESTDIR}" install
 	vlicense COPYING
 }
+
+php-igbinary_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}

From f79181dfc70c4d0e035d880b22debb875cdb869e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 4/9] php8.1-imagick: add php-imagick subpackage

7.4 is EOL
---
 srcpkgs/php-imagick                           |  1 +
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 ----------
 srcpkgs/php-imagick/template                  | 31 -------------------
 srcpkgs/php8.1-imagick/template               |  8 ++++-
 5 files changed, 8 insertions(+), 52 deletions(-)
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template

diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..e151bf267a74
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php8.1-imagick
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
index c0f8456855ca..7f870bce138e 100644
--- a/srcpkgs/php8.1-imagick/template
+++ b/srcpkgs/php8.1-imagick/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-imagick'
 pkgname=php8.1-imagick
 version=3.7.0
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
  --with-php-config=/usr/bin/php-config8.1"
@@ -30,3 +30,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-imagick_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}

From 88299b7ad04530f874eef5fb4b220141a3fd55b3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 5/9] xdebug8.1: add xdebug subpackage

7.4 is EOL
---
 srcpkgs/xdebug             |  1 +
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 26 --------------------------
 srcpkgs/xdebug/update      |  1 -
 srcpkgs/xdebug8.1/template |  8 +++++++-
 5 files changed, 8 insertions(+), 29 deletions(-)
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..7db7bcf6f806
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+xdebug8.1
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
index 626a59f7210c..0b3f0d6881bf 100644
--- a/srcpkgs/xdebug8.1/template
+++ b/srcpkgs/xdebug8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'xdebug8.1'
 pkgname=xdebug8.1
 version=3.1.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 hostmakedepends="autoconf php8.1-devel"
@@ -26,3 +26,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+xdebug_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}

From 7d576a30974549c1f6a72fbbf3ddb43bd4d1d2e4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 6/9] php8.0: add alternatives groups.

---
 srcpkgs/php8.0/template | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..d8f385a0d02f 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -172,6 +185,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -181,6 +197,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -201,6 +220,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,6 +247,10 @@ php8.0-pear_package() {
 	 php${_php_version}-devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"

From 750f9f1ec13cebdc3d854030e044aae7e96a0b98 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 7/9] php8.1: add php* subpackages, alternatives groups.

7.4 is EOL
---
 srcpkgs/php                                   |   1 +
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 353 ------------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/php8.1/template                       | 155 +++++++-
 15 files changed, 155 insertions(+), 687 deletions(-)
 create mode 120000 srcpkgs/php
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/template
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php b/srcpkgs/php
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
deleted file mode 100644
index 7e79418e3554..000000000000
--- a/srcpkgs/php/template
+++ /dev/null
@@ -1,353 +0,0 @@
-# Template file for 'php'
-pkgname=php
-version=7.4.33
-revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
-license="PHP-3.01"
-homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
-php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
-}
-
-php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
-}
-
-php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
-}
-
-php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
-}
-
-php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
-}
-
-php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
-}
-
-php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
-}
-
-php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
-}
-
-php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
-}
-
-php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
-}
-
-php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
-}
-
-php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
-}
-
-php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
-}
-
-php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
-}
-
-php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
-}
-
-php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
-}
-
-php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
-}
-
-php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
-}
-
-php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
-}
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..3945d0d70e8b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -172,6 +185,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -181,6 +197,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -201,6 +220,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,6 +247,10 @@ php8.1-pear_package() {
 	 php${_php_version}-devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"
@@ -356,3 +382,130 @@ php8.1-ffi_package() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"
 	}
 }
+
+php_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP scripting language meta package"
+	replaces="php-mcrypt<7.2.0"
+}
+
+php-devel_package() {
+	depends="${sourcepkg}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
+}
+
+php-phpdbg_package() {
+	depends="${sourcepkg}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
+}
+
+php-cgi_package() {
+	depends="${sourcepkg}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
+}
+
+php-apache_package() {
+	depends="${sourcepkg}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
+}
+
+php-fpm_package() {
+	depends="${sourcepkg}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
+}
+
+php-embed_package() {
+	depends="${sourcepkg}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
+}
+
+php-pear_package() {
+	depends="${sourcepkg}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
+}
+
+php-enchant_package() {
+	depends="${sourcepkg}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
+}
+
+php-gd_package() {
+	depends="${sourcepkg}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
+}
+
+php-intl_package() {
+	depends="${sourcepkg}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
+}
+
+php-ldap_package() {
+	depends="${sourcepkg}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
+}
+
+php-mysql_package() {
+	depends="${sourcepkg}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
+}
+
+php-odbc_package() {
+	depends="${sourcepkg}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
+}
+
+php-pgsql_package() {
+	depends="${sourcepkg}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
+}
+
+php-snmp_package() {
+	depends="${sourcepkg}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
+}
+
+php-sqlite_package() {
+	depends="${sourcepkg}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
+}
+
+php-tidy_package() {
+	depends="${sourcepkg}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
+}
+
+php-xsl_package() {
+	depends="${sourcepkg}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
+}
+
+php-sodium_package() {
+	depends="${sourcepkg}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
+}
+
+php-ffi_package() {
+	depends="${sourcepkg}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}

From 813a285a1cc061c5016c9fd814fd1cbf3ead9ef7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 8/9] composer8.0: add alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index b55bc86366e4..61fd5f0c0c55 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From de357bc523f30847d6341afbe7d63bcc3fc4c01d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 9/9] composer8.1: add composer subpackage, alternatives group.

7.4 is EOL
---
 srcpkgs/composer             |  1 +
 srcpkgs/composer/template    | 24 ------------------------
 srcpkgs/composer8.1/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..bcd1a1900fcb
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+composer8.1
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 439b27811c5a..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.4.2
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index 924dff92a42d..9c9cb7b22ea4 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1
@@ -24,3 +25,8 @@ do_install() {
 	printf 'extension=%s\n' phar iconv openssl zip \
 		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
 }
+
+composer_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+}

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (15 preceding siblings ...)
  2022-11-17 14:33 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-11-27 10:33 ` paper42
  2022-11-28 20:01 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (31 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-11-27 10:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1328216670

Comment:
I think it would be nice to make every package depend on a specific version that's the last supported one.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (16 preceding siblings ...)
  2022-11-27 10:33 ` paper42
@ 2022-11-28 20:01 ` TinfoilSubmarine
  2022-12-01 13:15 ` TinfoilSubmarine
                   ` (30 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-11-28 20:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

[WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 56654 bytes --]

From 2664320801a72414ddd1b6a3dd4cb3772fa7a123 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:03:04 -0400
Subject: [PATCH 01/11] php8.1-apcu: add php-apcu subpackage

7.4 is EOL
---
 srcpkgs/php-apcu             |  1 +
 srcpkgs/php-apcu/INSTALL.msg |  3 ---
 srcpkgs/php-apcu/template    | 28 ----------------------------
 srcpkgs/php-apcu/update      |  2 --
 srcpkgs/php8.1-apcu/template |  8 +++++++-
 5 files changed, 8 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update

diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..cc955450a456
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php8.1-apcu
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
index 2b1ed3a177ed..7dd822a9c70f 100644
--- a/srcpkgs/php8.1-apcu/template
+++ b/srcpkgs/php8.1-apcu/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-apcu'
 pkgname=php8.1-apcu
 version=5.1.22
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 make_check_target=test
@@ -30,3 +30,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-apcu_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}

From bdec0ccdeaf479a14bd6930feb8193c5eb4c8988 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:04:44 -0400
Subject: [PATCH 02/11] php8.1-ast: add php-ast subpackage

7.4 is EOL
---
 srcpkgs/php-ast             |  1 +
 srcpkgs/php-ast/INSTALL.msg |  2 --
 srcpkgs/php-ast/template    | 30 ------------------------------
 srcpkgs/php8.1-ast/template |  8 +++++++-
 4 files changed, 8 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template

diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..532b48da0b0e
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php8.1-ast
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
index d7620467e2ee..35ed0d6d14e8 100644
--- a/srcpkgs/php8.1-ast/template
+++ b/srcpkgs/php8.1-ast/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-ast'
 pkgname=php8.1-ast
 version=1.1.0
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 make_check_target="test"
@@ -29,3 +29,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+php-ast_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}

From cfad9c3ae010166023dde36a702e16d92b4ed55b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:06:52 -0400
Subject: [PATCH 03/11] php8.1-igbinary: add php-igbinary subpackage

7.4 is EOL
---
 srcpkgs/php-igbinary             |  1 +
 srcpkgs/php-igbinary/template    | 24 ------------------------
 srcpkgs/php8.1-igbinary/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template

diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..b390d93b2cd5
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php8.1-igbinary
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
index fbccec917236..431e65f74820 100644
--- a/srcpkgs/php8.1-igbinary/template
+++ b/srcpkgs/php8.1-igbinary/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-igbinary'
 pkgname=php8.1-igbinary
 version=3.2.12
-revision=1
+revision=2
 build_wrksrc=igbinary-$version
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
@@ -23,3 +23,9 @@ do_install() {
 	make INSTALL_ROOT="${DESTDIR}" install
 	vlicense COPYING
 }
+
+php-igbinary_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}

From c99874a9cf6ad335d208e749e8819d754d2fb15b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:08:22 -0400
Subject: [PATCH 04/11] php8.1-imagick: add php-imagick subpackage

7.4 is EOL
---
 srcpkgs/php-imagick                           |  1 +
 srcpkgs/php-imagick/INSTALL.msg               |  3 --
 ...le-libmagick-header-file-search-path.patch | 17 ----------
 srcpkgs/php-imagick/template                  | 31 -------------------
 srcpkgs/php8.1-imagick/template               |  8 ++++-
 5 files changed, 8 insertions(+), 52 deletions(-)
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template

diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..e151bf267a74
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php8.1-imagick
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
index c0f8456855ca..7f870bce138e 100644
--- a/srcpkgs/php8.1-imagick/template
+++ b/srcpkgs/php8.1-imagick/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1-imagick'
 pkgname=php8.1-imagick
 version=3.7.0
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
  --with-php-config=/usr/bin/php-config8.1"
@@ -30,3 +30,9 @@ pre_install() {
 post_install() {
 	rm -r $DESTDIR/usr/include
 }
+
+php-imagick_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}

From 2e6370102a4e1f05e087699bd92c0ea3ab67011f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 29 Aug 2022 09:17:54 -0400
Subject: [PATCH 05/11] xdebug8.1: add xdebug subpackage

7.4 is EOL
---
 srcpkgs/xdebug             |  1 +
 srcpkgs/xdebug/INSTALL.msg |  1 -
 srcpkgs/xdebug/template    | 26 --------------------------
 srcpkgs/xdebug/update      |  1 -
 srcpkgs/xdebug8.1/template |  8 +++++++-
 5 files changed, 8 insertions(+), 29 deletions(-)
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..7db7bcf6f806
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+xdebug8.1
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
index 626a59f7210c..0b3f0d6881bf 100644
--- a/srcpkgs/xdebug8.1/template
+++ b/srcpkgs/xdebug8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'xdebug8.1'
 pkgname=xdebug8.1
 version=3.1.5
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-php-config=/usr/bin/php-config8.1"
 hostmakedepends="autoconf php8.1-devel"
@@ -26,3 +26,9 @@ do_install() {
 	make INSTALL_ROOT=${DESTDIR} install
 	vlicense LICENSE
 }
+
+xdebug_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}

From 5768a6993dda48634c0971188d6a377f89441265 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 06/11] php8.0: add alternatives groups.

---
 srcpkgs/php8.0/template | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..d8f385a0d02f 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -172,6 +185,9 @@ php8.0-devel_package() {
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -181,6 +197,9 @@ php8.0-phpdbg_package() {
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -201,6 +220,9 @@ php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,6 +247,10 @@ php8.0-pear_package() {
 	 php${_php_version}-devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"

From 0b20479682ba1df740bf69959888bc24ee170f77 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 07/11] php8.1: add php* subpackages, alternatives groups.

7.4 is EOL
---
 srcpkgs/php                                   |   1 +
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 353 ------------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/php8.1/template                       | 155 +++++++-
 15 files changed, 155 insertions(+), 687 deletions(-)
 create mode 120000 srcpkgs/php
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/template
 delete mode 100644 srcpkgs/php/update

diff --git a/srcpkgs/php b/srcpkgs/php
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
deleted file mode 100644
index 7e79418e3554..000000000000
--- a/srcpkgs/php/template
+++ /dev/null
@@ -1,353 +0,0 @@
-# Template file for 'php'
-pkgname=php
-version=7.4.33
-revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
-license="PHP-3.01"
-homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
-php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
-}
-
-php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
-}
-
-php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
-}
-
-php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
-}
-
-php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
-}
-
-php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
-}
-
-php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
-}
-
-php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
-}
-
-php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
-}
-
-php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
-}
-
-php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
-}
-
-php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
-}
-
-php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
-}
-
-php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
-}
-
-php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
-}
-
-php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
-}
-
-php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
-}
-
-php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
-}
-
-php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
-}
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..3945d0d70e8b 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -172,6 +185,9 @@ php8.1-devel_package() {
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg{_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -181,6 +197,9 @@ php8.1-phpdbg_package() {
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
 	depends="php${_php_version}-${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -201,6 +220,9 @@ php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
 	depends="php${_php_version}-${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -225,6 +247,10 @@ php8.1-pear_package() {
 	 php${_php_version}-devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"
@@ -356,3 +382,130 @@ php8.1-ffi_package() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"
 	}
 }
+
+php_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+	short_desc="PHP scripting language meta package"
+	replaces="php-mcrypt<7.2.0"
+}
+
+php-devel_package() {
+	depends="${sourcepkg}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
+}
+
+php-phpdbg_package() {
+	depends="${sourcepkg}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
+}
+
+php-cgi_package() {
+	depends="${sourcepkg}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
+}
+
+php-apache_package() {
+	depends="${sourcepkg}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
+}
+
+php-fpm_package() {
+	depends="${sourcepkg}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
+}
+
+php-embed_package() {
+	depends="${sourcepkg}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
+}
+
+php-pear_package() {
+	depends="${sourcepkg}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
+}
+
+php-enchant_package() {
+	depends="${sourcepkg}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
+}
+
+php-gd_package() {
+	depends="${sourcepkg}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
+}
+
+php-intl_package() {
+	depends="${sourcepkg}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
+}
+
+php-ldap_package() {
+	depends="${sourcepkg}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
+}
+
+php-mysql_package() {
+	depends="${sourcepkg}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
+}
+
+php-odbc_package() {
+	depends="${sourcepkg}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
+}
+
+php-pgsql_package() {
+	depends="${sourcepkg}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
+}
+
+php-snmp_package() {
+	depends="${sourcepkg}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
+}
+
+php-sqlite_package() {
+	depends="${sourcepkg}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
+}
+
+php-tidy_package() {
+	depends="${sourcepkg}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
+}
+
+php-xsl_package() {
+	depends="${sourcepkg}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
+}
+
+php-sodium_package() {
+	depends="${sourcepkg}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
+}
+
+php-ffi_package() {
+	depends="${sourcepkg}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}

From d23f7ab162592657e92c433cb1701cd2826bb2eb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 08/11] composer8.0: add alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index b55bc86366e4..61fd5f0c0c55 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From e0959cd716bb194814b1f97e7850a299665b72a1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 09/11] composer8.1: add composer subpackage, alternatives
 group.

7.4 is EOL
---
 srcpkgs/composer             |  1 +
 srcpkgs/composer/template    | 24 ------------------------
 srcpkgs/composer8.1/template |  8 +++++++-
 3 files changed, 8 insertions(+), 25 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..bcd1a1900fcb
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+composer8.1
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 439b27811c5a..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.4.2
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index 924dff92a42d..9c9cb7b22ea4 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1
@@ -24,3 +25,8 @@ do_install() {
 	printf 'extension=%s\n' phar iconv openssl zip \
 		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
 }
+
+composer_package() {
+	depends="${sourcepkg}"
+	build_style=meta
+}

From 1da36eef401507c561652d0ef7ea314cda5cbff6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 10/11] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 552a09cefb78cdaad49b0361a49e10bac8b292c3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 11/11] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (17 preceding siblings ...)
  2022-11-28 20:01 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-12-01 13:15 ` TinfoilSubmarine
  2022-12-04 13:52 ` [PR REVIEW] " paper42
                   ` (29 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-01 13:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1333753874

Comment:
Anything else needed for this? 7.4 is officially EOL now

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (18 preceding siblings ...)
  2022-12-01 13:15 ` TinfoilSubmarine
@ 2022-12-04 13:52 ` paper42
  2022-12-04 13:52 ` paper42
                   ` (28 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-04 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1038973531

Comment:
```suggestion
	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg${_php_version}.1"
```

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (21 preceding siblings ...)
  2022-12-04 13:52 ` paper42
@ 2022-12-04 13:52 ` paper42
  2022-12-04 13:52 ` paper42
                   ` (25 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-04 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1038974125

Comment:
I think that having all of these metapackages spread across so many packages will be confusing and we might forget about some at some point. What would you think about creating a php meta package with all of these subpackages? That way everything would be in one package and it would be easy to update.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (20 preceding siblings ...)
  2022-12-04 13:52 ` paper42
@ 2022-12-04 13:52 ` paper42
  2022-12-04 13:52 ` paper42
                   ` (26 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-04 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1038974711

Comment:
I can imagine that people will be confused by these meta packages a bit - they will install php-fpm, enable the php8.1-fpm service and then on an update php will be updated to 8.2 and php-fpm will be orphaned and removed. Do you think we could somehow clarify that php-* packages will move in short_desc or even as a page in void-docs?

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (22 preceding siblings ...)
  2022-12-04 13:52 ` paper42
@ 2022-12-04 13:52 ` paper42
  2022-12-06 15:45 ` TinfoilSubmarine
                   ` (24 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-04 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1038973183

Comment:
```suggestion
	depends="${sourcepkg}>=${version}_${revision}"
```
and short_desc is missing

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (19 preceding siblings ...)
  2022-12-04 13:52 ` [PR REVIEW] " paper42
@ 2022-12-04 13:52 ` paper42
  2022-12-04 13:52 ` paper42
                   ` (27 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-04 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1038973555

Comment:
```suggestion
	depends="php${_php_version}>=${version}_${revision}"
```
Could you do the same everywhere?

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (23 preceding siblings ...)
  2022-12-04 13:52 ` paper42
@ 2022-12-06 15:45 ` TinfoilSubmarine
  2022-12-06 17:34 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (23 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-06 15:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1041142432

Comment:
I think something like that could be helpful. Probably want a page since it's fairly easy to miss a short_desc if you just do `xi php-fpm`. Reminds me of https://github.com/void-linux/void-packages/issues/38306

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (24 preceding siblings ...)
  2022-12-06 15:45 ` TinfoilSubmarine
@ 2022-12-06 17:34 ` TinfoilSubmarine
  2022-12-06 17:35 ` [PR REVIEW] " TinfoilSubmarine
                   ` (22 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-06 17:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2367 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 63518 bytes --]

From 90649f02547cd8aaf1cc78aab212f3c113483390 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] New package: php-meta-8.1

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php                                   |   1 +
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  28 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  30 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  24 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  31 --
 srcpkgs/php-meta/template                     | 173 +++++++++
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 353 ------------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  26 --
 srcpkgs/xdebug/update                         |   1 -
 34 files changed, 180 insertions(+), 878 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 create mode 100644 srcpkgs/php-meta/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/template
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 439b27811c5a..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.4.2
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php b/srcpkgs/php
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/php
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-meta/template b/srcpkgs/php-meta/template
new file mode 100644
index 000000000000..d9699722b187
--- /dev/null
+++ b/srcpkgs/php-meta/template
@@ -0,0 +1,173 @@
+# Template file for 'php-meta'
+pkgname=php-meta
+version=8.1
+revision=1
+build_style=meta
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
+
+php_package() {
+	depends="php${version}"
+	build_style=meta
+	short_desc="PHP scripting language meta package"
+	replaces="php-mcrypt<7.2.0"
+}
+
+php-devel_package() {
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
+}
+
+php-phpdbg_package() {
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
+}
+
+php-cgi_package() {
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
+}
+
+php-apache_package() {
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
+}
+
+php-fpm_package() {
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
+}
+
+php-embed_package() {
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
+}
+
+php-pear_package() {
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
+}
+
+php-enchant_package() {
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
+}
+
+php-gd_package() {
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
+}
+
+php-intl_package() {
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
+}
+
+php-ldap_package() {
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
+}
+
+php-mysql_package() {
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
+}
+
+php-odbc_package() {
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
+}
+
+php-pgsql_package() {
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
+}
+
+php-snmp_package() {
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
+}
+
+php-sqlite_package() {
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
+}
+
+php-tidy_package() {
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
+}
+
+php-xsl_package() {
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
+}
+
+php-sodium_package() {
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
+}
+
+php-ffi_package() {
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
+}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
deleted file mode 100644
index 7e79418e3554..000000000000
--- a/srcpkgs/php/template
+++ /dev/null
@@ -1,353 +0,0 @@
-# Template file for 'php'
-pkgname=php
-version=7.4.33
-revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
-license="PHP-3.01"
-homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
-replaces="php-mcrypt<7.2.0"
-
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
-php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
-}
-
-php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
-}
-
-php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
-}
-
-php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
-}
-
-php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
-}
-
-php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
-}
-
-php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
-}
-
-php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
-}
-
-php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
-}
-
-php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
-}
-
-php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
-}
-
-php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
-}
-
-php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
-}
-
-php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
-}
-
-php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
-}
-
-php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
-}
-
-php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
-}
-
-php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
-}
-
-php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
-}
-
-php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
-}
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..961c45da2e37
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php-meta
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From 26d475fd3b0038c5fdda84dd9613761854065db7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add alternatives groups.

---
 srcpkgs/php8.0/template | 68 ++++++++++++++++++++++++++++-------------
 1 file changed, 47 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..4f3eb8a54661 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.0-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,7 +184,10 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +196,10 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +208,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,8 +218,11 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -210,7 +232,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,10 +243,14 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"
@@ -242,7 +268,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +277,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +286,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +295,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +304,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +313,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +322,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +331,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +340,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +349,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +358,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +367,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +376,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From a0d6a553d724eaef9f16782aec2c282dd3c37735 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add alternatives groups.

---
 srcpkgs/php8.1/template | 68 ++++++++++++++++++++++++++++-------------
 1 file changed, 47 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..62ab9d1c93aa 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -159,6 +167,11 @@ do_install() {
 
 php8.1-devel_package() {
 	short_desc+=" - development files"
+	alternatives="
+	 php-devel:php-config:/usr/bin/php-config${_php_version}
+	 php-devel:phpize:/usr/bin/phpize${_php_version}
+	 php-devel:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+	 php-devel:php-config.1:/usr/share/man/man1/php-config${_php_version}.1"
 	pkg_install() {
 		vmove usr/include
 		vmove "usr/lib/php${_php_version}/build"
@@ -171,7 +184,10 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
+	alternatives="
+	 phpdbg:phpdbg:/usr/bin/phpdbg${_php_version}
+	 phpdbg:phpdbg.1:/usr/share/man/man1/phpdbg${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +196,10 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
+	alternatives="
+	 php-cgi:php-cgi:/usr/bin/php-cgi${_php_version}
+	 php-cgi:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +208,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,8 +218,11 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
+	alternatives="
+	 php-fpm:php-fpm:/usr/bin/php-fpm${_php_version}
+	 php-fpm:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
@@ -210,7 +232,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,10 +243,14 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
+	alternatives="
+	 php-pear:pear:/usr/bin/pear${_php_version}
+	 php-pear:peardev:/usr/bin/peardev${_php_version}
+	 php-pear:pecl:/usr/bin/pecl${_php_version}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		local _env="INSTALL_ROOT=${PKGDESTDIR} PHP_PEAR_PHP_BIN=php${_php_version}"
@@ -242,7 +268,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +277,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +286,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +295,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +304,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +313,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +322,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +331,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +340,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +349,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +358,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +367,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +376,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 2088554bf7413969dca462ab0f71b97c1fed91be Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index b55bc86366e4..61fd5f0c0c55 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 8363d27793a9045bee9820dc090e3e9fe1134743 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index 924dff92a42d..1e1db796fe1d 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From 2adca0f6333d90cccecaadd58420ac5f356bc4dd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 72af78c83449107547a5b30d8605aebab67254ba Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (25 preceding siblings ...)
  2022-12-06 17:34 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-12-06 17:35 ` TinfoilSubmarine
  2022-12-06 19:14 ` paper42
                   ` (21 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-06 17:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1041267635

Comment:
I took a shot at this, let me know what you think

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (27 preceding siblings ...)
  2022-12-06 19:14 ` paper42
@ 2022-12-06 19:14 ` paper42
  2022-12-07 14:25 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (19 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-06 19:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1041331369

Comment:
I would just call this package php similar to how the linux meta-package is called linux

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (26 preceding siblings ...)
  2022-12-06 17:35 ` [PR REVIEW] " TinfoilSubmarine
@ 2022-12-06 19:14 ` paper42
  2022-12-06 19:14 ` paper42
                   ` (20 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-06 19:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1041334200

Comment:
that's quite a lot of alternative groups, I think it would be better to just have one - `php` and let everything switch at the same time

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (28 preceding siblings ...)
  2022-12-06 19:14 ` paper42
@ 2022-12-07 14:25 ` TinfoilSubmarine
  2022-12-08 18:42 ` [PR REVIEW] " TinfoilSubmarine
                   ` (18 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-07 14:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2367 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 61133 bytes --]

From c2453ee0df89527f27d85a0ab4467f639564e876 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] php: turn into meta package.

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  28 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  30 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  24 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  31 --
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 389 +++++-------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  26 --
 srcpkgs/xdebug/update                         |   1 -
 32 files changed, 108 insertions(+), 812 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 439b27811c5a..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.4.2
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 7e79418e3554..9f8ae7f8edf0 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,353 +1,168 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.33
+version=8.1
 revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
+build_style=meta
+depends="php${version}"
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From ba25f9990d4c007e3ab797942a580310a554a7b1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add `php` alternatives group.

---
 srcpkgs/php8.0/template | 63 +++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..917fe1a86d6c 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,27 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1
+ php:php-config:/usr/bin/php-config${_php_version}
+ php:phpize:/usr/bin/phpize${_php_version}
+ php:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+ php:php-config.1:/usr/share/man/man1/php-config${_php_version}.1
+ php:phpdbg:/usr/bin/phpdbg${_php_version}
+ php:phpdbg.1:/usr/share/man/man1/phpdbg${_php_version}.1
+ php:php-cgi:/usr/bin/php-cgi${_php_version}
+ php:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1
+ php:php-fpm:/usr/bin/php-fpm${_php_version}
+ php:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8
+ php:pear:/usr/bin/pear${_php_version}
+ php:peardev:/usr/bin/peardev${_php_version}
+ php:pecl:/usr/bin/pecl${_php_version}"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +192,7 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +201,7 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +210,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +220,7 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +231,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +242,8 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +263,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +272,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +281,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +290,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +299,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +308,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +317,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +326,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +335,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +344,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +353,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +362,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +371,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 0d1b5425c416fea9d519ad35626b7d711a82e5ce Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add `php` alternatives group.

---
 srcpkgs/php8.1/template | 63 +++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..728818513688 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,27 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1
+ php:php-config:/usr/bin/php-config${_php_version}
+ php:phpize:/usr/bin/phpize${_php_version}
+ php:phpize.1:/usr/share/man/man1/phpize${_php_version}.1
+ php:php-config.1:/usr/share/man/man1/php-config${_php_version}.1
+ php:phpdbg:/usr/bin/phpdbg${_php_version}
+ php:phpdbg.1:/usr/share/man/man1/phpdbg${_php_version}.1
+ php:php-cgi:/usr/bin/php-cgi${_php_version}
+ php:php-cgi.1:/usr/share/man/man1/php-cgi${_php_version}.1
+ php:php-fpm:/usr/bin/php-fpm${_php_version}
+ php:php-fpm.8:/usr/share/man/man8/php-fpm${_php_version}.8
+ php:pear:/usr/bin/pear${_php_version}
+ php:peardev:/usr/bin/peardev${_php_version}
+ php:pecl:/usr/bin/pecl${_php_version}"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +192,7 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +201,7 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +210,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +220,7 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +231,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +242,8 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +263,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +272,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +281,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +290,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +299,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +308,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +317,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +326,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +335,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +344,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +353,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +362,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +371,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 4d7b30f163169551f7c9e5c5e90eae9ee14f15d0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add `composer` alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index b55bc86366e4..61fd5f0c0c55 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From c0a54e74808a3e919f2124f232eb46561695dce6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add `composer` alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index 924dff92a42d..1e1db796fe1d 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.4.2
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="8fe98a01050c92cc6812b8ead3bd5b6e0bcdc575ce7a93b242bde497a31d7732
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From 065fd5489fc5d572b62cd3bc9e2b6af2581826a3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 445fd4965d376968c33d5f3570131fd920b2f4f3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (29 preceding siblings ...)
  2022-12-07 14:25 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-12-08 18:42 ` TinfoilSubmarine
  2022-12-15 17:10 ` paper42
                   ` (17 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-08 18:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1043701511

Comment:
OK, I opened https://github.com/void-linux/void-docs/pull/731

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (30 preceding siblings ...)
  2022-12-08 18:42 ` [PR REVIEW] " TinfoilSubmarine
@ 2022-12-15 17:10 ` paper42
  2022-12-15 17:47 ` TinfoilSubmarine
                   ` (16 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-15 17:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1049928892

Comment:
hmm, I think this will result in having broken links if only `php<version>` is installed, but not the subpackages that actually provide the files mentioned in alternatives

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (31 preceding siblings ...)
  2022-12-15 17:10 ` paper42
@ 2022-12-15 17:47 ` TinfoilSubmarine
  2022-12-25  0:00 ` paper42
                   ` (15 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2022-12-15 17:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1049967773

Comment:
Yes it does.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (32 preceding siblings ...)
  2022-12-15 17:47 ` TinfoilSubmarine
@ 2022-12-25  0:00 ` paper42
  2022-12-25  0:03 ` paper42
                   ` (14 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-25  0:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1056883747

Comment:
I don't see a straightforward way to handle this with our current alternatives system, only some workarounds:

We could let the php package provide the php alternative that would point /usr/bin/php -> php8.{0,1}. All other unversioned binaries (php-fpm, composer, etc) would be symlinks pointing to a multicall script called php-alternatives provided by the php package. This script would look at /usr/bin/php, detect the version from there and add the version suffix to its arg 0.

What do you think about this?

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (33 preceding siblings ...)
  2022-12-25  0:00 ` paper42
@ 2022-12-25  0:03 ` paper42
  2023-01-04 20:41 ` TinfoilSubmarine
                   ` (13 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2022-12-25  0:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1056883747

Comment:
I don't see a straightforward way to handle this with our current alternatives system, only some workarounds:

We could let provide only the php alternative that would point /usr/bin/php -> php8.{0,1}. All other unversioned binaries (php-fpm, composer, etc) would be symlinks pointing to a multicall script called php-alternatives. This script would look at /usr/bin/php, detect the version from there and add the version suffix to its arg 0.

What do you think about this?

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (34 preceding siblings ...)
  2022-12-25  0:03 ` paper42
@ 2023-01-04 20:41 ` TinfoilSubmarine
  2023-01-20 15:38 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (12 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-01-04 20:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1061866166

Comment:
It seems like a workable solution except for the man pages--I'm not seeing a good way to make that fit with your proposal. 

Other options:
1. Have a single alternatives group and install all the packages in that group as dependencies of the base package (e.g. `php8.1-devel php8.1-phpdbg php8.1-fpm php8.1-pear php8.1-cgi`) This would bring a PHP 8.1 install from 12MB on disk to 74MB on disk.
2. Don't provide alternatives for anything except the core binaries available in the base package (`php`, `phar`, and `phar.phar`). This would meet most use cases where the user just wants `php` available in path for convenience or hardcoded calls to `php` in some script.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (35 preceding siblings ...)
  2023-01-04 20:41 ` TinfoilSubmarine
@ 2023-01-20 15:38 ` TinfoilSubmarine
  2023-01-20 15:43 ` [PR REVIEW] " TinfoilSubmarine
                   ` (11 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-01-20 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2367 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 59382 bytes --]

From f378068ec3b0a5cfa7b23956bebd5ab5ab8ea5af Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] php: turn into meta package.

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  28 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  30 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  24 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  31 --
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   3 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 389 +++++-------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  26 --
 srcpkgs/xdebug/update                         |   1 -
 32 files changed, 108 insertions(+), 812 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index ff3a140d0343..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.5.1
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="f1b94fee11a5bd6a1aae5d77c8da269df27c705fcc806ebf4c8c2e6fa8645c20
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index c9c75b0498aa..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 39e4d161b648..9f8ae7f8edf0 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,353 +1,168 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.33
+version=8.1
 revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Orphaned <orphan@voidlinux.org>"
+build_style=meta
+depends="php${version}"
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From 7fa6fff107a58497f50d4039ef0f76fd7478920c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add `php` alternatives group.

---
 srcpkgs/php8.0/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..6f694bf928a1 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From e958319813fab90155ff14910703d6aad6869dda Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add `php` alternatives group.

---
 srcpkgs/php8.1/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..49fd265f684f 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 7a9dde38f27e51d8de5c907564b20e99b5fee20f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add `composer` alternatives group.

---
 srcpkgs/composer8.0/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index 090e2b4ec1f1..3a867a6b0562 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="f1b94fee11a5bd6a1aae5d77c8da269df27c705fcc806ebf4c8c2e6fa8645c20
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 90679e1a6c8330280023981148c67c86e40e1c73 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add `composer` alternatives group.

---
 srcpkgs/composer8.1/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index 74adb052d633..2d638e80888f 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="f1b94fee11a5bd6a1aae5d77c8da269df27c705fcc806ebf4c8c2e6fa8645c20
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From b80fa91035467e0d3604e8c0c867a2e205488878 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From c9944b4b7cbff65f9afcf7262c2a002c060a533e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (36 preceding siblings ...)
  2023-01-20 15:38 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2023-01-20 15:43 ` TinfoilSubmarine
  2023-02-15 19:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (10 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-01-20 15:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1082716448

Comment:
I'm opting for my option 2.
regarding option 1: this is inelegant.

Regarding @paper42's proposal: I don't think it would be good to have binaries available that don't have a manpage tied to them.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (37 preceding siblings ...)
  2023-01-20 15:43 ` [PR REVIEW] " TinfoilSubmarine
@ 2023-02-15 19:29 ` TinfoilSubmarine
  2023-02-21 18:34 ` [PR REVIEW] " TinfoilSubmarine
                   ` (9 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-02-15 19:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2367 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 59393 bytes --]

From a1091d4d54fe4e67788a3253f4fb4e8ce065986b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] php: turn into meta package.

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  28 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  30 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  24 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  31 --
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   4 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 389 +++++-------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  26 --
 srcpkgs/xdebug/update                         |   1 -
 32 files changed, 108 insertions(+), 813 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 57091f0adcfb..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.5.3
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index 143322579e0b..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,28 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_wrksrc=apcu-$version
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 615361fe50fe..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,30 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-post_extract() {
-	mv ast-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index d8b3e1aa25dd..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_wrksrc=igbinary-$version
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index 1f3248f28884..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-post_extract() {
-	mv imagick-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index 98c6bdd9411d..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 39e4d161b648..9f8ae7f8edf0 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,353 +1,168 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.33
+version=8.1
 revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Orphaned <orphan@voidlinux.org>"
+build_style=meta
+depends="php${version}"
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index cab8e455139f..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-post_extract() {
-	mv xdebug-$version/* .
-}
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From fc50d1a0674cbf1c0b5269e332480d6e5b1525a6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add `php` alternatives group.

---
 srcpkgs/php8.0/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..6f694bf928a1 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 37f4fa8bf310e961d54f23b275a206f2ebe6b8a7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add `php` alternatives group.

---
 srcpkgs/php8.1/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..49fd265f684f 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 4401b59cc60fb095c0311b82a275491768ac6647 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add `composer` alternatives group.

---
 srcpkgs/composer8.0/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index afdcb1e535a6..b7e3e2958bd5 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 95e7f4b6fbf2ccffdedd8ba73cb0b3bee3a7d0fc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add `composer` alternatives group.

---
 srcpkgs/composer8.1/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index c790e032ddbe..3642db074345 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From 68525f387e0a2e06fafe51c2b409c98b81629f2c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 662df1631841bfd979b00c2961474b6a5af9de7b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (38 preceding siblings ...)
  2023-02-15 19:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2023-02-21 18:34 ` TinfoilSubmarine
  2023-02-21 23:50 ` paper42
                   ` (8 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-02-21 18:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1113433889

Comment:
Any input on this? Hoping to get this in so I can get 8.2 in repo.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (39 preceding siblings ...)
  2023-02-21 18:34 ` [PR REVIEW] " TinfoilSubmarine
@ 2023-02-21 23:50 ` paper42
  2023-02-28 22:36 ` paper42
                   ` (7 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2023-02-21 23:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1113685051

Comment:
I didn't forget about this PR, but I didn't have the mental capacity for this lately. I plan to look into this soon.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (40 preceding siblings ...)
  2023-02-21 23:50 ` paper42
@ 2023-02-28 22:36 ` paper42
  2023-03-01 13:23 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (6 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2023-02-28 22:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1120879732

Comment:
I think we can go with the second option, it's relatively elegant and simple.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (41 preceding siblings ...)
  2023-02-28 22:36 ` paper42
@ 2023-03-01 13:23 ` TinfoilSubmarine
  2023-03-01 13:26 ` [PR REVIEW] " TinfoilSubmarine
                   ` (5 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-03-01 13:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2367 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 59204 bytes --]

From 3897571ce20bf7c9a85b0a070d3cfa0da44fb893 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] php: turn into meta package.

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions

fix symlinks
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  27 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  26 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  23 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  27 --
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   4 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 389 +++++-------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  22 -
 srcpkgs/xdebug/update                         |   1 -
 32 files changed, 108 insertions(+), 799 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 57091f0adcfb..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.5.3
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index dfb0e9da2fca..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 11c50fe190b0..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index ee6586747683..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,23 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index bfd5393ea055..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index 98c6bdd9411d..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 39e4d161b648..9f8ae7f8edf0 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,353 +1,168 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.33
+version=8.1
 revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Orphaned <orphan@voidlinux.org>"
+build_style=meta
+depends="php${version}"
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index af14853304e2..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,22 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From 3735fa53a8c807692803e57dc71c69944ab28935 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add `php` alternatives group.

---
 srcpkgs/php8.0/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..6f694bf928a1 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 760a1338e69a5c6bdb0c3ce1801680b26931fb71 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add `php` alternatives group.

---
 srcpkgs/php8.1/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..49fd265f684f 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 6d3a2fe529e58dc14c616436ead22352bc7284bb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add `composer` alternatives group.

---
 srcpkgs/composer8.0/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index afdcb1e535a6..b7e3e2958bd5 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 2d6dc954566db3272f16440a2748315a747dec36 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add `composer` alternatives group.

---
 srcpkgs/composer8.1/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index c790e032ddbe..3642db074345 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From 8c38f99c27f43c51dc2d38dd4261d2baaca8318b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 3d99e75457b9e804aa538bd5a800a6830b2b9620 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (42 preceding siblings ...)
  2023-03-01 13:23 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2023-03-01 13:26 ` TinfoilSubmarine
  2023-03-02 21:25 ` paper42
                   ` (4 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-03-01 13:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1121726094

Comment:
OK thanks for the input! I have updated this PR to include it and fixed merge conflicts.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (43 preceding siblings ...)
  2023-03-01 13:26 ` [PR REVIEW] " TinfoilSubmarine
@ 2023-03-02 21:25 ` paper42
  2023-03-02 21:58 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (3 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2023-03-02 21:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1123724373

Comment:
these packages need to be revbumped, otherwise people would still be getting the old version without alternatives until the next update

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Updated] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (44 preceding siblings ...)
  2023-03-02 21:25 ` paper42
@ 2023-03-02 21:58 ` TinfoilSubmarine
  2023-03-02 21:59 ` [PR REVIEW] " TinfoilSubmarine
                   ` (2 subsequent siblings)
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-03-02 21:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

There is an updated pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages maint/php
https://github.com/void-linux/void-packages/pull/38536

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

A patch file from https://github.com/void-linux/void-packages/pull/38536.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-maint/php-38536.patch --]
[-- Type: text/x-diff, Size: 59618 bytes --]

From a038d536f54f0ef5154f0d81d6929d942986d9f3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 6 Dec 2022 12:02:06 -0500
Subject: [PATCH 1/7] php: turn into meta package.

7.4 is EOL, so pull all packages into a single location to enable easier
version transitions

fix symlinks
---
 srcpkgs/composer                              |   1 +
 srcpkgs/composer/template                     |  24 --
 srcpkgs/php-apcu                              |   1 +
 srcpkgs/php-apcu/INSTALL.msg                  |   3 -
 srcpkgs/php-apcu/template                     |  27 --
 srcpkgs/php-apcu/update                       |   2 -
 srcpkgs/php-ast                               |   1 +
 srcpkgs/php-ast/INSTALL.msg                   |   2 -
 srcpkgs/php-ast/template                      |  26 --
 srcpkgs/php-igbinary                          |   1 +
 srcpkgs/php-igbinary/template                 |  23 --
 srcpkgs/php-imagick                           |   1 +
 srcpkgs/php-imagick/INSTALL.msg               |   3 -
 ...le-libmagick-header-file-search-path.patch |  17 -
 srcpkgs/php-imagick/template                  |  27 --
 srcpkgs/php/files/apache.conf                 |  13 -
 srcpkgs/php/files/php-fpm/run                 |   4 -
 srcpkgs/php/patches/php-706-crypt.patch       |  15 -
 srcpkgs/php/patches/php-cross-config.patch    |  41 --
 srcpkgs/php/patches/php-enchant2.patch        | 103 -----
 srcpkgs/php/patches/php-fpm.patch             |  13 -
 .../patches/php-ltmain-sysroot-support.patch  |  39 --
 srcpkgs/php/patches/php-pear-cross.patch      |  23 --
 srcpkgs/php/patches/php-phar-cross.patch      |  29 --
 .../patches/php-phpize-sysroot-support.patch  |  28 --
 srcpkgs/php/patches/php.ini.patch             |  24 --
 srcpkgs/php/template                          | 389 +++++-------------
 srcpkgs/php/update                            |   2 -
 srcpkgs/xdebug                                |   1 +
 srcpkgs/xdebug/INSTALL.msg                    |   1 -
 srcpkgs/xdebug/template                       |  22 -
 srcpkgs/xdebug/update                         |   1 -
 32 files changed, 108 insertions(+), 799 deletions(-)
 create mode 120000 srcpkgs/composer
 delete mode 100644 srcpkgs/composer/template
 create mode 120000 srcpkgs/php-apcu
 delete mode 100644 srcpkgs/php-apcu/INSTALL.msg
 delete mode 100644 srcpkgs/php-apcu/template
 delete mode 100644 srcpkgs/php-apcu/update
 create mode 120000 srcpkgs/php-ast
 delete mode 100644 srcpkgs/php-ast/INSTALL.msg
 delete mode 100644 srcpkgs/php-ast/template
 create mode 120000 srcpkgs/php-igbinary
 delete mode 100644 srcpkgs/php-igbinary/template
 create mode 120000 srcpkgs/php-imagick
 delete mode 100644 srcpkgs/php-imagick/INSTALL.msg
 delete mode 100644 srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 delete mode 100644 srcpkgs/php-imagick/template
 delete mode 100644 srcpkgs/php/files/apache.conf
 delete mode 100755 srcpkgs/php/files/php-fpm/run
 delete mode 100644 srcpkgs/php/patches/php-706-crypt.patch
 delete mode 100644 srcpkgs/php/patches/php-cross-config.patch
 delete mode 100644 srcpkgs/php/patches/php-enchant2.patch
 delete mode 100644 srcpkgs/php/patches/php-fpm.patch
 delete mode 100644 srcpkgs/php/patches/php-ltmain-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php-pear-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phar-cross.patch
 delete mode 100644 srcpkgs/php/patches/php-phpize-sysroot-support.patch
 delete mode 100644 srcpkgs/php/patches/php.ini.patch
 delete mode 100644 srcpkgs/php/update
 create mode 120000 srcpkgs/xdebug
 delete mode 100644 srcpkgs/xdebug/INSTALL.msg
 delete mode 100644 srcpkgs/xdebug/template
 delete mode 100644 srcpkgs/xdebug/update

diff --git a/srcpkgs/composer b/srcpkgs/composer
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/composer
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template
deleted file mode 100644
index 57091f0adcfb..000000000000
--- a/srcpkgs/composer/template
+++ /dev/null
@@ -1,24 +0,0 @@
-# Template file for 'composer'
-pkgname=composer
-version=2.5.3
-revision=1
-build_style=fetch
-depends="php"
-short_desc="Dependency manager for PHP"
-maintainer="Felipe Nogueira <contato.fnog@gmail.com>"
-license="MIT"
-homepage="https://getcomposer.org/"
-changelog="https://raw.githubusercontent.com/composer/composer/main/CHANGELOG.md"
-distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar
- https://raw.githubusercontent.com/composer/composer/main/LICENSE"
-checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
- 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
-
-do_install() {
-	vbin composer.phar composer
-	vlicense LICENSE
-
-	vmkdir /etc/php/conf.d
-	printf 'extension=%s\n' phar iconv openssl zip \
-		>${DESTDIR}/etc/php/conf.d/composer.ini
-}
diff --git a/srcpkgs/php-apcu b/srcpkgs/php-apcu
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-apcu
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-apcu/INSTALL.msg b/srcpkgs/php-apcu/INSTALL.msg
deleted file mode 100644
index 9da8a70ccc2b..000000000000
--- a/srcpkgs/php-apcu/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable APCu add the following line to your php.ini:
-
-	extension=apcu.so
diff --git a/srcpkgs/php-apcu/template b/srcpkgs/php-apcu/template
deleted file mode 100644
index dfb0e9da2fca..000000000000
--- a/srcpkgs/php-apcu/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'php-apcu'
-pkgname=php-apcu
-version=5.1.22
-revision=1
-build_style=gnu-configure
-make_check_target=test
-hostmakedepends="autoconf pcre2-devel php-devel"
-makedepends="php-devel"
-depends="php>=7.4.3"
-short_desc="In-memory key-value store for PHP"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/APCu"
-distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
-checksum=010a0d8fd112e1ed7a52a356191da3696a6b76319423f7b0dfdeaeeafcb41a1e
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php-apcu/update b/srcpkgs/php-apcu/update
deleted file mode 100644
index ad899519e313..000000000000
--- a/srcpkgs/php-apcu/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="https://pecl.php.net/package/APCu"
-pattern="apcu-\K[\d\.]*(?=\.tgz)"
diff --git a/srcpkgs/php-ast b/srcpkgs/php-ast
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-ast
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-ast/INSTALL.msg b/srcpkgs/php-ast/INSTALL.msg
deleted file mode 100644
index 0dd0b5df2d96..000000000000
--- a/srcpkgs/php-ast/INSTALL.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-To enable the ast extension please add the following to php.ini:
-	extension=ast.so 
diff --git a/srcpkgs/php-ast/template b/srcpkgs/php-ast/template
deleted file mode 100644
index 11c50fe190b0..000000000000
--- a/srcpkgs/php-ast/template
+++ /dev/null
@@ -1,26 +0,0 @@
-# Template file for 'php-ast'
-pkgname=php-ast
-version=1.1.0
-revision=1
-build_style=gnu-configure
-make_check_target="test"
-hostmakedepends="php-devel autoconf"
-makedepends="php-devel"
-depends="php>=7.4.3"
-checkdepends="${depends}"
-short_desc="Exposes the abstract syntax tree generated by PHP 7"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/nikic/php-ast"
-distfiles="https://pecl.php.net/get/ast-${version}.tgz"
-checksum=ee3d4f67e24d82e4d340806a24052012e4954d223122949377665427443e6d13
-make_check_pre="env NO_INTERACTION=1"
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/php-igbinary b/srcpkgs/php-igbinary
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-igbinary
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-igbinary/template b/srcpkgs/php-igbinary/template
deleted file mode 100644
index ee6586747683..000000000000
--- a/srcpkgs/php-igbinary/template
+++ /dev/null
@@ -1,23 +0,0 @@
-# Template file for 'php-igbinary'
-pkgname=php-igbinary
-version=3.2.12
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-depends="php>7.4.3"
-short_desc="Igbinary is a drop in replacement for the standard php serializer"
-maintainer="Merlin Diavova <merlindiavova@gmail.com>"
-license="BSD-3-Clause"
-homepage="https://github.com/igbinary/igbinary/"
-distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
-checksum=b69cffdf054cc6e6b02893ff77cf440cec8c7a87d2dc00c1af183c212269581c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT="${DESTDIR}" install
-	vlicense COPYING
-}
diff --git a/srcpkgs/php-imagick b/srcpkgs/php-imagick
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/php-imagick
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/php-imagick/INSTALL.msg b/srcpkgs/php-imagick/INSTALL.msg
deleted file mode 100644
index 00497519fcee..000000000000
--- a/srcpkgs/php-imagick/INSTALL.msg
+++ /dev/null
@@ -1,3 +0,0 @@
-To enable the Imagick extension add the following line to your php.ini:
-
-	extension=imagick.so
diff --git a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
deleted file mode 100644
index 16b8aaa57371..000000000000
--- a/srcpkgs/php-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/imagemagick.m4	2021-09-09 10:53:42.287881616 +0200
-+++ b/imagemagick.m4	2021-09-09 11:14:47.662312430 +0200
-@@ -167,6 +167,14 @@ AC_DEFUN([IM_FIND_IMAGEMAGICK],[
-   
-     AC_MSG_RESULT([user location ${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/wand/MagickWand.h])
- 
-+  elif test -r "${IM_IMAGEMAGICK_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
-+
-+    IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
-+    IM_HEADER_STYLE="SEVEN"
-+    AC_DEFINE([IM_MAGICKWAND_HEADER_STYLE_SEVEN], [1], [ImageMagick 7.x style header])
-+
-+    AC_MSG_RESULT([${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h])
-+
-   elif test -r "${IM_PREFIX}/include/ImageMagick-${IM_MAJOR_VERSION}/MagickWand/MagickWand.h"; then
- 
-     IM_INCLUDE_FORMAT="MagickWand/MagickWand.h"
diff --git a/srcpkgs/php-imagick/template b/srcpkgs/php-imagick/template
deleted file mode 100644
index bfd5393ea055..000000000000
--- a/srcpkgs/php-imagick/template
+++ /dev/null
@@ -1,27 +0,0 @@
-# Template file for 'php-imagick'
-pkgname=php-imagick
-version=3.4.4
-revision=5
-build_style=gnu-configure
-configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr"
-hostmakedepends="php-devel autoconf pkg-config"
-makedepends="php-devel pcre2-devel libmagick-devel"
-depends="php>=7.4.3"
-short_desc="Provides a PHP wrapper to the ImageMagick library"
-maintainer="Alin Dobre <alin.dobre@outlook.com>"
-license="PHP-3.01"
-homepage="https://pecl.php.net/package/imagick"
-distfiles="https://pecl.php.net/get/imagick-$version.tgz"
-checksum=8dd5aa16465c218651fc8993e1faecd982e6a597870fd4b937e9ece02d567077
-
-pre_configure() {
-	phpize
-}
-
-pre_install() {
-	make_install_args="INSTALL_ROOT=$DESTDIR"
-}
-
-post_install() {
-	rm -r $DESTDIR/usr/include
-}
diff --git a/srcpkgs/php/files/apache.conf b/srcpkgs/php/files/apache.conf
deleted file mode 100644
index b516b5e66ffa..000000000000
--- a/srcpkgs/php/files/apache.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-# Required modules: dir_module, php7_module
-
-<IfModule dir_module>
-	<IfModule php7_module>
-		DirectoryIndex index.php index.html
-		<FilesMatch "\.php$">
-			SetHandler application/x-httpd-php
-		</FilesMatch>
-		<FilesMatch "\.phps$">
-			SetHandler application/x-httpd-php-source
-		</FilesMatch>
-	</IfModule>
-</IfModule>
diff --git a/srcpkgs/php/files/php-fpm/run b/srcpkgs/php/files/php-fpm/run
deleted file mode 100755
index 98c6bdd9411d..000000000000
--- a/srcpkgs/php/files/php-fpm/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-
-exec php-fpm --nodaemonize
diff --git a/srcpkgs/php/patches/php-706-crypt.patch b/srcpkgs/php/patches/php-706-crypt.patch
deleted file mode 100644
index 254f1d2187c2..000000000000
--- a/srcpkgs/php/patches/php-706-crypt.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/ext/standard/crypt.c	2016-04-28 14:13:00.000000000 -0400
-+++ b/ext/standard/crypt.c	2016-04-28 21:45:24.340955313 -0400
-@@ -267,6 +267,12 @@
- 	}
- # elif defined(HAVE_CRYPT)
- 	crypt_res = crypt(password, salt);
-+	if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
-+		return NULL;
-+	} else {
-+		result = zend_string_init(crypt_res, strlen(crypt_res), 0);
-+		return result;
-+	}
- # else
- #  error No crypt() implementation
- # endif
diff --git a/srcpkgs/php/patches/php-cross-config.patch b/srcpkgs/php/patches/php-cross-config.patch
deleted file mode 100644
index d6af2c58cb25..000000000000
--- a/srcpkgs/php/patches/php-cross-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- a/configure	2020-03-17 11:40:20.000000000 +0100
-+++ b/configure	2020-04-12 19:51:57.216350534 +0200
-@@ -6374,10 +6374,12 @@ IFS="- /.
-     as_fn_error $? "Please note that Apache version >= 2.0.44 is required" "$LINENO" 5
-   fi
- 
-+  APXS_PREFIX='$(INSTALL_ROOT)'/usr
-   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
-   if test -z `$APXS -q SYSCONFDIR`; then
-     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -n php7"
-   else
-     APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
-@@ -6385,6 +6387,7 @@ IFS="- /.
-                 \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
-                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-                        -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-+                       -S PREFIX='$APXS_PREFIX' \
-                        -i -a -n php7"
-   fi
- 
-@@ -57170,7 +57173,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
-@@ -58821,7 +58824,7 @@ $as_echo_n "checking for pg_config... "
-     fi
-   done
- 
--  if test -n "$PG_CONFIG"; then
-+  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
- $as_echo "$PG_CONFIG" >&6; }
-     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php/patches/php-enchant2.patch b/srcpkgs/php/patches/php-enchant2.patch
deleted file mode 100644
index b82c41211123..000000000000
--- a/srcpkgs/php/patches/php-enchant2.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/configure b/configure
-index 3ece7a4..b832a68 100755
---- a/configure
-+++ b/configure
-@@ -28123,19 +28123,19 @@ $as_echo "$ext_output" >&6; }
- if test "$PHP_ENCHANT" != "no"; then
- 
- pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant" >&5
--$as_echo_n "checking for enchant... " >&6; }
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enchant-2" >&5
-+$as_echo_n "checking for enchant-2... " >&6; }
- 
- if test -n "$ENCHANT_CFLAGS"; then
-     pkg_cv_ENCHANT_CFLAGS="$ENCHANT_CFLAGS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_CFLAGS=`$PKG_CONFIG --cflags "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28147,12 +28147,12 @@ if test -n "$ENCHANT_LIBS"; then
-     pkg_cv_ENCHANT_LIBS="$ENCHANT_LIBS"
-  elif test -n "$PKG_CONFIG"; then
-     if test -n "$PKG_CONFIG" && \
--    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant\""; } >&5
--  ($PKG_CONFIG --exists --print-errors "enchant") 2>&5
-+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"enchant-2\""; } >&5
-+  ($PKG_CONFIG --exists --print-errors "enchant-2") 2>&5
-   ac_status=$?
-   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-   test $ac_status = 0; }; then
--  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant" 2>/dev/null`
-+  pkg_cv_ENCHANT_LIBS=`$PKG_CONFIG --libs "enchant-2" 2>/dev/null`
- 		      test "x$?" != "x0" && pkg_failed=yes
- else
-   pkg_failed=yes
-@@ -28173,14 +28173,14 @@ else
-         _pkg_short_errors_supported=no
- fi
-         if test $_pkg_short_errors_supported = yes; then
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "enchant-2" 2>&1`
-         else
--	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant" 2>&1`
-+	        ENCHANT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "enchant-2" 2>&1`
-         fi
- 	# Put the nasty error message in config.log where it belongs
- 	echo "$ENCHANT_PKG_ERRORS" >&5
- 
--	as_fn_error $? "Package requirements (enchant) were not met:
-+	as_fn_error $? "Package requirements (enchant-2) were not met:
- 
- $ENCHANT_PKG_ERRORS
- 
-diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
-index 6ce9d4b..1923726 100644
---- a/ext/enchant/enchant.c
-+++ b/ext/enchant/enchant.c
-@@ -738,7 +738,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
- 			for (i = 0; i < n_sugg; i++) {
- 				add_next_index_string(sugg, suggs[i]);
- 			}
--			enchant_dict_free_suggestions(pdict->pdict, suggs);
-+			enchant_dict_free_string_list(pdict->pdict, suggs);
- 		}
- 
- 
-@@ -793,7 +793,7 @@ PHP_FUNCTION(enchant_dict_suggest)
- 			add_next_index_string(return_value, suggs[i]);
- 		}
- 
--		enchant_dict_free_suggestions(pdict->pdict, suggs);
-+		enchant_dict_free_string_list(pdict->pdict, suggs);
- 	}
- }
- /* }}} */
-@@ -813,7 +813,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
-+	enchant_dict_add(pdict->pdict, word, wordlen);
- }
- /* }}} */
- 
-@@ -851,7 +851,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
- 
- 	PHP_ENCHANT_GET_DICT;
- 
--	RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
-+	RETURN_BOOL(enchant_dict_is_added(pdict->pdict, word, wordlen));
- }
- /* }}} */
- 
diff --git a/srcpkgs/php/patches/php-fpm.patch b/srcpkgs/php/patches/php-fpm.patch
deleted file mode 100644
index 5e55e179f8a4..000000000000
--- a/srcpkgs/php/patches/php-fpm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/sapi/fpm/Makefile.frag	2017-04-15 23:58:56.965737425 +0200
-+++ b/sapi/fpm/Makefile.frag	2017-04-16 00:00:57.814831649 +0200
-@@ -15,8 +15,8 @@ install-fpm: $(SAPI_FPM_PATH)
- 	else \
- 		echo "Installing PHP FPM defconfig:     $(INSTALL_ROOT)$(sysconfdir)/" && \
- 		$(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d; \
--		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default; \
--		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default; \
-+		$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf; \
-+		$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf; \
- 	fi
- 	
- 	@echo "Installing PHP FPM man page:      $(INSTALL_ROOT)$(mandir)/man8/"
diff --git a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
deleted file mode 100644
index bbe0a514a9e8..000000000000
--- a/srcpkgs/php/patches/php-ltmain-sysroot-support.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/build/ltmain.sh	2021-09-09 15:19:14.822208365 +0200
-+++ b/build/ltmain.sh	2021-09-09 15:47:55.397011151 +0200
-@@ -2375,6 +2375,13 @@ EOF
- 	*) . ./$lib ;;
- 	esac
- 
-+        newdependency_libs=
-+        for deplib in $dependency_libs; do
-+            deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
-+            newdependency_libs="$newdependency_libs $deplib"
-+        done
-+        dependency_libs=${newdependency_libs}
-+
- 	if test "$linkmode,$pass" = "lib,link" ||
- 	   test "$linkmode,$pass" = "prog,scan" ||
- 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-@@ -5750,6 +5757,13 @@ fi\
- 	  case $host,$output,$installed,$module,$dlname in
- 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- 	  esac
-+
-+          newdependency_libs=
-+          for deplib in $dependency_libs; do
-+              deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
-+              newdependency_libs="$newdependency_libs $deplib"
-+          done
-+
- 	  $echo > $output "\
- # $outputname - a libtool library file
- # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-@@ -5767,7 +5781,7 @@ library_names='$library_names'
- old_library='$old_library'
- 
- # Libraries that this one depends upon.
--dependency_libs='$dependency_libs'
-+dependency_libs='$newdependency_libs'
- 
- # Version information for $libname.
- current=$current
diff --git a/srcpkgs/php/patches/php-pear-cross.patch b/srcpkgs/php/patches/php-pear-cross.patch
deleted file mode 100644
index f9191a50a0b5..000000000000
--- a/srcpkgs/php/patches/php-pear-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/pear/Makefile.frag	2020-03-17 11:40:21.000000000 +0100
-+++ b/pear/Makefile.frag	2020-04-12 22:29:31.846943414 +0200
-@@ -8,9 +8,10 @@ FETCH = `which fetch 2>/dev/null`
- PEAR_PREFIX = -dp a${program_prefix}
- PEAR_SUFFIX = -ds a$(program_suffix)
- PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
-+PEAR_PHP ?= $(top_builddir)/sapi/cli/php
- 
- install-pear-installer: $(SAPI_CLI_PATH)
--	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
-+	@$(PEAR_PHP) $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
- 
- install-pear:
- 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
-@@ -23,7 +24,7 @@ install-pear:
- 			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
- 				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
- 			else \
--				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
-+				$(PEAR_PHP) -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
- 			fi \
- 		fi \
- 	fi
diff --git a/srcpkgs/php/patches/php-phar-cross.patch b/srcpkgs/php/patches/php-phar-cross.patch
deleted file mode 100644
index 1e4e627ec65b..000000000000
--- a/srcpkgs/php/patches/php-phar-cross.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/ext/phar/Makefile.frag	2020-04-13 12:18:23.998801926 +0200
-+++ b/ext/phar/Makefile.frag	2020-04-13 12:20:58.031795293 +0200
-@@ -8,12 +8,14 @@ $(srcdir)/phar_path_check.c: $(srcdir)/p
- 
- pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
- 
-+PHAR_PHP ?= $(top_builddir)/$(SAPI_CLI_PATH)
-+PHAR_PHP_MODULES ?= $(top_builddir)/modules
- PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0
- PHP_PHARCMD_EXECUTABLE = ` \
--	if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \
--		$(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
-+	if test -x "$(PHAR_PHP)"; then \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP) -n"; \
- 		if test "x$(PHP_MODULES)" != "x"; then \
--		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
-+		$(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(PHAR_PHP_MODULES)"; \
- 		for i in bz2 zlib phar; do \
- 			if test -f "$(top_builddir)/modules/$$i.la"; then \
- 				. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
-@@ -21,7 +23,7 @@ PHP_PHARCMD_EXECUTABLE = ` \
- 		done; \
- 		fi; \
- 	else \
--		$(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \
-+		$(top_srcdir)/build/shtool echo -n -- "$(PHAR_PHP)"; \
- 	fi;`
- PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)";`
- 
diff --git a/srcpkgs/php/patches/php-phpize-sysroot-support.patch b/srcpkgs/php/patches/php-phpize-sysroot-support.patch
deleted file mode 100644
index 76cff3f81664..000000000000
--- a/srcpkgs/php/patches/php-phpize-sysroot-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/scripts/phpize.m4	2020-03-17 11:40:21.000000000 +0100
-+++ b/scripts/phpize.m4	2020-04-15 12:27:36.400466387 +0200
-@@ -44,6 +44,12 @@ PHP_ARG_WITH([libdir],
-   [lib],
-   [no])
- 
-+PHP_ARG_WITH([sysroot],,
-+  [AS_HELP_STRING([--with-sysroot=NAME],
-+    [System sysroot])],
-+    [no],
-+    [no])
-+
- PHP_RUNPATH_SWITCH
- PHP_SHLIB_SUFFIX_NAMES
- 
-@@ -58,7 +64,11 @@ dnl For BC.
- PHP_CONFIG=$PHP_PHP_CONFIG
- prefix=`$PHP_CONFIG --prefix 2>/dev/null`
- phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
--INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+if test "x$PHP_SYSROOT" = xno; then :
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
-+else
-+	INCLUDES=`$PHP_CONFIG --includes 2>/dev/null | sed "s#-I#-I$PHP_SYSROOT#g"`
-+fi
- EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
- PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
- 
diff --git a/srcpkgs/php/patches/php.ini.patch b/srcpkgs/php/patches/php.ini.patch
deleted file mode 100644
index 47197c778d34..000000000000
--- a/srcpkgs/php/patches/php.ini.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git php.ini-production php.ini-production
-index 794d3e8ddb..c7acf9c883 100644
---- a/php.ini-production
-+++ b/php.ini-production
-@@ -729,7 +729,7 @@ default_charset = "UTF-8"
- ;;;;;;;;;;;;;;;;;;;;;;;;;
- 
- ; UNIX: "/path1:/path2"
--;include_path = ".:/php/includes"
-+include_path = ".:/usr/share/pear"
- ;
- ; Windows: "\path1;\path2"
- ;include_path = ".;c:\php\includes"
-@@ -752,9 +752,7 @@ user_dir =
- 
- ; Directory in which the loadable extensions (modules) reside.
- ; http://php.net/extension-dir
--;extension_dir = "./"
--; On windows:
--;extension_dir = "ext"
-+extension_dir = "/usr/lib/php/modules/"
- 
- ; Directory where the temporary files should be placed.
- ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php/template b/srcpkgs/php/template
index 39e4d161b648..9f8ae7f8edf0 100644
--- a/srcpkgs/php/template
+++ b/srcpkgs/php/template
@@ -1,353 +1,168 @@
 # Template file for 'php'
 pkgname=php
-version=7.4.33
+version=8.1
 revision=1
-hostmakedepends="bison pkg-config apache-devel"
-makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
- gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel
- libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
- postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel pcre2-devel
- libffi-devel oniguruma-devel gd-devel"
-short_desc="HTML-embedded scripting language"
-maintainer="Orphaned <orphan@voidlinux.org>"
+build_style=meta
+depends="php${version}"
+short_desc="Meta package for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="PHP-3.01"
 homepage="https://www.php.net"
-changelog="https://www.php.net/ChangeLog-7.php"
-# this is the source where the www.php.net code pulls the tarballs it serves
-# at https://www.php.net/distributions/
-distfiles="https://github.com/php/web-php-distributions/raw/master/php-${version}.tar.gz"
-checksum=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
-
-conf_files="/etc/php/php.ini"
-
-lib32disabled=yes
+changelog="https://raw.githubusercontent.com/php/php-src/php-${version}/NEWS"
 replaces="php-mcrypt<7.2.0"
 
-if [ -n "$CROSS_BUILD" ]; then
-	# php-pear needs php to build
-	hostmakedepends+=" php"
-	CFLAGS+=" -DHAVE_LIBDL
-		 -DHAVE_DLOPEN
-		 -DHAVE_DLSYM
-		 -DHAVE_SHM_IPC
-		 -DHAVE_SHM_MMAP_ANON
-		 -DHAVE_SHM_MMAP_ZERO
-		 -DHAVE_SHM_MMAP_POSIX
-		 -DHAVE_SHM_MMAP_FILE"
-fi
-
-do_build() {
-	local _phpconfig="--srcdir=.. \
-		--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 \
-		--with-pear=/usr/share/pear \
-		"
-
-	local _phpextensions="--enable-bcmath=shared \
-		--enable-calendar=shared \
-		--enable-exif=shared \
-		--enable-ftp=shared \
-		--enable-intl=shared \
-		--enable-mbstring \
-		--enable-opcache \
-		--enable-pcntl \
-		--enable-phar=shared \
-		--enable-posix=shared \
-		--enable-shmop=shared \
-		--enable-soap=shared \
-		--enable-sockets=shared \
-		--enable-sysvmsg=shared \
-		--enable-sysvsem=shared \
-		--enable-sysvshm=shared \
-		--enable-mysqlnd \
-		--enable-gd=shared \
-		--with-external-gd \
-		--with-zip=shared \
-		--with-ffi=shared \
-		--with-bz2=shared,$XBPS_CROSS_BASE/usr/ \
-		--with-curl=shared \
-		--with-db4=$XBPS_CROSS_BASE/usr \
-		--with-enchant=shared,$XBPS_CROSS_BASE/usr \
-		--with-freetype-dir=$XBPS_CROSS_BASE/usr \
-		--with-gdbm=$XBPS_CROSS_BASE/usr \
-		--with-gettext=shared \
-		--with-gmp=shared \
-		--with-iconv=shared \
-		--with-icu-dir=$XBPS_CROSS_BASE/usr \
-		--with-jpeg-dir=$XBPS_CROSS_BASE/usr \
-		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
-		--with-ldap-sasl \
-		--with-libzip \
-		--with-sodium=shared \
-		--with-mhash \
-		--with-mysql-sock=/run/mysqld/mysqld.sock \
-		--with-mysqli=shared,mysqlnd \
-		--with-openssl=shared \
-		--with-pcre-regex=$XBPS_CROSS_BASE/usr \
-		--with-pdo-mysql=shared,mysqlnd \
-		--with-pdo-odbc=shared,unixODBC,$XBPS_CROSS_BASE/usr \
-		--with-pdo-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-pdo-sqlite=shared,$XBPS_CROSS_BASE/usr \
-		--with-pgsql=shared,$XBPS_CROSS_BASE/usr \
-		--with-png-dir=$XBPS_CROSS_BASE/usr \
-		--with-readline=$XBPS_CROSS_BASE/usr \
-		--with-snmp=shared,$XBPS_CROSS_BASE/usr \
-		--with-sqlite3=shared,$XBPS_CROSS_BASE/usr \
-		--with-unixODBC=shared,$XBPS_CROSS_BASE/usr \
-		--with-xsl=shared,$XBPS_CROSS_BASE/usr \
-		--with-tidy=shared,$XBPS_CROSS_BASE/usr \
-		--with-zlib \
-		${configure_args} \
-		"
-	if [ -n "$CROSS_BUILD" ]; then
-		local _make_env="PHAR_PHP=/usr/bin/php PHAR_PHP_MODULES=/usr/lib/php/modules"
-	fi
-
-	EXTENSION_DIR=/usr/lib/php/modules
-	export EXTENSION_DIR
-	PEAR_INSTALLDIR=/usr/share/pear
-	export PEAR_INSTALLDIR
-	EXTRA_LIBS="-ldl"
-	export EXTRA_LIBS
-
-	# cgi,cli,embed,fcgi,fpm
-	mkdir -p build
-	cd build
-	ln -s ${wrksrc}/configure
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--enable-cgi \
-		--enable-fpm \
-		--with-fpm-user=http \
-		--with-fpm-group=http \
-		--enable-embed=shared \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-
-	# apache
-	# reuse the previous run; this will save us a lot of time
-	cp -a ${wrksrc}/build ${wrksrc}/build-apache
-	cd ${wrksrc}/build-apache
-	./configure ${_phpconfig} \
-		--host=${XBPS_CROSS_TRIPLET} \
-		--with-apxs2 \
-		${_phpextensions}
-	make ${makejobs} ${_make_env}
-}
-
-do_install() {
-	cd ${wrksrc}/build
-	local _env="INSTALL_ROOT=${DESTDIR}"
-	if [ -n "$CROSS_BUILD" ]; then
-		_env+=" PHAR_PHP=/usr/bin/php"
-	fi
-	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
-
-	# install php.ini
-	vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
-	# remove static modules
-	rm -f ${DESTDIR}/usr/lib/php/modules/*.a
-}
-
 php-devel_package() {
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/php/build
-		vmove usr/bin/php-config
-		vmove usr/bin/phpize
-		vmove usr/share/man/man1/phpize.1
-		vmove usr/share/man/man1/php-config.1
-	}
+	depends="php${version}-devel"
+	build_style=meta
+	short_desc="PHP development files meta package"
 }
 
 php-phpdbg_package() {
-	short_desc+=" - interactive debugger"
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
-	}
+	depends="php${version}-phpdbg"
+	build_style=meta
+	short_desc="PHP interactive debugger meta package"
 }
 
 php-cgi_package() {
-	short_desc+=' - CGI and FCGI SAPI'
-	depends="php-${version}_${revision}"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
-	}
+	depends="php${version}-cgi"
+	build_style=meta
+	short_desc="PHP CGI and FCGI SAPI meta package"
 }
 
 php-apache_package() {
-	short_desc+=' - Apache SAPI'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/apache/extra/php7_module.conf"
-	pkg_install() {
-		vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
-		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
-	}
+	depends="php${version}-apache"
+	build_style=meta
+	short_desc="PHP Apache SAPI meta package"
 }
 
 php-fpm_package() {
-	short_desc+=' - FastCGI Process Manager'
-	depends="php-${version}_${revision}"
-	conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
-		vsv php-fpm
-	}
+	depends="php${version}-fpm"
+	build_style=meta
+	short_desc="PHP FastCGI Process Manager meta package"
 }
 
 php-embed_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Embed SAPI'
-	pkg_install() {
-		cd ${wrksrc}/build
-		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
-	}
+	depends="php${version}-embed"
+	build_style=meta
+	short_desc="PHP Embed SAPI meta package"
 }
 
 php-pear_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PHP Extension and Application Repository'
-	conf_files="/etc/php/pear.conf"
-	pkg_install() {
-		cd ${wrksrc}/build
-		local _env="INSTALL_ROOT=${PKGDESTDIR}"
-		if [ -n "$CROSS_BUILD" ]; then
-			_env+=" PEAR_PHP=/usr/bin/php"
-		fi
-		make install-pear ${_env}
-		rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
-		rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
-	}
+	depends="php${version}-pear"
+	build_style=meta
+	short_desc="PHP Extension and Application Repository meta package"
 }
 
 php-enchant_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - enchant module'
-	pkg_install() {
-		vmove usr/lib/php/modules/enchant.so
-	}
+	depends="php${version}-enchant"
+	build_style=meta
+	short_desc="PHP enchant module meta package"
 }
 
 php-gd_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - gd module'
-	pkg_install() {
-		vmove usr/lib/php/modules/gd.so
-	}
+	depends="php${version}-gd"
+	build_style=meta
+	short_desc="PHP gd module meta package"
 }
 
 php-intl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - Internationalization module'
-	pkg_install() {
-		vmove usr/lib/php/modules/intl.so
-	}
+	depends="php${version}-intl"
+	build_style=meta
+	short_desc="PHP Internationalization module meta package"
 }
 
 php-ldap_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - LDAP module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ldap.so
-	}
+	depends="php${version}-ldap"
+	build_style=meta
+	short_desc="PHP LDAP module meta package"
 }
 
 php-mysql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - MySQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*mysql*.so"
-	}
+	depends="php${version}-mysql"
+	build_style=meta
+	short_desc="PHP MySQL modules meta package"
 }
 
 php-odbc_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - ODBC modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*odbc.so"
-	}
+	depends="php${version}-odbc"
+	build_style=meta
+	short_desc="PHP ODBC modules meta package"
 }
 
 php-pgsql_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - PostgreSQL modules'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*pgsql.so"
-	}
+	depends="php${version}-pgsql"
+	build_style=meta
+	short_desc="PHP PostgreSQL modules meta package"
 }
 
 php-snmp_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - snmp module'
-	pkg_install() {
-		vmove usr/lib/php/modules/snmp.so
-	}
+	depends="php${version}-snmp"
+	build_style=meta
+	short_desc="PHP snmp module meta package"
 }
 
 php-sqlite_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sqlite module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*sqlite*.so"
-	}
+	depends="php${version}-sqlite"
+	build_style=meta
+	short_desc="PHP sqlite module meta package"
 }
 
 php-tidy_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - tidy HTML module'
-	pkg_install() {
-		vmove "usr/lib/php/modules/*tidy*.so"
-	}
+	depends="php${version}-tidy"
+	build_style=meta
+	short_desc="PHP tidy HTML module meta package"
 }
 
 php-xsl_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - XSL module'
-	pkg_install() {
-		vmove usr/lib/php/modules/xsl.so
-	}
+	depends="php${version}-xsl"
+	build_style=meta
+	short_desc="PHP XSL module meta package"
 }
 
 php-sodium_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - sodium module'
-	pkg_install() {
-		vmove usr/lib/php/modules/sodium.so
-	}
+	depends="php${version}-sodium"
+	build_style=meta
+	short_desc="PHP sodium module meta package"
 }
 
 php-ffi_package() {
-	lib32disabled=yes
-	depends="php-${version}_${revision}"
-	short_desc+=' - FFI module'
-	pkg_install() {
-		vmove usr/lib/php/modules/ffi.so
-	}
+	depends="php${version}-ffi"
+	build_style=meta
+	short_desc="PHP FFI module meta package"
+}
+
+php-apcu_package() {
+	depends="php${version}-apcu"
+	build_style=meta
+	short_desc="PHP in-memory key-value store meta package"
+}
+
+php-ast_package() {
+	depends="php${version}-ast"
+	build_style=meta
+	short_desc="PHP abstract syntax tree meta package"
+}
+
+php-igbinary_package() {
+	depends="php${version}-igbinary"
+	build_style=meta
+	short_desc="PHP igbinary drop-in replacement serializer meta package"
+}
+
+php-imagick_package() {
+	depends="php${version}-imagick"
+	build_style=meta
+	short_desc="PHP ImageMagick library wrapper meta package"
+}
+
+xdebug_package() {
+	depends="xdebug${version}"
+	build_style=meta
+	short_desc="PHP debugging extension meta package"
+}
+
+composer_package() {
+	depends="composer${version}"
+	build_style=meta
+	short_desc="PHP dependency manager meta package"
 }
diff --git a/srcpkgs/php/update b/srcpkgs/php/update
deleted file mode 100644
index caf45c0dd8d1..000000000000
--- a/srcpkgs/php/update
+++ /dev/null
@@ -1,2 +0,0 @@
-ignore="8.*"
-site="https://www.php.net/distributions/"
diff --git a/srcpkgs/xdebug b/srcpkgs/xdebug
new file mode 120000
index 000000000000..fa557ad95d0a
--- /dev/null
+++ b/srcpkgs/xdebug
@@ -0,0 +1 @@
+php
\ No newline at end of file
diff --git a/srcpkgs/xdebug/INSTALL.msg b/srcpkgs/xdebug/INSTALL.msg
deleted file mode 100644
index 04e3343216f7..000000000000
--- a/srcpkgs/xdebug/INSTALL.msg
+++ /dev/null
@@ -1 +0,0 @@
-You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug/template b/srcpkgs/xdebug/template
deleted file mode 100644
index af14853304e2..000000000000
--- a/srcpkgs/xdebug/template
+++ /dev/null
@@ -1,22 +0,0 @@
-# Template file for 'xdebug'
-pkgname=xdebug
-version=2.9.3
-revision=1
-build_style=gnu-configure
-hostmakedepends="autoconf php-devel"
-makedepends="php-devel"
-short_desc="PHP debugging extension"
-maintainer="Alexander Mamay <alexander@mamay.su>"
-license="PHP-3.0"
-homepage="http://xdebug.org"
-distfiles="http://xdebug.org/files/${pkgname}-${version,,}.tgz"
-checksum=a63f567f2238d75a2244c2a4bd6f5abee817280b3567f9006c99481488dc977c
-
-pre_configure() {
-	phpize
-}
-
-do_install() {
-	make INSTALL_ROOT=${DESTDIR} install
-	vlicense LICENSE
-}
diff --git a/srcpkgs/xdebug/update b/srcpkgs/xdebug/update
deleted file mode 100644
index ec68403a03ba..000000000000
--- a/srcpkgs/xdebug/update
+++ /dev/null
@@ -1 +0,0 @@
-ignore="*alpha* *beta*"

From dbb50cac46197edf62ec5ac58bb949e411df6858 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:52 -0400
Subject: [PATCH 2/7] php8.0: add `php` alternatives group.

---
 srcpkgs/php8.0/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
index 74c50da0e46f..6f694bf928a1 100644
--- a/srcpkgs/php8.0/template
+++ b/srcpkgs/php8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.0'
 pkgname=php8.0
 version=8.0.25
-revision=1
+revision=2
 _php_version=8.0
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.0-devel_package() {
 
 php8.0-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.0-phpdbg_package() {
 
 php8.0-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.0-cgi_package() {
 
 php8.0-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.0-apache_package() {
 
 php8.0-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.0-fpm_package() {
 
 php8.0-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.0-embed_package() {
 
 php8.0-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.0-pear_package() {
 
 php8.0-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.0-enchant_package() {
 
 php8.0-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.0-gd_package() {
 
 php8.0-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.0-intl_package() {
 
 php8.0-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.0-ldap_package() {
 
 php8.0-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.0-mysql_package() {
 
 php8.0-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.0-odbc_package() {
 
 php8.0-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.0-pgsql_package() {
 
 php8.0-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.0-snmp_package() {
 
 php8.0-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.0-sqlite_package() {
 
 php8.0-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.0-tidy_package() {
 
 php8.0-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.0-xsl_package() {
 
 php8.0-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.0-sodium_package() {
 
 php8.0-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From 9c74ae5ea4eadaad78c05c883e63fba779eef222 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:36:37 -0400
Subject: [PATCH 3/7] php8.1: add `php` alternatives group.

---
 srcpkgs/php8.1/template | 50 ++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
index f19688b52f6c..49fd265f684f 100644
--- a/srcpkgs/php8.1/template
+++ b/srcpkgs/php8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'php8.1'
 pkgname=php8.1
 version=8.1.12
-revision=1
+revision=2
 _php_version=8.1
 hostmakedepends="bison pkg-config apache-devel"
 makedepends="apache-devel enchant2-devel freetds-devel freetype-devel gdbm-devel
@@ -36,6 +36,14 @@ if [ -n "$CROSS_BUILD" ]; then
 		 -DHAVE_SHM_MMAP_FILE"
 fi
 
+alternatives="
+ php:phar.phar:/usr/bin/phar${_php_version}.phar
+ php:php:/usr/bin/php${_php_version}
+ php:phar:/usr/bin/phar${_php_version}
+ php:phar.1:/usr/share/man/man1/phar${_php_version}.1
+ php:phar.phar.1:/usr/share/man/man1/phar${_php_version}.phar.1
+ php:php.1:/usr/share/man/man1/php${_php_version}.1"
+
 do_build() {
 	local _phpconfig="--srcdir=.. \
 		--config-cache \
@@ -171,7 +179,7 @@ php8.1-devel_package() {
 
 php8.1-phpdbg_package() {
 	short_desc+=" - interactive debugger"
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
@@ -180,7 +188,7 @@ php8.1-phpdbg_package() {
 
 php8.1-cgi_package() {
 	short_desc+=' - CGI and FCGI SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	pkg_install() {
 		cd ${wrksrc}/build
 		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
@@ -189,7 +197,7 @@ php8.1-cgi_package() {
 
 php8.1-apache_package() {
 	short_desc+=' - Apache SAPI'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/apache/extra/php${_php_version}_module.conf"
 	pkg_install() {
 		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules "libphp${_php_version}.so"
@@ -199,7 +207,7 @@ php8.1-apache_package() {
 
 php8.1-fpm_package() {
 	short_desc+=' - FastCGI Process Manager'
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	conf_files="/etc/php${_php_version}/php-fpm.conf /etc/php${_php_version}/php-fpm.d/*"
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -210,7 +218,7 @@ php8.1-fpm_package() {
 
 php8.1-embed_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Embed SAPI'
 	pkg_install() {
 		cd ${wrksrc}/build
@@ -221,8 +229,8 @@ php8.1-embed_package() {
 
 php8.1-pear_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}
-	 php${_php_version}-devel-${version}_${revision} autoconf"
+	depends="php${_php_version}>=${version}_${revision}
+	 php${_php_version}>=devel-${version}_${revision} autoconf"
 	short_desc+=' - PHP Extension and Application Repository'
 	conf_files="/etc/php${_php_version}/pear.conf"
 	pkg_install() {
@@ -242,7 +250,7 @@ php8.1-pear_package() {
 
 php8.1-enchant_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - enchant module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/enchant.so"
@@ -251,7 +259,7 @@ php8.1-enchant_package() {
 
 php8.1-gd_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - gd module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/gd.so"
@@ -260,7 +268,7 @@ php8.1-gd_package() {
 
 php8.1-intl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - Internationalization module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/intl.so"
@@ -269,7 +277,7 @@ php8.1-intl_package() {
 
 php8.1-ldap_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - LDAP module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ldap.so"
@@ -278,7 +286,7 @@ php8.1-ldap_package() {
 
 php8.1-mysql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - MySQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
@@ -287,7 +295,7 @@ php8.1-mysql_package() {
 
 php8.1-odbc_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - ODBC modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
@@ -296,7 +304,7 @@ php8.1-odbc_package() {
 
 php8.1-pgsql_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - PostgreSQL modules'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
@@ -305,7 +313,7 @@ php8.1-pgsql_package() {
 
 php8.1-snmp_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - snmp module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/snmp.so"
@@ -314,7 +322,7 @@ php8.1-snmp_package() {
 
 php8.1-sqlite_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sqlite module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
@@ -323,7 +331,7 @@ php8.1-sqlite_package() {
 
 php8.1-tidy_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - tidy HTML module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
@@ -332,7 +340,7 @@ php8.1-tidy_package() {
 
 php8.1-xsl_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - XSL module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/xsl.so"
@@ -341,7 +349,7 @@ php8.1-xsl_package() {
 
 php8.1-sodium_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - sodium module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/sodium.so"
@@ -350,7 +358,7 @@ php8.1-sodium_package() {
 
 php8.1-ffi_package() {
 	lib32disabled=yes
-	depends="php${_php_version}-${version}_${revision}"
+	depends="php${_php_version}>=${version}_${revision}"
 	short_desc+=' - FFI module'
 	pkg_install() {
 		vmove "usr/lib/php${_php_version}/modules/ffi.so"

From e20d64db6880828a77cb171a52f2dba4117c758f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 12:00:05 -0400
Subject: [PATCH 4/7] composer8.0: add `composer` alternatives group.

---
 srcpkgs/composer8.0/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
index afdcb1e535a6..a578fdb8dd9e 100644
--- a/srcpkgs/composer8.0/template
+++ b/srcpkgs/composer8.0/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.0'
 pkgname=composer8.0
 version=2.5.3
-revision=1
+revision=2
 build_style=fetch
 depends="php8.0"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.0"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.0

From 6c666d7aa6616a0675641a6174823b27534ccde6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 8 Aug 2022 11:58:52 -0400
Subject: [PATCH 5/7] composer8.1: add `composer` alternatives group.

---
 srcpkgs/composer8.1/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
index c790e032ddbe..6d0c504c570a 100644
--- a/srcpkgs/composer8.1/template
+++ b/srcpkgs/composer8.1/template
@@ -1,7 +1,7 @@
 # Template file for 'composer8.1'
 pkgname=composer8.1
 version=2.5.3
-revision=1
+revision=2
 build_style=fetch
 depends="php8.1"
 short_desc="Dependency manager for PHP"
@@ -13,6 +13,7 @@ distfiles="https://github.com/composer/composer/releases/download/${version}/com
  https://raw.githubusercontent.com/composer/composer/main/LICENSE"
 checksum="2e1061821951c6a5ece033a025d06296d4a1d056fee2f4bebd35815cf4b1b0f9
  7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+alternatives="composer:composer:/usr/bin/composer8.1"
 
 do_install() {
 	vbin ${FILESDIR}/composer8.1

From e2b84c70880a29bc4010acb6acce643614f28946 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:32 -0500
Subject: [PATCH 6/7] phoronix-test-suite: depend on php8.1.

---
 srcpkgs/phoronix-test-suite/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phoronix-test-suite/template b/srcpkgs/phoronix-test-suite/template
index 4824b65dd40d..16b4034bec27 100644
--- a/srcpkgs/phoronix-test-suite/template
+++ b/srcpkgs/phoronix-test-suite/template
@@ -1,8 +1,8 @@
 # Template file for 'phoronix-test-suite'
 pkgname=phoronix-test-suite
 version=10.8.4
-revision=1
-depends="php"
+revision=2
+depends="php8.1"
 short_desc="Comprehensive testing and benchmarking platform for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="GPL-3.0-or-later"

From 515ba17d21353445223308068327329933e1a317 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 28 Nov 2022 14:49:58 -0500
Subject: [PATCH 7/7] phpMyAdmin: depend on php8.1.

---
 srcpkgs/phpMyAdmin/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/phpMyAdmin/template b/srcpkgs/phpMyAdmin/template
index c4ee6fa3a0a0..7f0b5f024df5 100644
--- a/srcpkgs/phpMyAdmin/template
+++ b/srcpkgs/phpMyAdmin/template
@@ -1,9 +1,9 @@
 # Template file for 'phpMyAdmin'
 pkgname=phpMyAdmin
 version=5.2.0
-revision=1
+revision=2
 conf_files="/etc/webapps/phpMyAdmin/config.inc.php"
-depends="php mariadb"
+depends="php8.1 mariadb"
 short_desc="Web interface for MySQL and MariaDB"
 maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
 license="GPL-2.0-only"

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR REVIEW] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (45 preceding siblings ...)
  2023-03-02 21:58 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2023-03-02 21:59 ` TinfoilSubmarine
  2023-03-04 22:05 ` [PR PATCH] [Merged]: " paper42
  2023-04-08  3:34 ` jchook
  48 siblings, 0 replies; 50+ messages in thread
From: TinfoilSubmarine @ 2023-03-02 21:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#discussion_r1123768765

Comment:
Oops, must have accidentally dropped them when I was rebasing, fixed

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PR PATCH] [Merged]: php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (46 preceding siblings ...)
  2023-03-02 21:59 ` [PR REVIEW] " TinfoilSubmarine
@ 2023-03-04 22:05 ` paper42
  2023-04-08  3:34 ` jchook
  48 siblings, 0 replies; 50+ messages in thread
From: paper42 @ 2023-03-04 22:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

There's a merged pull request on the void-packages repository

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
https://github.com/void-linux/void-packages/pull/38536

Description:
### Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

Packages depending on `php`:
- [x] ampache https://github.com/void-linux/void-packages/pull/38973
- [x] composer (need to decide how to handle running with multiple PHP versions)
- [x] phoronix-test-suite (verified to work with the `php8.1` interpreter after symlinking `/usr/bin/php8.1` to `/usr/bin/php`. Since it works with both, I don't think there is any change needed to the `phoronix-test-suite` package.)
- [x] phpMyAdmin https://github.com/void-linux/void-packages/pull/38984

Packages depending on `php-gd`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages depending on `php-mysql`:
- [x] zabbix-frontend-php https://github.com/void-linux/void-packages/pull/38982

Packages with `php-devel` in *makedepends:
- [x] libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:
- [x] php-pear

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups.
  2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
                   ` (47 preceding siblings ...)
  2023-03-04 22:05 ` [PR PATCH] [Merged]: " paper42
@ 2023-04-08  3:34 ` jchook
  48 siblings, 0 replies; 50+ messages in thread
From: jchook @ 2023-04-08  3:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

New comment by jchook on void-packages repository

https://github.com/void-linux/void-packages/pull/38536#issuecomment-1500777964

Comment:
@TinfoilSubmarine thank you very much my man. Very appreciative of this much-needed change! Also very educational to read the PR as well.

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-04-08  3:34 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 16:45 [PR PATCH] php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups TinfoilSubmarine
2022-08-08 23:37 ` paper42
2022-08-09 18:08 ` Chocimier
2022-08-09 18:43 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-08-09 18:45 ` TinfoilSubmarine
2022-08-29 12:37 ` [PR PATCH] [Updated] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: " TinfoilSubmarine
2022-08-29 12:49 ` TinfoilSubmarine
2022-08-29 12:58 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
2022-08-29 13:10 ` TinfoilSubmarine
2022-08-29 13:18 ` TinfoilSubmarine
2022-08-29 13:47 ` TinfoilSubmarine
2022-08-29 14:57 ` TinfoilSubmarine
2022-08-30 18:42 ` TinfoilSubmarine
2022-08-30 21:19 ` [PR REVIEW] " paper42
2022-08-31 12:41 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-08-31 12:44 ` [PR REVIEW] " TinfoilSubmarine
2022-11-17 14:33 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-11-27 10:33 ` paper42
2022-11-28 20:01 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-12-01 13:15 ` TinfoilSubmarine
2022-12-04 13:52 ` [PR REVIEW] " paper42
2022-12-04 13:52 ` paper42
2022-12-04 13:52 ` paper42
2022-12-04 13:52 ` paper42
2022-12-04 13:52 ` paper42
2022-12-06 15:45 ` TinfoilSubmarine
2022-12-06 17:34 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-12-06 17:35 ` [PR REVIEW] " TinfoilSubmarine
2022-12-06 19:14 ` paper42
2022-12-06 19:14 ` paper42
2022-12-07 14:25 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-12-08 18:42 ` [PR REVIEW] " TinfoilSubmarine
2022-12-15 17:10 ` paper42
2022-12-15 17:47 ` TinfoilSubmarine
2022-12-25  0:00 ` paper42
2022-12-25  0:03 ` paper42
2023-01-04 20:41 ` TinfoilSubmarine
2023-01-20 15:38 ` [PR PATCH] [Updated] " TinfoilSubmarine
2023-01-20 15:43 ` [PR REVIEW] " TinfoilSubmarine
2023-02-15 19:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
2023-02-21 18:34 ` [PR REVIEW] " TinfoilSubmarine
2023-02-21 23:50 ` paper42
2023-02-28 22:36 ` paper42
2023-03-01 13:23 ` [PR PATCH] [Updated] " TinfoilSubmarine
2023-03-01 13:26 ` [PR REVIEW] " TinfoilSubmarine
2023-03-02 21:25 ` paper42
2023-03-02 21:58 ` [PR PATCH] [Updated] " TinfoilSubmarine
2023-03-02 21:59 ` [PR REVIEW] " TinfoilSubmarine
2023-03-04 22:05 ` [PR PATCH] [Merged]: " paper42
2023-04-08  3:34 ` jchook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).