Page MenuHomeFreeBSD

D14208.id38895.diff
No OneTemporary

D14208.id38895.diff

Index: Mk/Uses/php.mk
===================================================================
--- Mk/Uses/php.mk
+++ Mk/Uses/php.mk
@@ -16,6 +16,9 @@
# - web : Want the Apache Module or the CGI version of PHP.
# - embed : Want the embedded library version of PHP.
# - pecl : Fetches from PECL.
+# - flavors : Generates flavors for supported versions.
+# (implied by phpize,ext,zend,pecl)
+# - noflavors: Prevents generation of flavor.
#
# If the port requires a predefined set of PHP extensions, they can be
# listed in this way:
@@ -43,7 +46,6 @@
#
# The port can set these options in its Makefile before bsd.port.pre.mk:
#
-# DEFAULT_PHP_VER=N - Use PHP version N if PHP is not yet installed.
# IGNORE_WITH_PHP=N - The port doesn't work with PHP version N.
#
# You may combine multiple WANT_PHP_* knobs.
@@ -58,10 +60,6 @@
_INCLUDE_USES_PHP_MK= yes
-. if defined(DEFAULT_PHP_VER)
-WARNING+= "DEFAULT_PHP_VER is defined, consider using DEFAULT_VERSIONS=php=${DEFAULT_PHP_VER} instead"
-. endif
-
. if defined(USE_PHPIZE) && empty(php_ARGS:Mphpize)
php_ARGS+= phpize
. endif
@@ -84,6 +82,9 @@
. if ${php_ARGS:Mbuild} && ( ${php_ARGS:Mphpize} || ${php_ARGS:Mext} || ${php_ARGS:Mzend} )
DEV_WARNING+= "USES=php:build is included in USES=php:phpize, USES=php:ext, and USES=php:zend, so it is not needed"
. endif
+. if ${php_ARGS:Mflavors} && ( ${php_ARGS:Mphpize} || ${php_ARGS:Mext} || ${php_ARGS:Mzend} || ${php_ARGS:Mpecl} )
+DEV_WARNINGS+= "USES=php:flavors is included in phpize, ext, zend and pecl, so it is not needed."
+. endif
. if ${php_ARGS:Mphpize} && ( ${php_ARGS:Mext} || ${php_ARGS:Mzend} )
DEV_WARNING+= "USES=php:phpize is included in USES=php:ext and USES=php:zend, so it is not needed"
. endif
@@ -94,6 +95,14 @@
DEV_WARNING+= "USES=php:ext is included in USES=php:pecl, so it is not needed"
. endif
+. if ( ${php_ARGS:Mphpize} || ${php_ARGS:Mext} || ${php_ARGS:Mzend} || ${php_ARGS:Mpecl} ) && !${php_ARGS:Mnoflavors}
+php_ARGS+= flavors
+. endif
+
+. if ${php_ARGS:Mnoflavors} && ${php_ARGS:Mflavors}
+php_ARGS:= ${php_ARGS:Nflavors}
+. endif
+
. if ${php_ARGS:Mpecl}
php_ARGS+= ext
EXTRACT_SUFX= .tgz
@@ -103,13 +112,35 @@
. endif
PHPBASE?= ${LOCALBASE}
-. if exists(${PHPBASE}/etc/php.conf)
+
+_ALL_PHP_VERSIONS= 56 70 71 72
+
+DEFAULT_PHP_VER?= ${PHP_DEFAULT:S/.//}
+
+_ALL_FLAVOR_VERSIONS= ${DEFAULT_PHP_VER} ${_ALL_PHP_VERSIONS:N${DEFAULT_PHP_VER}}
+
+. if ${php_ARGS:Mflavors}
+. if empty(FLAVORS)
+. if defined(IGNORE_WITH_PHP)
+. else
+FLAVORS= ${_ALL_FLAVOR_VERSIONS:S/^/php/}
+. endif
+. endif
+. if empty(FLAVOR)
+FLAVOR= ${FLAVORS:[1]}
+. endif
+. endif
+
+. if ${FLAVOR:Mphp[0-9][0-9]}
+PHP_VER= ${FLAVOR:S/^php//}
+. endif
+
+. if exists(${PHPBASE}/etc/php.conf) && !defined(PHP_VER)
.include "${PHPBASE}/etc/php.conf"
. if !defined(PHP_EXT_DIR)
PHP_EXT_DIR!= ${PHPBASE}/bin/php-config --extension-dir | ${SED} -ne 's,^${PHPBASE}/lib/php/\(.*\),\1,p'
. endif
. else
-DEFAULT_PHP_VER?= ${PHP_DEFAULT:S/.//}
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
@@ -148,9 +179,11 @@
PHP_EXT_DIR:= ${PHP_EXT_DIR}-debug
. endif
PHP_SAPI?= ""
-. endif # .if exists(${PHPBASE}/etc/php.conf)
+. endif # .if exists(${PHPBASE}/etc/php.conf) && !${PHP_VER}
PHP_EXT_INC?= ""
+PHP_PKGNAMEPREFIX= php${PHP_VER}-
+
. if defined(IGNORE_WITH_PHP)
. for VER in ${IGNORE_WITH_PHP}
. if ${PHP_VER} == "${VER}"
@@ -220,7 +253,7 @@
GNU_CONFIGURE= yes
CONFIGURE_ARGS+=--with-php-config=${PHPBASE}/bin/php-config
-configure-message: phpize-message do-phpize
+_USES_configure+= 190:phpize-message 250:do-phpize
phpize-message:
@${ECHO_MSG} "===> PHPizing for ${PKGNAME}"
Index: lang/php56/Makefile.ext
===================================================================
--- lang/php56/Makefile.ext
+++ lang/php56/Makefile.ext
@@ -1,6 +1,6 @@
COMMENT= The ${PHP_MODNAME} shared extension for php
-USES+= php:ext
+USES+= php:ext,noflavors
PHP_MODNAME= ${PKGNAMESUFFIX:S/-//}
PHP_VER= 56
IGNORE_WITH_PHP= 70
Index: lang/php70/Makefile.ext
===================================================================
--- lang/php70/Makefile.ext
+++ lang/php70/Makefile.ext
@@ -2,7 +2,7 @@
COMMENT= The ${PHP_MODNAME} shared extension for php
-USES+= php:ext
+USES+= php:ext,noflavors
PHP_MODNAME= ${PKGNAMESUFFIX:S/-//}
PHP_VER= 70
IGNORE_WITH_PHP= 56
Index: lang/php71/Makefile.ext
===================================================================
--- lang/php71/Makefile.ext
+++ lang/php71/Makefile.ext
@@ -2,7 +2,7 @@
COMMENT= The ${PHP_MODNAME} shared extension for php
-USES+= php:ext
+USES+= php:ext,noflavors
PHP_MODNAME= ${PKGNAMESUFFIX:S/-//}
PHP_VER= 71
IGNORE_WITH_PHP= 55 56 70
Index: lang/php72/Makefile.ext
===================================================================
--- lang/php72/Makefile.ext
+++ lang/php72/Makefile.ext
@@ -2,7 +2,7 @@
COMMENT= The ${PHP_MODNAME} shared extension for php
-USES+= php:ext
+USES+= php:ext,noflavors
PHP_MODNAME= ${PKGNAMESUFFIX:S/-//}
PHP_VER= 72
IGNORE_WITH_PHP= 56 70 71
Index: www/php-screw/Makefile
===================================================================
--- www/php-screw/Makefile
+++ www/php-screw/Makefile
@@ -1,11 +1,12 @@
# Created by: Alex Dupre <sysadmin@alexdupre.com>
# $FreeBSD$
-PORTNAME= php-screw
+PORTNAME= screw
PORTVERSION= 1.5
PORTREVISION= 1
CATEGORIES= www security
MASTER_SITES= SF/${PORTNAME}/OldFiles
+PKGNAMEPREFIX= ${PHP_PKGNAMEPREFIX}
DISTNAME= php_screw-${PORTVERSION}
EXTRACT_SUFX= .tgz

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 23, 3:09 PM (17 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26018825
Default Alt Text
D14208.id38895.diff (5 KB)

Event Timeline