git: 945dec8fbd3b - main - Uses/php.mk: Helper variable to disable FLAVOR

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 03 Apr 2022 21:39:27 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=945dec8fbd3bad12712c0f80d8215935818c9292

commit 945dec8fbd3bad12712c0f80d8215935818c9292
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2022-04-03 21:33:58 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-04-03 21:33:58 +0000

    Uses/php.mk: Helper variable to disable FLAVOR
    
    - Currently our php.mk is defined in such a way that when testing with
      poudriere if a port do not support the PHP default version it tries to
      build with a different php version that the port supports.
      Unfortunately this behavior is not too much helpful when we want to
      add/remove a old/new php version as it doesn't gives a clear picture
      of which ports fails to build with a specific PHP version. So this
      patch defines a variable "BUILD_ONLY_DEFAULT_PHP_FLAVOR". If this
      variable is defined in make.conf then poudriere will build with default
      flavor and in case it's not supported this will IGNORE/SKIP the port which
      gives a clear overview of which ports are going to create problem
      while adding/removing/changing default php.
    
    - One more thing is there are some old php modules still listed
      specifically dbase_DEPENDS, mssql_DEPENDS and sybase_ct_DEPENDS which
      are actually no longer in the tree.
    
    PR:             262639
    Approved by:    ale (maintainer-timeout)
    Sponsored by:   Bounce Experts
---
 Mk/Uses/php.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Mk/Uses/php.mk b/Mk/Uses/php.mk
index 45506538273d..9940d7fba047 100644
--- a/Mk/Uses/php.mk
+++ b/Mk/Uses/php.mk
@@ -47,6 +47,8 @@
 #
 # IGNORE_WITH_PHP=N - The port doesn't work with PHP version N.
 #
+# BUILD_ONLY_DEFAULT_PHP_FLAVOR - explicitely marks non-default ignored (use in make.conf)
+#
 # You may combine multiple php:* arguments.
 # Don't specify any php:* argument if your port will work with every PHP SAPI.
 #
@@ -128,9 +130,14 @@ IGNORE=	does not work with PHP versions "${IGNORE_WITH_PHP}" and "${_INSTALLED_P
 PHP_VER?=	${PHP_DEFAULT:S/.//}
 .  endif # .if exists(${PHPBASE}/etc/php.conf)
 
+.if defined(BUILD_ONLY_DEFAULT_PHP_FLAVOR)
+# Only build php ports of the default flavor
+_ALL_FLAVOR_VERSIONS=	${PHP_VER}
+.else
 # Use the "default" php version as the first version for flavors, so that it
 # gets to be the default flavor.
 _ALL_FLAVOR_VERSIONS=	${PHP_VER} ${_ALL_PHP_VERSIONS:N${PHP_VER}}
+.endif
 
 # If we want flavors, fill in FLAVORS with the allowed PHP versions, if some
 # cannot be used, or all of them if they all can.
@@ -392,7 +399,6 @@ calendar_DEPENDS=	misc/php${PHP_VER}-calendar
 ctype_DEPENDS=	textproc/php${PHP_VER}-ctype
 curl_DEPENDS=	ftp/php${PHP_VER}-curl
 dba_DEPENDS=	databases/php${PHP_VER}-dba
-dbase_DEPENDS=	databases/php${PHP_VER}-dbase
 dom_DEPENDS=	textproc/php${PHP_VER}-dom
 enchant_DEPENDS=	textproc/php${PHP_VER}-enchant
 exif_DEPENDS=	graphics/php${PHP_VER}-exif
@@ -415,7 +421,6 @@ mbstring_DEPENDS=	converters/php${PHP_VER}-mbstring
 mcrypt_DEPENDS=	security/pecl-mcrypt@${PHP_FLAVOR}
 memcache_DEPENDS=	databases/pecl-memcache@${PHP_FLAVOR}
 memcached_DEPENDS=	databases/pecl-memcached@${PHP_FLAVOR}
-mssql_DEPENDS=	databases/php${PHP_VER}-mssql
 mysqli_DEPENDS=	databases/php${PHP_VER}-mysqli
 odbc_DEPENDS=	databases/php${PHP_VER}-odbc
 opcache_DEPENDS=	www/php${PHP_VER}-opcache
@@ -446,7 +451,6 @@ soap_DEPENDS=	net/php${PHP_VER}-soap
 sockets_DEPENDS=net/php${PHP_VER}-sockets
 sodium_DEPENDS=	security/php${PHP_VER}-sodium
 sqlite3_DEPENDS=databases/php${PHP_VER}-sqlite3
-sybase_ct_DEPENDS=	databases/php${PHP_VER}-sybase_ct
 sysvmsg_DEPENDS=devel/php${PHP_VER}-sysvmsg
 sysvsem_DEPENDS=devel/php${PHP_VER}-sysvsem
 sysvshm_DEPENDS=devel/php${PHP_VER}-sysvshm