# Buildsheet autogenerated by ravenadm tool -- Do not edit.

NAMEBASE=		php83-phar
VERSION=		8.3.20
KEYWORDS=		lang www php archivers
VARIANTS=		std
SDESC[std]=		PHP 8.3 extension: phar PHP Archive
HOMEPAGE=		https://php.net/
CONTACT=		nobody

DOWNLOAD_GROUPS=	main
SITES[main]=		PHP/distributions
DISTFILE[1]=		php-8.3.20.tar.xz:main
DF_INDEX=		1
SPKGS[std]=		single

OPTIONS_AVAILABLE=	none
OPTIONS_STANDARD=	none

USES=			php:ext,83 cpe pcre:build

DISTNAME=		php-8.3.20/ext/{{PHP_MODNAME}}
EXTRACT_HEAD[1]=	{{TAR}} -xf
EXTRACT_TAIL[1]=	php-8.3.20/ext/{{PHP_MODNAME}}

CPE_PRODUCT=		php
CPE_VENDOR=		php
FPC_EQUIVALENT=		archivers/php83-phar

CONFIGURE_ARGS=		--enable-phar
			--with-pcre-dir={{LOCALBASE}}

[FILE:54:descriptions/desc.single]
This package contains the phar extension for PHP 8.3.


[FILE:96:distinfo]
f15914e071b5bddaf1475b5f2ba68107e8b8846655f9e89690fb7cd410b0db6c     12549020 php-8.3.20.tar.xz


[FILE:1151:patches/patch-config.m4]
--- config.m4.orig	2023-11-21 14:40:35 UTC
+++ config.m4
@@ -4,8 +4,38 @@ PHP_ARG_ENABLE([phar],
     [Disable phar support])],
   [yes])
 
+PHP_ARG_WITH(pcre-dir, pcre install prefix,
+[  --with-pcre-dir           PHAR: pcre install prefix], no, no)
+
+
 if test "$PHP_PHAR" != "no"; then
+
+  dnl This is PECL build, check if bundled PCRE library is used
+  old_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS=$INCLUDES
+  AC_EGREP_CPP(yes,[
+#include <main/php_config.h>
+#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+  ],[
+    PHP_PCRE_REGEX=yes
+  ],[
+    AC_EGREP_CPP(yes,[
+#include <main/php_config.h>
+#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+    ],[
+      PHP_PCRE_REGEX=pecl
+      PHP_ADD_INCLUDE($PHP_PCRE_DIR/include)
+    ],[
+      PHP_PCRE_REGEX=no
+    ])
+  ])
+
   PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+  PHP_HASH=yes
   AC_MSG_CHECKING([for phar openssl support])
   if test "$PHP_OPENSSL_SHARED" = "yes"; then
     AC_MSG_RESULT([no (shared openssl)])