Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: php8-8.0.16
@ 2022-03-08  2:11 TinfoilSubmarine
  2022-03-08  2:43 ` TinfoilSubmarine
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08  2:11 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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
-->
Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

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

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

From 434129ce2699c2fc1a5a27d48351e0ed03bbcdc3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 1/3] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From b6de7a4675fcc4415cd2b6a449f63a4273282cb4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 2/3] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 9720b19b63f84511575e793b16423ab055b61b1a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 3/3] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 333 ++++++++++++++++++
 31 files changed, 594 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..47197c778d34
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..b2b9412de2f0
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,333 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.xz"
+checksum=f27a2f25259e8c51e42dfd74e24a546ee521438ad7d9f6c6e794aa91f38bab0a
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

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

* Re: New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
@ 2022-03-08  2:43 ` TinfoilSubmarine
  2022-03-08  2:50 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08  2:43 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1061348932

Comment:
Ah, forgot to look into that, I manually downloaded the distfiles on my machine.

This is some sort of issue with `xbps-fetch`...

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
  2022-03-08  2:43 ` TinfoilSubmarine
@ 2022-03-08  2:50 ` TinfoilSubmarine
  2022-03-08  2:55 ` TinfoilSubmarine
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08  2:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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
-->
Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

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

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

From 434129ce2699c2fc1a5a27d48351e0ed03bbcdc3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 1/3] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From b6de7a4675fcc4415cd2b6a449f63a4273282cb4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 2/3] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From d80df8c5031efb5cc7f8184d5204a0ab80beb337 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 3/3] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..47197c778d34
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
  2022-03-08  2:43 ` TinfoilSubmarine
  2022-03-08  2:50 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-03-08  2:55 ` TinfoilSubmarine
  2022-03-08 14:28 ` TinfoilSubmarine
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08  2:55 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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
-->
Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

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

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

From 434129ce2699c2fc1a5a27d48351e0ed03bbcdc3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 1/3] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From b6de7a4675fcc4415cd2b6a449f63a4273282cb4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 2/3] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 8b5fe7eec4af66f6758faa1f2d728990cb77148e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 3/3] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (2 preceding siblings ...)
  2022-03-08  2:55 ` TinfoilSubmarine
@ 2022-03-08 14:28 ` TinfoilSubmarine
  2022-03-08 14:31 ` TinfoilSubmarine
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 14:28 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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
-->
Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

[ci skip]

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

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

From e207fd7b6f9ba6d2be3f4a22ab0dcd8f022d3362 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 1/5] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

From 3fafa5a46de1fb55fa315113d2ff08944be91058 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 2/5] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 44567755b93e8c9283e99a9c1934bc8ea670964a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 3/5] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From fa363720c29f072705149c4e8c26d79244dc3a12 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:27:29 -0500
Subject: [PATCH 4/5] New package: php8-ast-1.0.16

---
 srcpkgs/php8-ast/INSTALL.msg |  2 ++
 srcpkgs/php8-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8-ast/template

diff --git a/srcpkgs/php8-ast/INSTALL.msg b/srcpkgs/php8-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8-ast/template b/srcpkgs/php8-ast/template
new file mode 100644
index 000000000000..71737dbe0cd4
--- /dev/null
+++ b/srcpkgs/php8-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-ast'
+pkgname=php8-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 69f4e230b2698d6b196049e50fe2172317b04b1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:31:05 -0500
Subject: [PATCH 5/5] New package: php8-igbinary-3.2.7

---
 srcpkgs/php8-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8-igbinary/template

diff --git a/srcpkgs/php8-igbinary/template b/srcpkgs/php8-igbinary/template
new file mode 100644
index 000000000000..7eaf19056db6
--- /dev/null
+++ b/srcpkgs/php8-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-igbinary'
+pkgname=php8-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel"
+depends="php8>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

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

* Re: New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (3 preceding siblings ...)
  2022-03-08 14:28 ` TinfoilSubmarine
@ 2022-03-08 14:31 ` TinfoilSubmarine
  2022-03-08 16:54 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 14:31 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1061839372

Comment:
I added the 2 php-* packages left (ast and igbinary). 

The only other thing I use is composer, which I'm having a hard time making it play nice with the php binary being named something other than `php` in path.

I know that the [previous attempt](https://github.com/void-linux/void-packages/pull/31668) to get PHP 8 into repo had xdebug as well, so I'll look into that.

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (4 preceding siblings ...)
  2022-03-08 14:31 ` TinfoilSubmarine
@ 2022-03-08 16:54 ` TinfoilSubmarine
  2022-03-08 17:51 ` TinfoilSubmarine
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 16:54 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

[ci skip]

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

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

From e207fd7b6f9ba6d2be3f4a22ab0dcd8f022d3362 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 1/6] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

From 3fafa5a46de1fb55fa315113d2ff08944be91058 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 2/6] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 44567755b93e8c9283e99a9c1934bc8ea670964a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 3/6] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From fa363720c29f072705149c4e8c26d79244dc3a12 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:27:29 -0500
Subject: [PATCH 4/6] New package: php8-ast-1.0.16

---
 srcpkgs/php8-ast/INSTALL.msg |  2 ++
 srcpkgs/php8-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8-ast/template

diff --git a/srcpkgs/php8-ast/INSTALL.msg b/srcpkgs/php8-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8-ast/template b/srcpkgs/php8-ast/template
new file mode 100644
index 000000000000..71737dbe0cd4
--- /dev/null
+++ b/srcpkgs/php8-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-ast'
+pkgname=php8-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 69f4e230b2698d6b196049e50fe2172317b04b1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:31:05 -0500
Subject: [PATCH 5/6] New package: php8-igbinary-3.2.7

---
 srcpkgs/php8-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8-igbinary/template

diff --git a/srcpkgs/php8-igbinary/template b/srcpkgs/php8-igbinary/template
new file mode 100644
index 000000000000..7eaf19056db6
--- /dev/null
+++ b/srcpkgs/php8-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-igbinary'
+pkgname=php8-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel"
+depends="php8>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From fae3ae8e2d2eee24036d4a58cad354b0cad4640e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 11:54:40 -0500
Subject: [PATCH 6/6] New package: composer8-2.2.7

---
 srcpkgs/composer8/files/composer8 |  2 ++
 srcpkgs/composer8/template        | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100755 srcpkgs/composer8/files/composer8
 create mode 100644 srcpkgs/composer8/template

diff --git a/srcpkgs/composer8/files/composer8 b/srcpkgs/composer8/files/composer8
new file mode 100755
index 000000000000..f75085dbfb6f
--- /dev/null
+++ b/srcpkgs/composer8/files/composer8
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8 -f /usr/libexec/composer.phar8
diff --git a/srcpkgs/composer8/template b/srcpkgs/composer8/template
new file mode 100644
index 000000000000..320c8e116df1
--- /dev/null
+++ b/srcpkgs/composer8/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8'
+pkgname=composer8
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8
+
+	vinstall composer.phar 755 usr/libexec composer.phar8
+	vlicense LICENSE
+
+	vmkdir /etc/php8/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8/conf.d/composer.ini
+}

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (5 preceding siblings ...)
  2022-03-08 16:54 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-03-08 17:51 ` TinfoilSubmarine
  2022-03-08 18:30 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 17:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

[ci skip]

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

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

From e207fd7b6f9ba6d2be3f4a22ab0dcd8f022d3362 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 1/6] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

From 3fafa5a46de1fb55fa315113d2ff08944be91058 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 2/6] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 44567755b93e8c9283e99a9c1934bc8ea670964a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 3/6] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From fa363720c29f072705149c4e8c26d79244dc3a12 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:27:29 -0500
Subject: [PATCH 4/6] New package: php8-ast-1.0.16

---
 srcpkgs/php8-ast/INSTALL.msg |  2 ++
 srcpkgs/php8-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8-ast/template

diff --git a/srcpkgs/php8-ast/INSTALL.msg b/srcpkgs/php8-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8-ast/template b/srcpkgs/php8-ast/template
new file mode 100644
index 000000000000..71737dbe0cd4
--- /dev/null
+++ b/srcpkgs/php8-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-ast'
+pkgname=php8-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 69f4e230b2698d6b196049e50fe2172317b04b1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:31:05 -0500
Subject: [PATCH 5/6] New package: php8-igbinary-3.2.7

---
 srcpkgs/php8-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8-igbinary/template

diff --git a/srcpkgs/php8-igbinary/template b/srcpkgs/php8-igbinary/template
new file mode 100644
index 000000000000..7eaf19056db6
--- /dev/null
+++ b/srcpkgs/php8-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-igbinary'
+pkgname=php8-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel"
+depends="php8>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 1d79f3d6d860a3dd813f9d372d5ea5e0e65475fd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 11:54:40 -0500
Subject: [PATCH 6/6] New package: composer8-2.2.7

---
 srcpkgs/composer8/files/composer8 |  2 ++
 srcpkgs/composer8/template        | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8/files/composer8
 create mode 100644 srcpkgs/composer8/template

diff --git a/srcpkgs/composer8/files/composer8 b/srcpkgs/composer8/files/composer8
new file mode 100644
index 000000000000..f75085dbfb6f
--- /dev/null
+++ b/srcpkgs/composer8/files/composer8
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8 -f /usr/libexec/composer.phar8
diff --git a/srcpkgs/composer8/template b/srcpkgs/composer8/template
new file mode 100644
index 000000000000..c1311bcbf455
--- /dev/null
+++ b/srcpkgs/composer8/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8'
+pkgname=composer8
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8
+
+	vinstall composer.phar 644 usr/libexec composer.phar8
+	vlicense LICENSE
+
+	vmkdir /etc/php8/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8/conf.d/composer.ini
+}

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

* Re: [PR PATCH] [Updated] [WIP] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (6 preceding siblings ...)
  2022-03-08 17:51 ` TinfoilSubmarine
@ 2022-03-08 18:30 ` TinfoilSubmarine
  2022-03-08 19:10 ` TinfoilSubmarine
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 18:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

[WIP] New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

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

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

From e207fd7b6f9ba6d2be3f4a22ab0dcd8f022d3362 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 1/7] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

From 3fafa5a46de1fb55fa315113d2ff08944be91058 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 2/7] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..9dc9e5da4413
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf pcre2-devel php8-devel"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 44567755b93e8c9283e99a9c1934bc8ea670964a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 3/7] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From fa363720c29f072705149c4e8c26d79244dc3a12 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:27:29 -0500
Subject: [PATCH 4/7] New package: php8-ast-1.0.16

---
 srcpkgs/php8-ast/INSTALL.msg |  2 ++
 srcpkgs/php8-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8-ast/template

diff --git a/srcpkgs/php8-ast/INSTALL.msg b/srcpkgs/php8-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8-ast/template b/srcpkgs/php8-ast/template
new file mode 100644
index 000000000000..71737dbe0cd4
--- /dev/null
+++ b/srcpkgs/php8-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-ast'
+pkgname=php8-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 69f4e230b2698d6b196049e50fe2172317b04b1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:31:05 -0500
Subject: [PATCH 5/7] New package: php8-igbinary-3.2.7

---
 srcpkgs/php8-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8-igbinary/template

diff --git a/srcpkgs/php8-igbinary/template b/srcpkgs/php8-igbinary/template
new file mode 100644
index 000000000000..7eaf19056db6
--- /dev/null
+++ b/srcpkgs/php8-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-igbinary'
+pkgname=php8-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel"
+depends="php8>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 1d79f3d6d860a3dd813f9d372d5ea5e0e65475fd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 11:54:40 -0500
Subject: [PATCH 6/7] New package: composer8-2.2.7

---
 srcpkgs/composer8/files/composer8 |  2 ++
 srcpkgs/composer8/template        | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8/files/composer8
 create mode 100644 srcpkgs/composer8/template

diff --git a/srcpkgs/composer8/files/composer8 b/srcpkgs/composer8/files/composer8
new file mode 100644
index 000000000000..f75085dbfb6f
--- /dev/null
+++ b/srcpkgs/composer8/files/composer8
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8 -f /usr/libexec/composer.phar8
diff --git a/srcpkgs/composer8/template b/srcpkgs/composer8/template
new file mode 100644
index 000000000000..c1311bcbf455
--- /dev/null
+++ b/srcpkgs/composer8/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8'
+pkgname=composer8
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8
+
+	vinstall composer.phar 644 usr/libexec composer.phar8
+	vlicense LICENSE
+
+	vmkdir /etc/php8/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8/conf.d/composer.ini
+}

From beeed35eb120d7ca918a95b2baa5a060223b4f14 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 13:30:07 -0500
Subject: [PATCH 7/7] New package: xdebug8-3.1.3

---
 srcpkgs/xdebug8/INSTALL.msg |  1 +
 srcpkgs/xdebug8/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8/template
 create mode 100644 srcpkgs/xdebug8/update

diff --git a/srcpkgs/xdebug8/INSTALL.msg b/srcpkgs/xdebug8/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8/template b/srcpkgs/xdebug8/template
new file mode 100644
index 000000000000..0422b366cf88
--- /dev/null
+++ b/srcpkgs/xdebug8/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8'
+pkgname=xdebug8
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf"
+makedepends="php8-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8-devel"
+fi
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8/update b/srcpkgs/xdebug8/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

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

* Re: [PR PATCH] [Updated] [WIP] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (7 preceding siblings ...)
  2022-03-08 18:30 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
@ 2022-03-08 19:10 ` TinfoilSubmarine
  2022-03-08 19:49 ` TinfoilSubmarine
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 19:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

[WIP] New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

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

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

From 548722f67c3d0bd7bb14fc4c8cb7faa3503b978b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:29:56 -0500
Subject: [PATCH 1/7] New package: php8-8.0.16

---
 srcpkgs/php8-apache                           |   1 +
 srcpkgs/php8-cgi                              |   1 +
 srcpkgs/php8-devel                            |   1 +
 srcpkgs/php8-embed                            |   1 +
 srcpkgs/php8-enchant                          |   1 +
 srcpkgs/php8-ffi                              |   1 +
 srcpkgs/php8-fpm                              |   1 +
 srcpkgs/php8-gd                               |   1 +
 srcpkgs/php8-intl                             |   1 +
 srcpkgs/php8-ldap                             |   1 +
 srcpkgs/php8-mysql                            |   1 +
 srcpkgs/php8-odbc                             |   1 +
 srcpkgs/php8-pgsql                            |   1 +
 srcpkgs/php8-phpdbg                           |   1 +
 srcpkgs/php8-snmp                             |   1 +
 srcpkgs/php8-sodium                           |   1 +
 srcpkgs/php8-sqlite                           |   1 +
 srcpkgs/php8-tidy                             |   1 +
 srcpkgs/php8-xsl                              |   1 +
 srcpkgs/php8/files/apache.conf                |  13 +
 srcpkgs/php8/files/php-fpm8/run               |   3 +
 srcpkgs/php8/patches/php-706-crypt.patch      |  15 +
 srcpkgs/php8/patches/php-cross-config.patch   |  41 +++
 srcpkgs/php8/patches/php-fpm.patch            |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8/patches/php-opcache-cross.patch  |  14 +
 srcpkgs/php8/patches/php-pear-cross.patch     |  23 ++
 srcpkgs/php8/patches/php-phar-cross.patch     |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8/patches/php.ini.patch            |  24 ++
 srcpkgs/php8/template                         | 335 ++++++++++++++++++
 31 files changed, 596 insertions(+)
 create mode 120000 srcpkgs/php8-apache
 create mode 120000 srcpkgs/php8-cgi
 create mode 120000 srcpkgs/php8-devel
 create mode 120000 srcpkgs/php8-embed
 create mode 120000 srcpkgs/php8-enchant
 create mode 120000 srcpkgs/php8-ffi
 create mode 120000 srcpkgs/php8-fpm
 create mode 120000 srcpkgs/php8-gd
 create mode 120000 srcpkgs/php8-intl
 create mode 120000 srcpkgs/php8-ldap
 create mode 120000 srcpkgs/php8-mysql
 create mode 120000 srcpkgs/php8-odbc
 create mode 120000 srcpkgs/php8-pgsql
 create mode 120000 srcpkgs/php8-phpdbg
 create mode 120000 srcpkgs/php8-snmp
 create mode 120000 srcpkgs/php8-sodium
 create mode 120000 srcpkgs/php8-sqlite
 create mode 120000 srcpkgs/php8-tidy
 create mode 120000 srcpkgs/php8-xsl
 create mode 100644 srcpkgs/php8/files/apache.conf
 create mode 100755 srcpkgs/php8/files/php-fpm8/run
 create mode 100644 srcpkgs/php8/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8/patches/php.ini.patch
 create mode 100644 srcpkgs/php8/template

diff --git a/srcpkgs/php8-apache b/srcpkgs/php8-apache
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-apache
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-cgi b/srcpkgs/php8-cgi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-cgi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-devel b/srcpkgs/php8-devel
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-devel
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-embed b/srcpkgs/php8-embed
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-embed
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-enchant b/srcpkgs/php8-enchant
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-enchant
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ffi b/srcpkgs/php8-ffi
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ffi
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-fpm b/srcpkgs/php8-fpm
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-fpm
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-gd b/srcpkgs/php8-gd
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-gd
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-intl b/srcpkgs/php8-intl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-intl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-ldap b/srcpkgs/php8-ldap
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-ldap
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-mysql b/srcpkgs/php8-mysql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-mysql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-odbc b/srcpkgs/php8-odbc
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-odbc
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-pgsql b/srcpkgs/php8-pgsql
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-pgsql
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-phpdbg b/srcpkgs/php8-phpdbg
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-phpdbg
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-snmp b/srcpkgs/php8-snmp
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-snmp
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sodium b/srcpkgs/php8-sodium
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sodium
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-sqlite b/srcpkgs/php8-sqlite
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-sqlite
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-tidy b/srcpkgs/php8-tidy
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-tidy
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8-xsl b/srcpkgs/php8-xsl
new file mode 120000
index 000000000000..015de7408c42
--- /dev/null
+++ b/srcpkgs/php8-xsl
@@ -0,0 +1 @@
+php8
\ No newline at end of file
diff --git a/srcpkgs/php8/files/apache.conf b/srcpkgs/php8/files/apache.conf
new file mode 100644
index 000000000000..1ff98e95061e
--- /dev/null
+++ b/srcpkgs/php8/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8_module
+
+<IfModule dir_module>
+	<IfModule php8_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/php8/files/php-fpm8/run b/srcpkgs/php8/files/php-fpm8/run
new file mode 100755
index 000000000000..745416a459d7
--- /dev/null
+++ b/srcpkgs/php8/files/php-fpm8/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8 --nodaemonize
diff --git a/srcpkgs/php8/patches/php-706-crypt.patch b/srcpkgs/php8/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8/patches/php-cross-config.patch b/srcpkgs/php8/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8/patches/php-fpm.patch b/srcpkgs/php8/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8/patches/php-opcache-cross.patch b/srcpkgs/php8/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8/patches/php-pear-cross.patch b/srcpkgs/php8/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8/patches/php-phar-cross.patch b/srcpkgs/php8/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8/patches/php.ini.patch b/srcpkgs/php8/patches/php.ini.patch
new file mode 100644
index 000000000000..14efedc578e8
--- /dev/null
+++ b/srcpkgs/php8/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8/template b/srcpkgs/php8/template
new file mode 100644
index 000000000000..0b9c0a0fedf9
--- /dev/null
+++ b/srcpkgs/php8/template
@@ -0,0 +1,335 @@
+# Template file for 'php8'
+pkgname=php8
+version=8.0.16
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php8/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php8"
+	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/php8 \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php8 \
+		--with-config-file-scan-dir=/etc/php8/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php8 \
+		--datarootdir=/usr/share/php8 \
+		--datadir=/usr/share/php8 \
+		--program-suffix=8 \
+		--includedir=/usr/include/php8 \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php8 PHAR_PHP_MODULES=/usr/lib/php8/modules"
+	fi
+
+	EXTENSION_DIR=/usr/lib/php8/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/php8"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 etc/php8 php.ini
+	# remove static modules
+	rm -f ${DESTDIR}/usr/lib/php8/modules/*.a
+}
+
+php8-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/php8/build
+		vmove usr/bin/php-config8
+		vmove usr/bin/phpize8
+		vmove usr/share/man/man1/phpize8.1
+		vmove usr/share/man/man1/php-config8.1
+	}
+}
+
+php8-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php8-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8-apache_package() {
+	short_desc+=' - Apache SAPI'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/apache/extra/php8_module.conf"
+	pkg_install() {
+		vinstall ${wrksrc}/build-apache/libs/libphp.so 755 usr/libexec/httpd/modules libphp.so
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php8_module.conf
+	}
+}
+
+php8-fpm_package() {
+	short_desc+=' - FastCGI Process Manager'
+	depends="php8-${version}_${revision}"
+	conf_files="/etc/php8/php-fpm.conf /etc/php8/php-fpm.d/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv php-fpm8
+	}
+}
+
+php8-embed_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+	}
+}
+
+php8-enchant_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/enchant.so
+	}
+}
+
+php8-gd_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/gd.so
+	}
+}
+
+php8-intl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/intl.so
+	}
+}
+
+php8-ldap_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ldap.so
+	}
+}
+
+php8-mysql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*mysql*.so"
+	}
+}
+
+php8-odbc_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*odbc.so"
+	}
+}
+
+php8-pgsql_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*pgsql.so"
+	}
+}
+
+php8-snmp_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/snmp.so
+	}
+}
+
+php8-sqlite_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*sqlite*.so"
+	}
+}
+
+php8-tidy_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php8/modules/*tidy*.so"
+	}
+}
+
+php8-xsl_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/xsl.so
+	}
+}
+
+php8-sodium_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/sodium.so
+	}
+}
+
+php8-ffi_package() {
+	lib32disabled=yes
+	depends="php8-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove usr/lib/php8/modules/ffi.so
+	}
+}

From 26c6a558bebaa28d783f2668aacdd5edd24a453f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:33:01 -0500
Subject: [PATCH 2/7] New package: php8-apcu-5.1.21

---
 srcpkgs/php8-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8-apcu/template
 create mode 100644 srcpkgs/php8-apcu/update

diff --git a/srcpkgs/php8-apcu/INSTALL.msg b/srcpkgs/php8-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8-apcu/template b/srcpkgs/php8-apcu/template
new file mode 100644
index 000000000000..daa464718437
--- /dev/null
+++ b/srcpkgs/php8-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-apcu'
+pkgname=php8-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+make_check_target=test
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel pcre2-devel"
+depends="php8>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8-apcu/update b/srcpkgs/php8-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 004826231232f1efa58b6ea935cfbf77597a86a3 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 7 Mar 2022 20:37:16 -0500
Subject: [PATCH 3/7] New package: php8-imagick-3.7.0

---
 srcpkgs/php8-imagick/INSTALL.msg              |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8-imagick/template                 | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8-imagick/template

diff --git a/srcpkgs/php8-imagick/INSTALL.msg b/srcpkgs/php8-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8-imagick/template b/srcpkgs/php8-imagick/template
new file mode 100644
index 000000000000..3de4da2c86b0
--- /dev/null
+++ b/srcpkgs/php8-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8-imagick'
+pkgname=php8-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf pkg-config"
+makedepends="php8-devel pcre2-devel libmagick-devel"
+depends="php8>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 821626dfde5b086a7dcce78a04087ffbe8162f49 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:27:29 -0500
Subject: [PATCH 4/7] New package: php8-ast-1.0.16

---
 srcpkgs/php8-ast/INSTALL.msg |  2 ++
 srcpkgs/php8-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8-ast/template

diff --git a/srcpkgs/php8-ast/INSTALL.msg b/srcpkgs/php8-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8-ast/template b/srcpkgs/php8-ast/template
new file mode 100644
index 000000000000..71737dbe0cd4
--- /dev/null
+++ b/srcpkgs/php8-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-ast'
+pkgname=php8-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="php8-devel autoconf"
+makedepends="php8-devel"
+depends="php8>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From d53df6e69427c6555bd5e29ba4db4be33d8be6da Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 08:31:05 -0500
Subject: [PATCH 5/7] New package: php8-igbinary-3.2.7

---
 srcpkgs/php8-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8-igbinary/template

diff --git a/srcpkgs/php8-igbinary/template b/srcpkgs/php8-igbinary/template
new file mode 100644
index 000000000000..7eaf19056db6
--- /dev/null
+++ b/srcpkgs/php8-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8-igbinary'
+pkgname=php8-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf php8-devel"
+makedepends="php8-devel"
+depends="php8>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 26d4d619c660070600c4fc157df495cef9761265 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 11:54:40 -0500
Subject: [PATCH 6/7] New package: composer8-2.2.7

---
 srcpkgs/composer8/files/composer8 |  2 ++
 srcpkgs/composer8/template        | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8/files/composer8
 create mode 100644 srcpkgs/composer8/template

diff --git a/srcpkgs/composer8/files/composer8 b/srcpkgs/composer8/files/composer8
new file mode 100644
index 000000000000..f75085dbfb6f
--- /dev/null
+++ b/srcpkgs/composer8/files/composer8
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8 -f /usr/libexec/composer.phar8
diff --git a/srcpkgs/composer8/template b/srcpkgs/composer8/template
new file mode 100644
index 000000000000..c1311bcbf455
--- /dev/null
+++ b/srcpkgs/composer8/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8'
+pkgname=composer8
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8
+
+	vinstall composer.phar 644 usr/libexec composer.phar8
+	vlicense LICENSE
+
+	vmkdir /etc/php8/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8/conf.d/composer.ini
+}

From 2b3812ab38fbf90652ea69bd73ebb8daf3924b00 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 8 Mar 2022 13:30:07 -0500
Subject: [PATCH 7/7] New package: xdebug8-3.1.3

---
 srcpkgs/xdebug8/INSTALL.msg |  1 +
 srcpkgs/xdebug8/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8/template
 create mode 100644 srcpkgs/xdebug8/update

diff --git a/srcpkgs/xdebug8/INSTALL.msg b/srcpkgs/xdebug8/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8/template b/srcpkgs/xdebug8/template
new file mode 100644
index 000000000000..0422b366cf88
--- /dev/null
+++ b/srcpkgs/xdebug8/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8'
+pkgname=xdebug8
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8"
+hostmakedepends="autoconf"
+makedepends="php8-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8-devel"
+fi
+
+pre_configure() {
+	phpize8
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8/update b/srcpkgs/xdebug8/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

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

* Re: New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (8 preceding siblings ...)
  2022-03-08 19:10 ` TinfoilSubmarine
@ 2022-03-08 19:49 ` TinfoilSubmarine
  2022-03-15 19:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-08 19:49 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1062142695

Comment:
I think everything is here from the list in https://github.com/void-linux/void-packages/issues/31678 in other than `pear`.

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

* Re: [PR PATCH] [Updated] New package: php8-8.0.16
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (9 preceding siblings ...)
  2022-03-08 19:49 ` TinfoilSubmarine
@ 2022-03-15 19:47 ` TinfoilSubmarine
  2022-03-15 19:49 ` [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1 TinfoilSubmarine
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-15 19:47 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New package: php8-8.0.16
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From f32f0e0e6b586595c2398c7621b1a666dbd10272 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.16

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 31 files changed, 598 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..2167cac876ca
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.0 --nodaemonize
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..02844b619078
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.16
+_php_version=8.0
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From c7b5662b499d6eb0de387da4af2c45a231a5d1d0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..19fae2b2cfe9
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 8e8c38121f2c162c2712e1478cceebbfde0e34c9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..2b0396b901b1
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From c5b874aa5f69eb7e6cbd71063af14f6e96081c8e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..0baa430dfa22
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From b72daabcd9d69b8924395892be5e2a8809032587 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..7ef503dcb10b
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 7797257a91d15ec5631b60c3fc977b611a0c729c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.2.7

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..2fcafa85e9a3
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.0"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 248308b3fe154fb6ac1f6683572cc5f941af8743 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.3

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..4a2a21bf20a5
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

From 47aa148be3011c832ffb56bd0ddb919690683cca Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.3

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 30 files changed, 565 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..445b41d04c44
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.1 --nodaemonize
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..a592dfa7a8c1
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.3
+_php_version=8.1
+revision=1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=92d74f5a4af7de90cef6cda65bd0c341dc9a1027b32f70e7b8861f6f68a38bb2
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From a520f799ec6c8465374e58148c2638ed8120b36b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..e4f906e38fff
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1>=8.1.3"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 10d639cdc1c357459d3efad40e9ef117b1e0d24e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..4396d59b24a3
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1>=8.1.3"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 67464b1b6accc9901dedbc4f93c42991a8e33d84 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..c90b7bdf1a28
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1>8.1.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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 53a7222b3370760eb95bb2c3bf16e2e859ff4404 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..a4ecfe75aec4
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1>=8.1.3"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From c0aa7dafad3255b7a43bc0d34ff7e982f2829eb2 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.2.7

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..4ecf89d3f3b9
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.1"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From 054120ac2c4b8477f1977c0e9b29fb236bacbaf8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.3

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..1ca68b8abfc1
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (10 preceding siblings ...)
  2022-03-15 19:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-03-15 19:49 ` TinfoilSubmarine
  2022-03-16  3:47 ` TinfoilSubmarine
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-15 19:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 1550b01f0f1f0129a2d46bba64e6fc0eab0b1b32 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.16

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 31 files changed, 598 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..2167cac876ca
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.0 --nodaemonize
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..cbacd319b9f4
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.16
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From 66f9c80b597f1bd49fe8671d2c17e836ee732be1 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..19fae2b2cfe9
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 2560805e353019e7eb311e47063433c2ce998e7e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..2b0396b901b1
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 979e11743b3214b7b3b9161d7e07edeadbcb2468 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..0baa430dfa22
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 95af409121f23941cf99db887e7f5ba4bb66b2ec Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..7ef503dcb10b
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 890909ea0c9dcf93ecf62cd37b5c3b9a03ff132f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.2.7

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..2fcafa85e9a3
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.0"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 0353f322a664c99e8dafef4bfc9a40e4058fb5d8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.3

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..4a2a21bf20a5
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

From 27c39812feeff35a750ff5193f9ca3ecb861ac7c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.3

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 30 files changed, 565 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..445b41d04c44
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.1 --nodaemonize
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..c458820b3751
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.3
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=92d74f5a4af7de90cef6cda65bd0c341dc9a1027b32f70e7b8861f6f68a38bb2
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From 7df6815a654eeeba78ecaa03a920d15611b6601d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..e4f906e38fff
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1>=8.1.3"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 398b48429696ef8ed9751f51f028d4a4213967e0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..4396d59b24a3
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1>=8.1.3"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From fe21d12d0caa24e0c9cf237920a263cb8c6a78dd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..c90b7bdf1a28
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1>8.1.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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 3e50e4e35f6229cef01d108f1846b1709b69e17b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..a4ecfe75aec4
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1>=8.1.3"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 995d266c9071e1d31fb34639d9b5e9d18cf178d8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.2.7

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..4ecf89d3f3b9
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.1"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From db5761afceb8ebc0d19cd470e44bb6e8666572a9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.3

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..1ca68b8abfc1
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (11 preceding siblings ...)
  2022-03-15 19:49 ` [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1 TinfoilSubmarine
@ 2022-03-16  3:47 ` TinfoilSubmarine
  2022-03-27  8:31 ` [PR REVIEW] " paper42
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-16  3:47 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using this to self-host Nextcloud and Firefly III without any issues.

In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 594891c88e9f7fc47a973c1b6e1b52798127e1f0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.16

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 31 files changed, 598 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..2167cac876ca
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.0 --nodaemonize
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..cbacd319b9f4
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.16
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=ce0ea32ff9c5af18cfb70197b40caf55824400dc8d5b4258a783ec9168baa5b1
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From 9dbe53e97ce55781097fda1e679010af3cf65883 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..19fae2b2cfe9
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0>=8.0.16"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 577586317a2b40f0449c240d6be3a7de6907f6ed Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..2b0396b901b1
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0>=8.0.16"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 172713f2aa4db073d559fb3748cb3cc576fc3978 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..0baa430dfa22
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0>8.0.16"
+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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 57ca8c18c12b08bcd6e562168ab92d0ea48baf8d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..7ef503dcb10b
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0>=8.0.16"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 2f1abfd8c2edf875cee12a105662003ba5840ad0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.2.7

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..2fcafa85e9a3
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.0"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From d8783c71a8458ae7887f7b0a60ca0fa876c90c9c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.3

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..4a2a21bf20a5
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

From bca7d07ebfb65fece713eb0aa000d9460432f135 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.3

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 30 files changed, 565 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..445b41d04c44
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.1 --nodaemonize
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..c458820b3751
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.3
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=92d74f5a4af7de90cef6cda65bd0c341dc9a1027b32f70e7b8861f6f68a38bb2
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}

From 301357f254e05c36a52d686ea0b407624b8d2736 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..e4f906e38fff
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1>=8.1.3"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From b9c7dc1eecb5898542764b0da7b5fd55569e9aae Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..4396d59b24a3
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1>=8.1.3"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+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=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 8a08a698f6b07ab893d02bd268c6fe1777582d1e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..c90b7bdf1a28
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1>8.1.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=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 245eba8c482fe0f134c293c55178466547c1ba39 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..a4ecfe75aec4
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1>=8.1.3"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}

From 1d248f0c3e6d0507164871da36e5c6c02922fa2e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.2.7

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..4ecf89d3f3b9
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.2.7
+revision=1
+build_style=fetch
+depends="php8.1"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From 0f38764dd7277f92799e28afcd61bb1543222031 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.3

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  1 +
 3 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..1ca68b8abfc1
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Alexander Mamay <alexander@mamay.su>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version,,}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..ec68403a03ba
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1 @@
+ignore="*alpha* *beta*"

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

* Re: [PR REVIEW] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (12 preceding siblings ...)
  2022-03-16  3:47 ` TinfoilSubmarine
@ 2022-03-27  8:31 ` paper42
  2022-03-28 14:17 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: paper42 @ 2022-03-27  8:31 UTC (permalink / raw)
  To: ml

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

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#discussion_r835870963

Comment:
Why is this version restriction necessary?

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (13 preceding siblings ...)
  2022-03-27  8:31 ` [PR REVIEW] " paper42
@ 2022-03-28 14:17 ` TinfoilSubmarine
  2022-03-28 14:17 ` [PR REVIEW] " TinfoilSubmarine
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-28 14:17 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 05b248d4a026289c95a76886c294a04f693cb20b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.17

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..2167cac876ca
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.0 --nodaemonize
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..52c3e11c9c64
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.17
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=bdbd792901c156c4d1710c9d266732d3c17f6ff63850d6660b9d8d3411188424
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From 7aa82c4ae468a47e13ceb18ae5e6aefc57ecefab Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..e081806f4530
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From edd6a4cce98b534e3e8d20292c471503c12fe852 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..5f4dedd31d66
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From a047de77db83caf0457e73ba6afcff58b08ac1b8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..d6be450ab7cd
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 3aed6e1235d06d7ea4711bd8e9ba431b43610cb0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..c9f3797a61c7
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From 534a13756099a4f1ad6c82da3ef521e338258b08 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.2.9

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..c8d9a988aa40
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.2.9
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From f5663141514ffa532ea5dd38efca3e0cd8c54904 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.3

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..6328716760ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From 72635d83148d8a8a746e0962cee4d4214c2e9973 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.4

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..445b41d04c44
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.1 --nodaemonize
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..dc1aa8a5b321
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.4
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=a9951c1c8fd5d2eefde28de0f646c344eb61d751319d220713a6da26f986abde
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From bc167320b1bdb3813cb3de0c70275cbe6935e9dc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..d38a93896383
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From bf796f6580708dbc7686d536853007c556b9232a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..ef6471a5ee90
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 1fdc23e1f8bbe77e7a2d9fbd8f82956217d403d6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..cd1780b5fc1a
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 9b6577dc4e9fec0b237cbfab09c8b0572de1649c Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..5789fc36a5f0
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From ea6bd697747a10d40a223038a86892a488607508 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.2.9

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..127797a5ef70
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.2.9
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="10040ded663541990eef8ce1f6fa44cb3b4a47e145efb8e9e59907a15068033d
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From d70bc9f43a1dbe2c0edfefe53ac193aea9d4be6b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.3

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..195dd9269088
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: [PR REVIEW] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (14 preceding siblings ...)
  2022-03-28 14:17 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-03-28 14:17 ` TinfoilSubmarine
  2022-03-28 14:17 ` TinfoilSubmarine
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-28 14:17 UTC (permalink / raw)
  To: ml

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

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#discussion_r836482473

Comment:
Dropped version restrictions.

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

* Re: New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (15 preceding siblings ...)
  2022-03-28 14:17 ` [PR REVIEW] " TinfoilSubmarine
@ 2022-03-28 14:17 ` TinfoilSubmarine
  2022-03-28 14:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-28 14:17 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1080713093

Comment:
> some packages could be updated now, some need an update file to fix update check
> 

All should be fixed and updated to newest versions now.

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (16 preceding siblings ...)
  2022-03-28 14:17 ` TinfoilSubmarine
@ 2022-03-28 14:47 ` TinfoilSubmarine
  2022-04-09 10:21 ` [PR REVIEW] " paper42
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-03-28 14:47 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 05b248d4a026289c95a76886c294a04f693cb20b Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.17

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..2167cac876ca
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.0 --nodaemonize
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..52c3e11c9c64
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.17
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=bdbd792901c156c4d1710c9d266732d3c17f6ff63850d6660b9d8d3411188424
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From 7aa82c4ae468a47e13ceb18ae5e6aefc57ecefab Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..e081806f4530
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From edd6a4cce98b534e3e8d20292c471503c12fe852 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..5f4dedd31d66
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From a047de77db83caf0457e73ba6afcff58b08ac1b8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..d6be450ab7cd
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 3aed6e1235d06d7ea4711bd8e9ba431b43610cb0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..c9f3797a61c7
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From b52698223718822f2f5a042fe24e20a0c9cb7c7f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.2.9

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..4bffd1e7363f
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.2.9
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="48f9fdc9ad93904fee96550b45ae03a51f69718502ee855da894b4ad71d2dfe0
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 219abe117a13a1912b3a573ba80957ce534660f2 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.3

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..6328716760ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From 7f7a3fb64f81428f17a17da970f280c527a41cbf Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.4

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..445b41d04c44
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec php-fpm8.1 --nodaemonize
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..dc1aa8a5b321
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.4
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=a9951c1c8fd5d2eefde28de0f646c344eb61d751319d220713a6da26f986abde
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From 622b96603473402471a751d5a7d6b16d36a82887 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..d38a93896383
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 6c4efd93ae601beeeaf1cb40f858d840bdad828f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..ef6471a5ee90
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 0cc51dc1d4af52e0c0879918070b3bb7a74df850 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..cd1780b5fc1a
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 070be2d231b95623291df977ad3ce7409396f58a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..5789fc36a5f0
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From bd4d93ff1024262748061748e419ab5caf819d14 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.2.9

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..3822eb33441c
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.2.9
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="48f9fdc9ad93904fee96550b45ae03a51f69718502ee855da894b4ad71d2dfe0
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From 1014e158e0d69813417d984d037967325baaa64f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.3

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..195dd9269088
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.3
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=37d0a6701955f5b3406c6c327b7702bd7c21462e656f3b4cce24a05258013d4e
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: [PR REVIEW] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (17 preceding siblings ...)
  2022-03-28 14:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-04-09 10:21 ` paper42
  2022-04-10  0:22 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (11 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: paper42 @ 2022-04-09 10:21 UTC (permalink / raw)
  To: ml

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

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#discussion_r845877221

Comment:
```suggestion
[ -r conf ] && . ./conf
exec php-fpm8.0 --nodaemonize ${OPTS}
```
and source a conf file, do you think this would make sense? -c and -y may be useful for some people.

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (18 preceding siblings ...)
  2022-04-09 10:21 ` [PR REVIEW] " paper42
@ 2022-04-10  0:22 ` TinfoilSubmarine
  2022-04-11 13:19 ` TinfoilSubmarine
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-04-10  0:22 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 960678d72144d77304bc61ee27c65c84b4fa2fc9 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.17

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..f1c712335ab8
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.0 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..52c3e11c9c64
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.17
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=bdbd792901c156c4d1710c9d266732d3c17f6ff63850d6660b9d8d3411188424
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From bad50c1cff2cd0fd1069046787437ebf958e38dc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..e081806f4530
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From eaa4ad326b942f1fede3ed669708556964df7119 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..5f4dedd31d66
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From e9b0b0d763b84e41174518a67137cc5baeebf652 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..d6be450ab7cd
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From acbc7915f138d1065d13476165e4fb35e0a540b7 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..c9f3797a61c7
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From 861ca2dbd3cce88c3a0dc36dd1ee500456b0e1d4 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.3.4

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..d2b5a886acc4
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..e4fe657a3164
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.3.4
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="1fc8fc5b43f081fe76fa85eb5a213412e55f54a60bae4880bc96521ae482d6c3
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 7a0266fc88eae49fd532ad214b5f16da1a5809a5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.4

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..9d5244daf4d2
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From 8b917c2bc4a1f430696c3eef1ff5874f2ce0be97 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.4

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..5928ea5103ef
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.1 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..dc1aa8a5b321
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.4
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=a9951c1c8fd5d2eefde28de0f646c344eb61d751319d220713a6da26f986abde
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From 03747c813c2b7284e83849edb4f4f41f5bc5ab31 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..d38a93896383
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 811c397fafc3abf6412a5ea4bfecac0979768e8d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..ef6471a5ee90
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 3d3726425d65509dddeb3129df35a7cc06a193fd Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..cd1780b5fc1a
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 18d40481d4f230525e3d791a4c41240d14838e99 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..5789fc36a5f0
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From b8bff3c83c7e555babd28ef8ada9cebf7fbaca29 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.3.4

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..f5a79a2bdb33
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..fb507f8f28f5
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.3.4
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="1fc8fc5b43f081fe76fa85eb5a213412e55f54a60bae4880bc96521ae482d6c3
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From babe311c78ebcd909b4ce797e0b84429d2efba76 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.4

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..44a1940425f8
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (19 preceding siblings ...)
  2022-04-10  0:22 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-04-11 13:19 ` TinfoilSubmarine
  2022-04-19 17:19 ` TinfoilSubmarine
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-04-11 13:19 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 052b508f29737c5bcf6e08b03238f992026ea091 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.17

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..f1c712335ab8
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.0 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..52c3e11c9c64
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.17
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=bdbd792901c156c4d1710c9d266732d3c17f6ff63850d6660b9d8d3411188424
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From b98b1262f7acbe5b6e2b536a34ff2cc32a08b35f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..e081806f4530
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 3e2387624b3928536af7e07354d7842c97be3250 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..5f4dedd31d66
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From cff128ece9390bca0c218ab8277e2d1d07a21b31 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..d6be450ab7cd
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 66b56ef4d3d3b1ac5c4cbfb4007ae084689fa1e6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..c9f3797a61c7
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From ba10e0f865c52199bbdce532b44d41523801c76f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.3.4

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..2a3236b4a5ff
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0 "$@"
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..e4fe657a3164
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.3.4
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="1fc8fc5b43f081fe76fa85eb5a213412e55f54a60bae4880bc96521ae482d6c3
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 9223f9233a940c14589ead10e983fb8615ab968e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.4

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..9d5244daf4d2
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From cbbf8f53f59a98d40ced2a7851dbad454101dc07 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.4

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..5928ea5103ef
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.1 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..dc1aa8a5b321
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.4
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=a9951c1c8fd5d2eefde28de0f646c344eb61d751319d220713a6da26f986abde
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From ab3bcfb96b754d43956376ea49cfc858ea663384 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..d38a93896383
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 1c53c19f1dbf4dc68bb72de75dc9402bf9b5cd65 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..ef6471a5ee90
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 3b374ef454ef75acc1dbfd4da43829992898f859 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..cd1780b5fc1a
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 31e8e8b62d8649fbf3f50e0d9a1d31ec1122c80f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..5789fc36a5f0
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From 7fda806e4091fa0618bfc1782149c99c6396b51d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.3.4

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..a3f41b8b5578
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1 "$@"
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..fb507f8f28f5
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.3.4
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="1fc8fc5b43f081fe76fa85eb5a213412e55f54a60bae4880bc96521ae482d6c3
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From 077b78c7d2de7bdabe3ed421f45ba89624b91297 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.4

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..44a1940425f8
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (20 preceding siblings ...)
  2022-04-11 13:19 ` TinfoilSubmarine
@ 2022-04-19 17:19 ` TinfoilSubmarine
  2022-04-19 18:45 ` New packages: php8.[01]*, xdebug8.[01], composer8.[01] paper42
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-04-19 17:19 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 1c9adb4ffe3726f6cd71d2ebce9527f1e6e76105 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.18

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..f1c712335ab8
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.0 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..f294cad21561
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.18
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=cd980f5a2f422362f8c52d314ed25140c6f472877c5442c4f3304205f54e192a
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From 28068c9f1a25dbda14adff6f5cf04ea14f0d67b8 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..e081806f4530
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From 110058cbcc5d67c9b8f2c2895e41bae11ff436bc Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..5f4dedd31d66
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 44b9e426c167dcf0163a7085db38c753368317c6 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..d6be450ab7cd
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From c1fad6e4ae693e965a0a1ed2c6eb0793c0027bdb Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..c9f3797a61c7
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From 5978008321f8db5f384618932cb43e9dd48b831a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.3.5

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..2a3236b4a5ff
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0 "$@"
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..e23f55cabfe0
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.3.5
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From 27687a4837fc97ad7398e325dd772cbae8bdb61e Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.4

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..9d5244daf4d2
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From 7cce0f94add22b4cc404796ee75664eecb31a7de Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.5

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..5928ea5103ef
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.1 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..75c8f88557a4
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.5
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=44d637627746082395d5d3d3d6ae7d71e780b82a8d55a0228887158c4316bf11
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From a67b401c434b53cb7888f2be8f5c926299f1faec Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..d38a93896383
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From de796cf4dc3980cc4e3e7b98e0257910e8825f42 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..ef6471a5ee90
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From b24a92c92347d508d72e3ed2d664f321af2ebc07 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..cd1780b5fc1a
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 5debc987ed28aa488ae5eaa356532d7c3c550d43 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..5789fc36a5f0
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From efbe833bf79778f1aeb451fe83570de555d113c5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.3.5

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..a3f41b8b5578
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1 "$@"
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..7c1523cce41c
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.3.5
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Orphaned <orphan@voidlinux.org>"
+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="3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From d11344aecae2561d6b1379b7c6b7300d23531c20 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.4

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..44a1940425f8
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (21 preceding siblings ...)
  2022-04-19 17:19 ` TinfoilSubmarine
@ 2022-04-19 18:45 ` paper42
  2022-04-19 19:24 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: paper42 @ 2022-04-19 18:45 UTC (permalink / raw)
  To: ml

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

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1102972237

Comment:
It would be nice if the packages had a maintainer set before merging them, would you like write your name there?

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

* Re: [PR PATCH] [Updated] New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (22 preceding siblings ...)
  2022-04-19 18:45 ` New packages: php8.[01]*, xdebug8.[01], composer8.[01] paper42
@ 2022-04-19 19:24 ` TinfoilSubmarine
  2022-04-19 20:01 ` TinfoilSubmarine
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-04-19 19:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages php8
https://github.com/void-linux/void-packages/pull/36026

New packages: php8.[01]*, xdebug8.[01], composer8.[01]
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

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

From 8f84dc55af1c24f05f3fb8b0bb72ae9846fd6f72 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:15:34 -0400
Subject: [PATCH 01/14] New package: php8.0-8.0.18

---
 srcpkgs/php8.0-apache                         |   1 +
 srcpkgs/php8.0-cgi                            |   1 +
 srcpkgs/php8.0-devel                          |   1 +
 srcpkgs/php8.0-embed                          |   1 +
 srcpkgs/php8.0-enchant                        |   1 +
 srcpkgs/php8.0-ffi                            |   1 +
 srcpkgs/php8.0-fpm                            |   1 +
 srcpkgs/php8.0-gd                             |   1 +
 srcpkgs/php8.0-intl                           |   1 +
 srcpkgs/php8.0-ldap                           |   1 +
 srcpkgs/php8.0-mysql                          |   1 +
 srcpkgs/php8.0-odbc                           |   1 +
 srcpkgs/php8.0-pgsql                          |   1 +
 srcpkgs/php8.0-phpdbg                         |   1 +
 srcpkgs/php8.0-snmp                           |   1 +
 srcpkgs/php8.0-sodium                         |   1 +
 srcpkgs/php8.0-sqlite                         |   1 +
 srcpkgs/php8.0-tidy                           |   1 +
 srcpkgs/php8.0-xsl                            |   1 +
 srcpkgs/php8.0/files/apache.conf              |  13 +
 srcpkgs/php8.0/files/php-fpm8.0/run           |   3 +
 srcpkgs/php8.0/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.0/patches/php-cross-config.patch |  41 +++
 srcpkgs/php8.0/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 .../php8.0/patches/php-opcache-cross.patch    |  14 +
 srcpkgs/php8.0/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.0/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.0/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.0/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.0/update                         |   2 +
 32 files changed, 600 insertions(+)
 create mode 120000 srcpkgs/php8.0-apache
 create mode 120000 srcpkgs/php8.0-cgi
 create mode 120000 srcpkgs/php8.0-devel
 create mode 120000 srcpkgs/php8.0-embed
 create mode 120000 srcpkgs/php8.0-enchant
 create mode 120000 srcpkgs/php8.0-ffi
 create mode 120000 srcpkgs/php8.0-fpm
 create mode 120000 srcpkgs/php8.0-gd
 create mode 120000 srcpkgs/php8.0-intl
 create mode 120000 srcpkgs/php8.0-ldap
 create mode 120000 srcpkgs/php8.0-mysql
 create mode 120000 srcpkgs/php8.0-odbc
 create mode 120000 srcpkgs/php8.0-pgsql
 create mode 120000 srcpkgs/php8.0-phpdbg
 create mode 120000 srcpkgs/php8.0-snmp
 create mode 120000 srcpkgs/php8.0-sodium
 create mode 120000 srcpkgs/php8.0-sqlite
 create mode 120000 srcpkgs/php8.0-tidy
 create mode 120000 srcpkgs/php8.0-xsl
 create mode 100644 srcpkgs/php8.0/files/apache.conf
 create mode 100755 srcpkgs/php8.0/files/php-fpm8.0/run
 create mode 100644 srcpkgs/php8.0/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.0/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.0/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php-opcache-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.0/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.0/template
 create mode 100644 srcpkgs/php8.0/update

diff --git a/srcpkgs/php8.0-apache b/srcpkgs/php8.0-apache
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-apache
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-cgi b/srcpkgs/php8.0-cgi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-cgi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-devel b/srcpkgs/php8.0-devel
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-devel
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-embed b/srcpkgs/php8.0-embed
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-embed
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-enchant b/srcpkgs/php8.0-enchant
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-enchant
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ffi b/srcpkgs/php8.0-ffi
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ffi
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-fpm b/srcpkgs/php8.0-fpm
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-fpm
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-gd b/srcpkgs/php8.0-gd
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-gd
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-intl b/srcpkgs/php8.0-intl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-intl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-ldap b/srcpkgs/php8.0-ldap
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-ldap
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-mysql b/srcpkgs/php8.0-mysql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-mysql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-odbc b/srcpkgs/php8.0-odbc
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-odbc
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-pgsql b/srcpkgs/php8.0-pgsql
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-pgsql
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-phpdbg b/srcpkgs/php8.0-phpdbg
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-phpdbg
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-snmp b/srcpkgs/php8.0-snmp
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-snmp
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sodium b/srcpkgs/php8.0-sodium
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sodium
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-sqlite b/srcpkgs/php8.0-sqlite
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-sqlite
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-tidy b/srcpkgs/php8.0-tidy
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-tidy
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0-xsl b/srcpkgs/php8.0-xsl
new file mode 120000
index 000000000000..104f2d35908d
--- /dev/null
+++ b/srcpkgs/php8.0-xsl
@@ -0,0 +1 @@
+php8.0
\ No newline at end of file
diff --git a/srcpkgs/php8.0/files/apache.conf b/srcpkgs/php8.0/files/apache.conf
new file mode 100644
index 000000000000..17a0ad5f6fa4
--- /dev/null
+++ b/srcpkgs/php8.0/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.0_module
+
+<IfModule dir_module>
+	<IfModule php8.0_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/php8.0/files/php-fpm8.0/run b/srcpkgs/php8.0/files/php-fpm8.0/run
new file mode 100755
index 000000000000..f1c712335ab8
--- /dev/null
+++ b/srcpkgs/php8.0/files/php-fpm8.0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.0 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.0/patches/php-706-crypt.patch b/srcpkgs/php8.0/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.0/patches/php-cross-config.patch b/srcpkgs/php8.0/patches/php-cross-config.patch
new file mode 100644
index 000000000000..24de8c58cbdd
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-cross-config.patch
@@ -0,0 +1,41 @@
+--- 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 php"
+   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 php"
+   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/php8.0/patches/php-fpm.patch b/srcpkgs/php8.0/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.0/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.0/patches/php-opcache-cross.patch b/srcpkgs/php8.0/patches/php-opcache-cross.patch
new file mode 100644
index 000000000000..5d8a8c5ceed5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-opcache-cross.patch
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure.new
+index 1159224b4c..29f763aa05 100755
+--- a/configure
++++ b/configure.new
+@@ -51689,7 +51689,8 @@ $as_echo "$have_shm_ipc" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mmap() using MAP_ANON shared memory support" >&5
+ $as_echo_n "checking for mmap() using MAP_ANON shared memory support... " >&6; }
+   if test "$cross_compiling" = yes; then :
+-  have_shm_mmap_anon=no
++$as_echo "#define HAVE_SHM_MMAP_ANON 1" >>confdefs.h
++  have_shm_mmap_anon=yes
+ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
diff --git a/srcpkgs/php8.0/patches/php-pear-cross.patch b/srcpkgs/php8.0/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.0/patches/php-phar-cross.patch b/srcpkgs/php8.0/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.0/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.0/patches/php.ini.patch b/srcpkgs/php8.0/patches/php.ini.patch
new file mode 100644
index 000000000000..07e38a04cf4f
--- /dev/null
+++ b/srcpkgs/php8.0/patches/php.ini.patch
@@ -0,0 +1,24 @@
+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/php8.0/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.0/template b/srcpkgs/php8.0/template
new file mode 100644
index 000000000000..2ddb350061f3
--- /dev/null
+++ b/srcpkgs/php8.0/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.0'
+pkgname=php8.0
+version=8.0.18
+revision=1
+_php_version=8.0
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=cd980f5a2f422362f8c52d314ed25140c6f472877c5442c4f3304205f54e192a
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.0-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.0-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.0-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.0-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.0-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.0-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.0-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.0-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.0-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.0-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.0-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.0-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.0-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.0-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.0-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.0-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.0-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.0-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.0/update b/srcpkgs/php8.0/update
new file mode 100644
index 000000000000..c4d9bc5958ca
--- /dev/null
+++ b/srcpkgs/php8.0/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[1-9].*"

From 89faa3eb04ed14cc7d6e8790a0e854613aadda92 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:32:37 -0400
Subject: [PATCH 02/14] New package: php8.0-apcu-5.1.21

---
 srcpkgs/php8.0-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.0-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.0-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.0-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-apcu/template
 create mode 100644 srcpkgs/php8.0-apcu/update

diff --git a/srcpkgs/php8.0-apcu/INSTALL.msg b/srcpkgs/php8.0-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.0-apcu/template b/srcpkgs/php8.0-apcu/template
new file mode 100644
index 000000000000..0409dd840ff5
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-apcu'
+pkgname=php8.0-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+make_check_target=test
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel pcre2-devel"
+depends="php8.0"
+short_desc="In-memory key-value store for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-apcu/update b/srcpkgs/php8.0-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.0-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From ebbd01651c8246429147e21f1120b2d1f8ab0249 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:30:18 -0400
Subject: [PATCH 03/14] New package: php8.0-ast-1.0.16

---
 srcpkgs/php8.0-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.0-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.0-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-ast/template

diff --git a/srcpkgs/php8.0-ast/INSTALL.msg b/srcpkgs/php8.0-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.0-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.0-ast/template b/srcpkgs/php8.0-ast/template
new file mode 100644
index 000000000000..7f7a3bda75d2
--- /dev/null
+++ b/srcpkgs/php8.0-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-ast'
+pkgname=php8.0-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From a81c085076da340eb8c7474d7a2f3d45534df038 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:29:14 -0400
Subject: [PATCH 04/14] New package: php8.0-igbinary-3.2.7

---
 srcpkgs/php8.0-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.0-igbinary/template

diff --git a/srcpkgs/php8.0-igbinary/template b/srcpkgs/php8.0-igbinary/template
new file mode 100644
index 000000000000..f74c6f88186c
--- /dev/null
+++ b/srcpkgs/php8.0-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.0-igbinary'
+pkgname=php8.0-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf php8.0-devel"
+makedepends="php8.0-devel"
+depends="php8.0"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 85e896c4e783ebc90bc2c7a999833b6b5018213a Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:31:34 -0400
Subject: [PATCH 05/14] New package: php8.0-imagick-3.7.0

---
 srcpkgs/php8.0-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.0-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.0-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.0-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.0-imagick/template
 create mode 100644 srcpkgs/php8.0-imagick/update

diff --git a/srcpkgs/php8.0-imagick/INSTALL.msg b/srcpkgs/php8.0-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.0-imagick/template b/srcpkgs/php8.0-imagick/template
new file mode 100644
index 000000000000..9b0e0ba248c5
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.0-imagick'
+pkgname=php8.0-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="php8.0-devel autoconf pkg-config"
+makedepends="php8.0-devel pcre2-devel libmagick-devel"
+depends="php8.0"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.0
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.0-imagick/update b/srcpkgs/php8.0-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.0-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From 67a6156df6d7abb0ab1c18a0f2cd085cc5c3adb2 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:45:45 -0400
Subject: [PATCH 06/14] New package: composer8.0-2.3.5

---
 srcpkgs/composer8.0/files/composer8.0 |  2 ++
 srcpkgs/composer8.0/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.0/files/composer8.0
 create mode 100644 srcpkgs/composer8.0/template

diff --git a/srcpkgs/composer8.0/files/composer8.0 b/srcpkgs/composer8.0/files/composer8.0
new file mode 100644
index 000000000000..2a3236b4a5ff
--- /dev/null
+++ b/srcpkgs/composer8.0/files/composer8.0
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.0 -f /usr/libexec/composer.phar8.0 "$@"
diff --git a/srcpkgs/composer8.0/template b/srcpkgs/composer8.0/template
new file mode 100644
index 000000000000..dfc9de6993bd
--- /dev/null
+++ b/srcpkgs/composer8.0/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.0'
+pkgname=composer8.0
+version=2.3.5
+revision=1
+build_style=fetch
+depends="php8.0"
+short_desc="Dependency manager for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+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="3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.0
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.0
+	vlicense LICENSE
+
+	vmkdir /etc/php8.0/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.0/conf.d/composer.ini
+}

From f78dcc2d7ff7f3565a2162de8c540b492bec829f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 14:20:19 -0400
Subject: [PATCH 07/14] New package: xdebug8.0-3.1.4

---
 srcpkgs/xdebug8.0/INSTALL.msg |  1 +
 srcpkgs/xdebug8.0/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.0/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.0/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.0/template
 create mode 100644 srcpkgs/xdebug8.0/update

diff --git a/srcpkgs/xdebug8.0/INSTALL.msg b/srcpkgs/xdebug8.0/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.0/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.0/template b/srcpkgs/xdebug8.0/template
new file mode 100644
index 000000000000..159f30cd5299
--- /dev/null
+++ b/srcpkgs/xdebug8.0/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.0'
+pkgname=xdebug8.0
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.0"
+hostmakedepends="autoconf"
+makedepends="php8.0-devel"
+short_desc="PHP debugging extension"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.0-devel"
+fi
+
+pre_configure() {
+	phpize8.0
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.0/update b/srcpkgs/xdebug8.0/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.0/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

From a684cabeb12170411acbb09e983ce8545e921fa0 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:13:12 -0400
Subject: [PATCH 08/14] New package: php8.1-8.1.5

---
 srcpkgs/php8.1-apache                         |   1 +
 srcpkgs/php8.1-cgi                            |   1 +
 srcpkgs/php8.1-devel                          |   1 +
 srcpkgs/php8.1-embed                          |   1 +
 srcpkgs/php8.1-enchant                        |   1 +
 srcpkgs/php8.1-ffi                            |   1 +
 srcpkgs/php8.1-fpm                            |   1 +
 srcpkgs/php8.1-gd                             |   1 +
 srcpkgs/php8.1-intl                           |   1 +
 srcpkgs/php8.1-ldap                           |   1 +
 srcpkgs/php8.1-mysql                          |   1 +
 srcpkgs/php8.1-odbc                           |   1 +
 srcpkgs/php8.1-pgsql                          |   1 +
 srcpkgs/php8.1-phpdbg                         |   1 +
 srcpkgs/php8.1-snmp                           |   1 +
 srcpkgs/php8.1-sodium                         |   1 +
 srcpkgs/php8.1-sqlite                         |   1 +
 srcpkgs/php8.1-tidy                           |   1 +
 srcpkgs/php8.1-xsl                            |   1 +
 srcpkgs/php8.1/files/apache.conf              |  13 +
 srcpkgs/php8.1/files/php-fpm8.1/run           |   3 +
 srcpkgs/php8.1/patches/php-706-crypt.patch    |  15 +
 srcpkgs/php8.1/patches/php-cross-config.patch |  22 ++
 srcpkgs/php8.1/patches/php-fpm.patch          |  13 +
 .../patches/php-ltmain-sysroot-support.patch  |  39 ++
 srcpkgs/php8.1/patches/php-pear-cross.patch   |  23 ++
 srcpkgs/php8.1/patches/php-phar-cross.patch   |  29 ++
 .../patches/php-phpize-sysroot-support.patch  |  28 ++
 srcpkgs/php8.1/patches/php.ini.patch          |  24 ++
 srcpkgs/php8.1/template                       | 337 ++++++++++++++++++
 srcpkgs/php8.1/update                         |   2 +
 31 files changed, 567 insertions(+)
 create mode 120000 srcpkgs/php8.1-apache
 create mode 120000 srcpkgs/php8.1-cgi
 create mode 120000 srcpkgs/php8.1-devel
 create mode 120000 srcpkgs/php8.1-embed
 create mode 120000 srcpkgs/php8.1-enchant
 create mode 120000 srcpkgs/php8.1-ffi
 create mode 120000 srcpkgs/php8.1-fpm
 create mode 120000 srcpkgs/php8.1-gd
 create mode 120000 srcpkgs/php8.1-intl
 create mode 120000 srcpkgs/php8.1-ldap
 create mode 120000 srcpkgs/php8.1-mysql
 create mode 120000 srcpkgs/php8.1-odbc
 create mode 120000 srcpkgs/php8.1-pgsql
 create mode 120000 srcpkgs/php8.1-phpdbg
 create mode 120000 srcpkgs/php8.1-snmp
 create mode 120000 srcpkgs/php8.1-sodium
 create mode 120000 srcpkgs/php8.1-sqlite
 create mode 120000 srcpkgs/php8.1-tidy
 create mode 120000 srcpkgs/php8.1-xsl
 create mode 100644 srcpkgs/php8.1/files/apache.conf
 create mode 100755 srcpkgs/php8.1/files/php-fpm8.1/run
 create mode 100644 srcpkgs/php8.1/patches/php-706-crypt.patch
 create mode 100644 srcpkgs/php8.1/patches/php-cross-config.patch
 create mode 100644 srcpkgs/php8.1/patches/php-fpm.patch
 create mode 100644 srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php-pear-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phar-cross.patch
 create mode 100644 srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
 create mode 100644 srcpkgs/php8.1/patches/php.ini.patch
 create mode 100644 srcpkgs/php8.1/template
 create mode 100644 srcpkgs/php8.1/update

diff --git a/srcpkgs/php8.1-apache b/srcpkgs/php8.1-apache
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-apache
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-cgi b/srcpkgs/php8.1-cgi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-cgi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-devel b/srcpkgs/php8.1-devel
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-devel
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-embed b/srcpkgs/php8.1-embed
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-embed
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-enchant b/srcpkgs/php8.1-enchant
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-enchant
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ffi b/srcpkgs/php8.1-ffi
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ffi
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-fpm b/srcpkgs/php8.1-fpm
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-fpm
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-gd b/srcpkgs/php8.1-gd
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-gd
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-intl b/srcpkgs/php8.1-intl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-intl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-ldap b/srcpkgs/php8.1-ldap
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-ldap
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-mysql b/srcpkgs/php8.1-mysql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-mysql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-odbc b/srcpkgs/php8.1-odbc
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-odbc
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-pgsql b/srcpkgs/php8.1-pgsql
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-pgsql
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-phpdbg b/srcpkgs/php8.1-phpdbg
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-phpdbg
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-snmp b/srcpkgs/php8.1-snmp
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-snmp
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sodium b/srcpkgs/php8.1-sodium
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sodium
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-sqlite b/srcpkgs/php8.1-sqlite
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-sqlite
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-tidy b/srcpkgs/php8.1-tidy
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-tidy
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1-xsl b/srcpkgs/php8.1-xsl
new file mode 120000
index 000000000000..4ad857cc7c08
--- /dev/null
+++ b/srcpkgs/php8.1-xsl
@@ -0,0 +1 @@
+php8.1
\ No newline at end of file
diff --git a/srcpkgs/php8.1/files/apache.conf b/srcpkgs/php8.1/files/apache.conf
new file mode 100644
index 000000000000..f321ec12d31b
--- /dev/null
+++ b/srcpkgs/php8.1/files/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php8.1_module
+
+<IfModule dir_module>
+	<IfModule php8.1_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/php8.1/files/php-fpm8.1/run b/srcpkgs/php8.1/files/php-fpm8.1/run
new file mode 100755
index 000000000000..5928ea5103ef
--- /dev/null
+++ b/srcpkgs/php8.1/files/php-fpm8.1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r conf ] && . ./conf
+exec php-fpm8.1 --nodaemonize ${OPTS}
diff --git a/srcpkgs/php8.1/patches/php-706-crypt.patch b/srcpkgs/php8.1/patches/php-706-crypt.patch
new file mode 100644
index 000000000000..254f1d2187c2
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-706-crypt.patch
@@ -0,0 +1,15 @@
+--- 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/php8.1/patches/php-cross-config.patch b/srcpkgs/php8.1/patches/php-cross-config.patch
new file mode 100644
index 000000000000..169c43f1df93
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-cross-config.patch
@@ -0,0 +1,22 @@
+diff --git a/configure b/configure
+index e4b82d1..1a8678f 100755
+--- a/configure
++++ b/configure
+@@ -62424,7 +62424,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+@@ -63948,7 +63948,7 @@ printf %s "checking for pg_config... " >&6; }
+     fi
+   done
+ 
+-  if test -n "$PG_CONFIG"; then
++  if test -n "$PG_CONFIG" && test "x$cross_compiling" != "xyes"; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5
+ printf "%s\n" "$PG_CONFIG" >&6; }
+     PGSQL_INCLUDE=`$PG_CONFIG --includedir`
diff --git a/srcpkgs/php8.1/patches/php-fpm.patch b/srcpkgs/php8.1/patches/php-fpm.patch
new file mode 100644
index 000000000000..5e55e179f8a4
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-fpm.patch
@@ -0,0 +1,13 @@
+--- 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/php8.1/patches/php-ltmain-sysroot-support.patch b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
new file mode 100644
index 000000000000..bbe0a514a9e8
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-ltmain-sysroot-support.patch
@@ -0,0 +1,39 @@
+--- 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/php8.1/patches/php-pear-cross.patch b/srcpkgs/php8.1/patches/php-pear-cross.patch
new file mode 100644
index 000000000000..f9191a50a0b5
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-pear-cross.patch
@@ -0,0 +1,23 @@
+--- 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/php8.1/patches/php-phar-cross.patch b/srcpkgs/php8.1/patches/php-phar-cross.patch
new file mode 100644
index 000000000000..1e4e627ec65b
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phar-cross.patch
@@ -0,0 +1,29 @@
+--- 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/php8.1/patches/php-phpize-sysroot-support.patch b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
new file mode 100644
index 000000000000..76cff3f81664
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php-phpize-sysroot-support.patch
@@ -0,0 +1,28 @@
+--- 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/php8.1/patches/php.ini.patch b/srcpkgs/php8.1/patches/php.ini.patch
new file mode 100644
index 000000000000..186898f63fab
--- /dev/null
+++ b/srcpkgs/php8.1/patches/php.ini.patch
@@ -0,0 +1,24 @@
+diff --git a/php.ini-production b/php.ini-production
+index b39a960..68f14a6 100644
+--- a/php.ini-production
++++ b/php.ini-production
+@@ -737,7 +737,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"
+@@ -760,9 +760,7 @@ user_dir =
+ 
+ ; Directory in which the loadable extensions (modules) reside.
+ ; https://php.net/extension-dir
+-;extension_dir = "./"
+-; On windows:
+-;extension_dir = "ext"
++extension_dir = "/usr/lib/php8.1/modules/"
+ 
+ ; Directory where the temporary files should be placed.
+ ; Defaults to the system default (see sys_get_temp_dir)
diff --git a/srcpkgs/php8.1/template b/srcpkgs/php8.1/template
new file mode 100644
index 000000000000..16da7be3f32c
--- /dev/null
+++ b/srcpkgs/php8.1/template
@@ -0,0 +1,337 @@
+# Template file for 'php8.1'
+pkgname=php8.1
+version=8.1.5
+revision=1
+_php_version=8.1
+wrksrc="php-${version}"
+hostmakedepends="bison pkg-config apache-devel curl"
+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="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://www.php.net"
+distfiles="https://www.php.net/distributions/php-${version}.tar.gz"
+checksum=44d637627746082395d5d3d3d6ae7d71e780b82a8d55a0228887158c4316bf11
+
+fetch_cmd="curl -O"
+
+conf_files="/etc/php${_php_version}/php.ini"
+
+lib32disabled=yes
+
+if [ -n "$CROSS_BUILD" ]; then
+	# phar needs php to build
+	hostmakedepends+=" php${_php_version}"
+	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${_php_version} \
+		--localstatedir=/var \
+		--with-layout=GNU \
+		--with-config-file-path=/etc/php${_php_version} \
+		--with-config-file-scan-dir=/etc/php${_php_version}/conf.d \
+		--disable-rpath \
+		--mandir=/usr/share/man \
+		--libdir=/usr/lib/php${_php_version} \
+		--datarootdir=/usr/share/php${_php_version} \
+		--datadir=/usr/share/php${_php_version} \
+		--program-suffix=${_php_version} \
+		--includedir=/usr/include/php${_php_version} \
+		"
+
+	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-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-gdbm=$XBPS_CROSS_BASE/usr \
+		--with-gettext=shared \
+		--with-gmp=shared \
+		--with-iconv=shared \
+		--with-ldap=shared,$XBPS_CROSS_BASE/usr \
+		--with-ldap-sasl \
+		--with-sodium=shared \
+		--with-mhash \
+		--with-mysql-sock=/run/mysqld/mysqld.sock \
+		--with-mysqli=shared,mysqlnd \
+		--with-openssl=shared \
+		--with-external-pcre \
+		--without-pear \
+		--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-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-zip=shared \
+		--with-zlib \
+		${configure_args} \
+		"
+	if [ -n "$CROSS_BUILD" ]; then
+		local _make_env="PHAR_PHP=/usr/bin/php${_php_version} PHAR_PHP_MODULES=/usr/lib/php${_php_version}/modules"
+	fi
+
+	EXTENSION_DIR="/usr/lib/php${_php_version}/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${_php_version}"
+	fi
+	make ${_env} install-{modules,cli,build,headers,programs,pharcmd}
+
+	# install php.ini
+	vinstall ${wrksrc}/php.ini-production 644 "etc/php${_php_version}" php.ini
+	# remove static modules
+	rm -f "${DESTDIR}/usr/lib/php${_php_version}/modules/*.a"
+}
+
+php8.1-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/php${_php_version}/build"
+		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"
+	}
+}
+
+php8.1-phpdbg_package() {
+	short_desc+=" - interactive debugger"
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
+	}
+}
+
+php8.1-cgi_package() {
+	short_desc+=' - CGI and FCGI SAPI'
+	depends="php${_php_version}-${version}_${revision}"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-cgi
+	}
+}
+
+php8.1-apache_package() {
+	short_desc+=' - Apache SAPI'
+	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"
+		vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra "php${_php_version}_module.conf"
+	}
+}
+
+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/*"
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} install-fpm
+		vsv "php-fpm${_php_version}"
+	}
+}
+
+php8.1-embed_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Embed SAPI'
+	pkg_install() {
+		cd ${wrksrc}/build
+		make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
+		mv ${PKGDESTDIR}/usr/lib/libphp.so ${PKGDESTDIR}/usr/lib/libphp${_php_version}.so
+	}
+}
+
+php8.1-enchant_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - enchant module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/enchant.so"
+	}
+}
+
+php8.1-gd_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - gd module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/gd.so"
+	}
+}
+
+php8.1-intl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - Internationalization module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/intl.so"
+	}
+}
+
+php8.1-ldap_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - LDAP module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ldap.so"
+	}
+}
+
+php8.1-mysql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - MySQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*mysql*.so"
+	}
+}
+
+php8.1-odbc_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - ODBC modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*odbc.so"
+	}
+}
+
+php8.1-pgsql_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - PostgreSQL modules'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*pgsql.so"
+	}
+}
+
+php8.1-snmp_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - snmp module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/snmp.so"
+	}
+}
+
+php8.1-sqlite_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sqlite module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*sqlite*.so"
+	}
+}
+
+php8.1-tidy_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - tidy HTML module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/*tidy*.so"
+	}
+}
+
+php8.1-xsl_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - XSL module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/xsl.so"
+	}
+}
+
+php8.1-sodium_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - sodium module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/sodium.so"
+	}
+}
+
+php8.1-ffi_package() {
+	lib32disabled=yes
+	depends="php${_php_version}-${version}_${revision}"
+	short_desc+=' - FFI module'
+	pkg_install() {
+		vmove "usr/lib/php${_php_version}/modules/ffi.so"
+	}
+}
diff --git a/srcpkgs/php8.1/update b/srcpkgs/php8.1/update
new file mode 100644
index 000000000000..0c2792ec963f
--- /dev/null
+++ b/srcpkgs/php8.1/update
@@ -0,0 +1,2 @@
+pkgname=php
+ignore="8.[2-9].*"

From 8c06a416d91e922acd747cde6fb5cf6eccc8a4e5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:51 -0400
Subject: [PATCH 09/14] New package: php8.1-apcu-5.1.21

---
 srcpkgs/php8.1-apcu/INSTALL.msg |  3 +++
 srcpkgs/php8.1-apcu/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/php8.1-apcu/update      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 srcpkgs/php8.1-apcu/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-apcu/template
 create mode 100644 srcpkgs/php8.1-apcu/update

diff --git a/srcpkgs/php8.1-apcu/INSTALL.msg b/srcpkgs/php8.1-apcu/INSTALL.msg
new file mode 100644
index 000000000000..9da8a70ccc2b
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable APCu add the following line to your php.ini:
+
+	extension=apcu.so
diff --git a/srcpkgs/php8.1-apcu/template b/srcpkgs/php8.1-apcu/template
new file mode 100644
index 000000000000..60d5ca79143d
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-apcu'
+pkgname=php8.1-apcu
+version=5.1.21
+revision=1
+wrksrc="apcu-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+make_check_target=test
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel pcre2-devel"
+depends="php8.1"
+short_desc="In-memory key-value store for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/APCu"
+distfiles="https://pecl.php.net/get/apcu-${version}.tgz"
+checksum=1033530448696ee7cadec85050f6df5135fb1330072ef2a74569392acfecfbc1
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-apcu/update b/srcpkgs/php8.1-apcu/update
new file mode 100644
index 000000000000..ad899519e313
--- /dev/null
+++ b/srcpkgs/php8.1-apcu/update
@@ -0,0 +1,2 @@
+site="https://pecl.php.net/package/APCu"
+pattern="apcu-\K[\d\.]*(?=\.tgz)"

From c9944f0fab2cb3719838b416a93f0331f7dd6c54 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:30:37 -0400
Subject: [PATCH 10/14] New package: php8.1-ast-1.0.16

---
 srcpkgs/php8.1-ast/INSTALL.msg |  2 ++
 srcpkgs/php8.1-ast/template    | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 srcpkgs/php8.1-ast/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-ast/template

diff --git a/srcpkgs/php8.1-ast/INSTALL.msg b/srcpkgs/php8.1-ast/INSTALL.msg
new file mode 100644
index 000000000000..0dd0b5df2d96
--- /dev/null
+++ b/srcpkgs/php8.1-ast/INSTALL.msg
@@ -0,0 +1,2 @@
+To enable the ast extension please add the following to php.ini:
+	extension=ast.so 
diff --git a/srcpkgs/php8.1-ast/template b/srcpkgs/php8.1-ast/template
new file mode 100644
index 000000000000..549b8fcc1bce
--- /dev/null
+++ b/srcpkgs/php8.1-ast/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-ast'
+pkgname=php8.1-ast
+version=1.0.16
+revision=1
+wrksrc="ast-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Exposes the abstract syntax tree generated by PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="https://github.com/nikic/php-ast"
+distfiles="https://pecl.php.net/get/ast-${version}.tgz"
+checksum=45bda34b780c4661ce77cf65cd8a504fb56526d4b456edcc97d791c86f3879ce
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}

From 0ab42a44dc36ce806ab5230750f02d93ea5a5262 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:06 -0400
Subject: [PATCH 11/14] New package: php8.1-igbinary-3.2.7

---
 srcpkgs/php8.1-igbinary/template | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 srcpkgs/php8.1-igbinary/template

diff --git a/srcpkgs/php8.1-igbinary/template b/srcpkgs/php8.1-igbinary/template
new file mode 100644
index 000000000000..14fadb10e252
--- /dev/null
+++ b/srcpkgs/php8.1-igbinary/template
@@ -0,0 +1,25 @@
+# Template file for 'php8.1-igbinary'
+pkgname=php8.1-igbinary
+version=3.2.7
+revision=1
+wrksrc="igbinary-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf php8.1-devel"
+makedepends="php8.1-devel"
+depends="php8.1"
+short_desc="Igbinary is a drop in replacement for the standard php serializer"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="BSD-3-Clause"
+homepage="https://github.com/igbinary/igbinary/"
+distfiles="https://pecl.php.net/get/igbinary-${version}.tgz"
+checksum=d0dc0d0b56a985f4f52cea20717133d3da05368876bc0f94317c1e60e0319e7d
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT="${DESTDIR}" install
+	vlicense COPYING
+}

From 7a123c4f56c38cf1521b97c8505a78889ad132d5 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:33 -0400
Subject: [PATCH 12/14] New package: php8.1-imagick-3.7.0

---
 srcpkgs/php8.1-imagick/INSTALL.msg            |  3 ++
 ...le-libmagick-header-file-search-path.patch | 17 +++++++++++
 srcpkgs/php8.1-imagick/template               | 29 +++++++++++++++++++
 srcpkgs/php8.1-imagick/update                 |  1 +
 4 files changed, 50 insertions(+)
 create mode 100644 srcpkgs/php8.1-imagick/INSTALL.msg
 create mode 100644 srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
 create mode 100644 srcpkgs/php8.1-imagick/template
 create mode 100644 srcpkgs/php8.1-imagick/update

diff --git a/srcpkgs/php8.1-imagick/INSTALL.msg b/srcpkgs/php8.1-imagick/INSTALL.msg
new file mode 100644
index 000000000000..00497519fcee
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/INSTALL.msg
@@ -0,0 +1,3 @@
+To enable the Imagick extension add the following line to your php.ini:
+
+	extension=imagick.so
diff --git a/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
new file mode 100644
index 000000000000..16b8aaa57371
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/patches/0001-fix-cross-compile-libmagick-header-file-search-path.patch
@@ -0,0 +1,17 @@
+--- 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/php8.1-imagick/template b/srcpkgs/php8.1-imagick/template
new file mode 100644
index 000000000000..6cd0c4098d69
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/template
@@ -0,0 +1,29 @@
+# Template file for 'php8.1-imagick'
+pkgname=php8.1-imagick
+version=3.7.0
+revision=1
+wrksrc="imagick-$version"
+build_style=gnu-configure
+configure_args="--with-imagick=${XBPS_CROSS_BASE}/usr \
+ --with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="php8.1-devel autoconf pkg-config"
+makedepends="php8.1-devel pcre2-devel libmagick-devel"
+depends="php8.1"
+short_desc="Provides a PHP wrapper to the ImageMagick library"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.01"
+homepage="https://pecl.php.net/package/imagick"
+distfiles="https://pecl.php.net/get/imagick-$version.tgz"
+checksum=5a364354109029d224bcbb2e82e15b248be9b641227f45e63425c06531792d3e
+
+pre_configure() {
+	phpize8.1
+}
+
+pre_install() {
+	make_install_args="INSTALL_ROOT=$DESTDIR"
+}
+
+post_install() {
+	rm -r $DESTDIR/usr/include
+}
diff --git a/srcpkgs/php8.1-imagick/update b/srcpkgs/php8.1-imagick/update
new file mode 100644
index 000000000000..fb47044a964d
--- /dev/null
+++ b/srcpkgs/php8.1-imagick/update
@@ -0,0 +1 @@
+pattern='<th.*Release \K[\d.]+(?=:</th>)'

From caf9eb659ab2b4bd6e76dad12905a48cd4ae57ab Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:29:23 -0400
Subject: [PATCH 13/14] New package: composer8.1-2.3.5

---
 srcpkgs/composer8.1/files/composer8.1 |  2 ++
 srcpkgs/composer8.1/template          | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 srcpkgs/composer8.1/files/composer8.1
 create mode 100644 srcpkgs/composer8.1/template

diff --git a/srcpkgs/composer8.1/files/composer8.1 b/srcpkgs/composer8.1/files/composer8.1
new file mode 100644
index 000000000000..a3f41b8b5578
--- /dev/null
+++ b/srcpkgs/composer8.1/files/composer8.1
@@ -0,0 +1,2 @@
+#!/bin/sh
+php8.1 -f /usr/libexec/composer.phar8.1 "$@"
diff --git a/srcpkgs/composer8.1/template b/srcpkgs/composer8.1/template
new file mode 100644
index 000000000000..9ae0765cf0d4
--- /dev/null
+++ b/srcpkgs/composer8.1/template
@@ -0,0 +1,26 @@
+# Template file for 'composer8.1'
+pkgname=composer8.1
+version=2.3.5
+revision=1
+build_style=fetch
+depends="php8.1"
+short_desc="Dependency manager for PHP"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+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="3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4
+ 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c"
+
+do_install() {
+	vbin ${FILESDIR}/composer8.1
+
+	vinstall composer.phar 644 usr/libexec composer.phar8.1
+	vlicense LICENSE
+
+	vmkdir /etc/php8.1/conf.d
+	printf 'extension=%s\n' phar iconv openssl zip \
+		>${DESTDIR}/etc/php8.1/conf.d/composer.ini
+}

From 99a7fca689d60480e0fcb6d34c5bb20e8741a62d Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Tue, 15 Mar 2022 15:31:58 -0400
Subject: [PATCH 14/14] New package: xdebug8.1-3.1.4

---
 srcpkgs/xdebug8.1/INSTALL.msg |  1 +
 srcpkgs/xdebug8.1/template    | 29 +++++++++++++++++++++++++++++
 srcpkgs/xdebug8.1/update      |  2 ++
 3 files changed, 32 insertions(+)
 create mode 100644 srcpkgs/xdebug8.1/INSTALL.msg
 create mode 100644 srcpkgs/xdebug8.1/template
 create mode 100644 srcpkgs/xdebug8.1/update

diff --git a/srcpkgs/xdebug8.1/INSTALL.msg b/srcpkgs/xdebug8.1/INSTALL.msg
new file mode 100644
index 000000000000..04e3343216f7
--- /dev/null
+++ b/srcpkgs/xdebug8.1/INSTALL.msg
@@ -0,0 +1 @@
+You should add 'zend_extension="xdebug.so"' to php.ini
diff --git a/srcpkgs/xdebug8.1/template b/srcpkgs/xdebug8.1/template
new file mode 100644
index 000000000000..62fa2b795f40
--- /dev/null
+++ b/srcpkgs/xdebug8.1/template
@@ -0,0 +1,29 @@
+# Template file for 'xdebug8.1'
+pkgname=xdebug8.1
+version=3.1.4
+revision=1
+wrksrc="xdebug-${version}"
+build_style=gnu-configure
+configure_args="--with-php-config=/usr/bin/php-config8.1"
+hostmakedepends="autoconf"
+makedepends="php8.1-devel"
+short_desc="PHP debugging extension"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="PHP-3.0"
+homepage="http://xdebug.org"
+changelog="https://xdebug.org/updates"
+distfiles="http://xdebug.org/files/xdebug-${version}.tgz"
+checksum=4195926f9f6c4e802ff749bb2ca85ac50636719a72e5389e372e35ef523505f9
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" php8.1-devel"
+fi
+
+pre_configure() {
+	phpize8.1
+}
+
+do_install() {
+	make INSTALL_ROOT=${DESTDIR} install
+	vlicense LICENSE
+}
diff --git a/srcpkgs/xdebug8.1/update b/srcpkgs/xdebug8.1/update
new file mode 100644
index 000000000000..280b0bc7e3ac
--- /dev/null
+++ b/srcpkgs/xdebug8.1/update
@@ -0,0 +1,2 @@
+site="https://xdebug.org/updates"
+pattern='<dt><a name=.*></a>.*Xdebug \K[\d.]+(?=</dt>)'

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (23 preceding siblings ...)
  2022-04-19 19:24 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-04-19 20:01 ` TinfoilSubmarine
  2022-04-29 10:33 ` [PR PATCH] [Merged]: " paper42
                   ` (5 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-04-19 20:01 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1103063703

Comment:
> It would be nice if the packages had a maintainer set before merging them, would you like write your name there?

Done

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

* Re: [PR PATCH] [Merged]: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (24 preceding siblings ...)
  2022-04-19 20:01 ` TinfoilSubmarine
@ 2022-04-29 10:33 ` paper42
  2022-05-06 20:10 ` jchook
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: paper42 @ 2022-04-29 10:33 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

New packages: php8.[01]*, xdebug8.[01], composer8.[01]
https://github.com/void-linux/void-packages/pull/36026

Description:
<!-- 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**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](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, (x86_64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl
  - aarch64 (cross)
  - armv6l (cross)
-->

Not sure what else is needed for this to round a complete PHP environment, but I am currently using the php8.0-* stuff to self-host Nextcloud and Firefly III without any issues.

~~In regards to 8.0.x vs 8.1.x, I opted for 8.0.x because in my use case both Nextcloud and Firefly III still haven't properly supported PHP 8.1.x. For reference, it's been out for [3 months](https://www.php.net/supported-versions.php). Perhaps we can have a php8.1 package as well? idk~~

EDIT: this would also close https://github.com/void-linux/void-packages/issues/31678

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (25 preceding siblings ...)
  2022-04-29 10:33 ` [PR PATCH] [Merged]: " paper42
@ 2022-05-06 20:10 ` jchook
  2022-05-06 20:10 ` jchook
                   ` (3 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: jchook @ 2022-05-06 20:10 UTC (permalink / raw)
  To: ml

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

New comment by jchook on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1119974726

Comment:
What's the preferred way to "choose" a version of php to be symlinked to `/usr/bin/php`?

Is there a way to do this with xbps-alternatives?

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (26 preceding siblings ...)
  2022-05-06 20:10 ` jchook
@ 2022-05-06 20:10 ` jchook
  2022-05-06 20:10 ` jchook
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 32+ messages in thread
From: jchook @ 2022-05-06 20:10 UTC (permalink / raw)
  To: ml

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

New comment by jchook on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1119974725

Comment:
What's the preferred way to "choose" a version of php to be symlinked to `/usr/bin/php`?

Is there a way to do this with xbps-alternatives?

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (27 preceding siblings ...)
  2022-05-06 20:10 ` jchook
@ 2022-05-06 20:10 ` jchook
  2022-05-06 21:02 ` TinfoilSubmarine
  2022-05-06 21:19 ` paper42
  30 siblings, 0 replies; 32+ messages in thread
From: jchook @ 2022-05-06 20:10 UTC (permalink / raw)
  To: ml

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

New comment by jchook on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1119974725

Comment:
What's the preferred way to "choose" a version of php to be symlinked to `/usr/bin/php`?

Is there a way to do this with xbps-alternatives?

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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (28 preceding siblings ...)
  2022-05-06 20:10 ` jchook
@ 2022-05-06 21:02 ` TinfoilSubmarine
  2022-05-06 21:19 ` paper42
  30 siblings, 0 replies; 32+ messages in thread
From: TinfoilSubmarine @ 2022-05-06 21:02 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1120005517

Comment:
I did not set that up in this PR; I can look into it if there is interest. Aa you mentioned, would just need to add xbps-alternatives to the package template(s).

> What's the preferred way to "choose" a version of php to be symlinked to `/usr/bin/php`?
> 
> Is there a way to do this with xbps-alternatives?



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

* Re: New packages: php8.[01]*, xdebug8.[01], composer8.[01]
  2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
                   ` (29 preceding siblings ...)
  2022-05-06 21:02 ` TinfoilSubmarine
@ 2022-05-06 21:19 ` paper42
  30 siblings, 0 replies; 32+ messages in thread
From: paper42 @ 2022-05-06 21:19 UTC (permalink / raw)
  To: ml

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

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36026#issuecomment-1120015397

Comment:
> What's the preferred way to "choose" a version of php to be symlinked to `/usr/bin/php`?
> 
> Is there a way to do this with xbps-alternatives?

Currently there isn't a way to do this, if you want to use php8.0, you have to type php8.0.

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

end of thread, other threads:[~2022-05-06 21:19 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08  2:11 [PR PATCH] New package: php8-8.0.16 TinfoilSubmarine
2022-03-08  2:43 ` TinfoilSubmarine
2022-03-08  2:50 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-03-08  2:55 ` TinfoilSubmarine
2022-03-08 14:28 ` TinfoilSubmarine
2022-03-08 14:31 ` TinfoilSubmarine
2022-03-08 16:54 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-03-08 17:51 ` TinfoilSubmarine
2022-03-08 18:30 ` [PR PATCH] [Updated] [WIP] " TinfoilSubmarine
2022-03-08 19:10 ` TinfoilSubmarine
2022-03-08 19:49 ` TinfoilSubmarine
2022-03-15 19:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-03-15 19:49 ` [PR PATCH] [Updated] New packages: php8.0-*, php8.1-*, xdebug8.0/1, composer8.0/1 TinfoilSubmarine
2022-03-16  3:47 ` TinfoilSubmarine
2022-03-27  8:31 ` [PR REVIEW] " paper42
2022-03-28 14:17 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-03-28 14:17 ` [PR REVIEW] " TinfoilSubmarine
2022-03-28 14:17 ` TinfoilSubmarine
2022-03-28 14:47 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-04-09 10:21 ` [PR REVIEW] " paper42
2022-04-10  0:22 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-04-11 13:19 ` TinfoilSubmarine
2022-04-19 17:19 ` TinfoilSubmarine
2022-04-19 18:45 ` New packages: php8.[01]*, xdebug8.[01], composer8.[01] paper42
2022-04-19 19:24 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-04-19 20:01 ` TinfoilSubmarine
2022-04-29 10:33 ` [PR PATCH] [Merged]: " paper42
2022-05-06 20:10 ` jchook
2022-05-06 20:10 ` jchook
2022-05-06 20:10 ` jchook
2022-05-06 21:02 ` TinfoilSubmarine
2022-05-06 21:19 ` paper42

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).