Created attachment 271505 [details] 0001-archivers-php-zstd-update-0.15.2-0.16.0.patch https://github.com/kjdev/php-ext-zstd/releases/tag/0.16.0 https://github.com/kjdev/php-ext-brotli/releases/tag/0.19.0
Created attachment 271506 [details] 0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Prevent silent grab of ${LOCALBASE}/include/php/ext/apcu/apc_serializer.h if devel/pecl-APCu@${PHP_FLAVOR} installed, but option APCU disabled: archivers/php-zstd/files/patch-config.m4: --- config.m4.orig 2026-06-05 04:23:54 UTC +++ config.m4 @@ -104,6 +104,11 @@ fi ]) fi + +PHP_ARG_ENABLE(apcu, whether to enable APCu support, +[ --enable-apcu Enable APCu support], no, no) + +if test "$PHP_APCU" != "no"; then dnl APCu AC_MSG_CHECKING([for APCu includes]) if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then @@ -112,6 +117,7 @@ else AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support]) else AC_MSG_RESULT([not found]) +fi fi dnl coverage archivers/php-brotli/files/patch-config.m4: --- config.m4.orig 2026-06-05 04:27:29 UTC +++ config.m4 @@ -132,6 +132,10 @@ if test "$PHP_BROTLI" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/brotli/c/enc) fi + PHP_ARG_ENABLE(apcu, whether to enable APCu support, + [ --enable-apcu Enable APCu support], no, no) + + if test "$PHP_APCU" != "no"; then AC_MSG_CHECKING([for APCu includes]) if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then apc_inc_path="$phpincludedir" @@ -139,5 +143,6 @@ if test "$PHP_BROTLI" != "no"; then AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support]) else AC_MSG_RESULT([not found]) + fi fi fi Also in Makefiles: +APCU_CONFIGURE_ENABLE= apcu
How about? .include <bsd.port.pre.mk> post-patch: .if !${PORT_OPTIONS:MAPCU} @${REINPLACE_CMD} -e 's|apc_serializer|doesnotexist|' ${WRKSRC}/config.m4 .endif .include <bsd.port.post.mk> No need for a patch file to keep updated. Same thing applies to php-lz4 btw...
(In reply to Paavo-Einari Kaipila from comment #3) So you "broke" file search: > if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then Heh. Nice hack. :-D But my patch is upstreamuble.
Upstreaming it could break other people's build pipelines as it would change existing behaviour from "build with APCu if it happens to be there" to "build with APCu is requested". I will, however make upstream aware of this, since I am actually already a contributor in these and planning to contribute more in a near future.
Created attachment 271562 [details] 0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Created attachment 271563 [details] 0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Created attachment 271564 [details] 0001-archivers-php-lz4-don-t-grab-apc_serializer.h-if-it-.patch
(In reply to Paavo-Einari Kaipila from comment #5) We just need to make this option enabled by default. For example, reverse it.
--- config.m4.orig 2026-06-05 04:23:54 UTC +++ config.m4 @@ -104,6 +104,11 @@ fi ]) fi + +PHP_ARG_ENABLE(apcu, whether to enable APCu support, +[ --enable-apcu Enable APCu support], yes, no) + +if test "$PHP_APCU" != "no"; then dnl APCu AC_MSG_CHECKING([for APCu includes]) if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then @@ -112,6 +117,7 @@ else AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support]) else AC_MSG_RESULT([not found]) +fi fi dnl coverage
(In reply to Vladimir Druzenko from comment #9) But that would still break other people's existing setups. Having it off by default could lead to a situation, where someone will accidentally loose APCu support if they don't notice the change. And having it on should then cause a configure fail if the header isn't there, another headache for others with existing build pipelines.
Created attachment 271573 [details] 0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Created attachment 271574 [details] 0002-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Created attachment 271575 [details] 0003-archivers-php-lz4-always-build-with-APCu-support-it.patch
There, problem solved. No need for patches or backwards-breaking upstream changes.
I actually came up with an upstreamable version of your patch. https://github.com/kjdev/php-ext-zstd/pull/99 New set of patches coming later today for all three of these.
Created attachment 271614 [details] 0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Created attachment 271615 [details] 0002-archivers-php-brotli-update-0.18.2-0.19.0.patch
Created attachment 271616 [details] 0003-archivers-php-lz4-patch-config.m4-to-always-honor-AP.patch
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=91b1d1c5359af6cf62953344d24b4f5ac1ac411e commit 91b1d1c5359af6cf62953344d24b4f5ac1ac411e Author: Paavo-Einari Kaipila <pkaipila@gmail.com> AuthorDate: 2026-06-08 19:30:33 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-06-08 19:31:48 +0000 archivers/php-lz4: Patch config.m4 to always honor APCU setting PR: 295867 Sponsored by: UNIS Labs Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org> archivers/php-lz4/Makefile | 2 ++ archivers/php-lz4/files/patch-config.m4 (new) | 38 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9f79d999cc78f4ad5eba8c5cd534a3c85ea0ecf2 commit 9f79d999cc78f4ad5eba8c5cd534a3c85ea0ecf2 Author: Paavo-Einari Kaipila <pkaipila@gmail.com> AuthorDate: 2026-06-08 19:27:48 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-06-08 19:31:47 +0000 archivers/php-brotli: Update 0.18.2 => 0.19.0 Changelog: https://github.com/kjdev/php-ext-brotli/releases/tag/0.19.0 Commit log: https://github.com/kjdev/php-ext-brotli/compare/0.18.2...0.19.0 Enable APCu cache compression and patch config.m4 to always honor APCU setting. PR: 295867 Sponsored by: UNIS Labs Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org> archivers/php-brotli/Makefile | 11 +++++-- archivers/php-brotli/distinfo | 6 ++-- archivers/php-brotli/files/patch-config.m4 (new) | 37 ++++++++++++++++++++++++ archivers/php-brotli/pkg-descr | 14 +++++---- 4 files changed, 57 insertions(+), 11 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e5a35b56c2236596c728276135e5d07ee8449b10 commit e5a35b56c2236596c728276135e5d07ee8449b10 Author: Paavo-Einari Kaipila <pkaipila@gmail.com> AuthorDate: 2026-06-08 19:29:23 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2026-06-08 19:31:48 +0000 archivers/php-zstd: Update 0.15.2 => 0.16.0 Changelog: https://github.com/kjdev/php-ext-zstd/releases/tag/0.16.0 Commit log: https://github.com/kjdev/php-ext-zstd/compare/0.15.2...0.16.0 Patch config.m4 to always honor APCU setting. PR: 295867 Sponsored by: UNIS Labs Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org> archivers/php-zstd/Makefile | 4 +-- archivers/php-zstd/distinfo | 6 ++-- archivers/php-zstd/files/patch-config.m4 (new) | 38 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-)
Thanks.
thanks again