diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-23 13:19:17 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-23 13:19:17 +0000 |
commit | 11ca07f4fcf2a494e34f69fa036808af4df23217 (patch) | |
tree | d7078cd69433e0e735b7b9eebd96aa16fdbd9c94 /Mk | |
parent | d911a04f66e99d3f6d32c6f935925eb1e4ab4a1e (diff) | |
download | ports-11ca07f4fcf2a494e34f69fa036808af4df23217.tar.gz ports-11ca07f4fcf2a494e34f69fa036808af4df23217.zip |
Notes
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Uses/php.mk (renamed from Mk/bsd.php.mk) | 187 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 10 |
2 files changed, 101 insertions, 96 deletions
diff --git a/Mk/bsd.php.mk b/Mk/Uses/php.mk index 408c08f23063..68625e4f489f 100644 --- a/Mk/bsd.php.mk +++ b/Mk/Uses/php.mk @@ -1,15 +1,11 @@ +# $FreeBSD$ # -# bsd.php.mk - Support for PHP-based ports. -# -# Created by: Alex Dupre <ale@FreeBSD.org> -# -# For FreeBSD committers: -# Please send all suggested changes to the maintainer instead of committing -# them to SVN yourself. +# Support for PHP-based ports. # -# $FreeBSD$ +# Feature: php +# Usage: USES=php +# Valid ARGS: (none) # -# Adding 'USE_PHP=yes' to a port includes this Makefile after bsd.ports.pre.mk. # If the port requires a predefined set of PHP extensions, they can be # listed in this way: # @@ -35,125 +31,126 @@ # If you are building PHP-based ports in poudriere(8) with ZTS enabled, # add WITH_MPM=event to /etc/make.conf to prevent build failures. -.if !defined(_PHPMKINCLUDED) +.if !defined(_INCLUDE_USES_PHP_MK) PHP_Include_MAINTAINER= ale@FreeBSD.org -_PHPMKINCLUDED= yes +_INCLUDE_USES_PHP_MK= yes .include "${PORTSDIR}/Mk/bsd.default-versions.mk" -.if defined(DEFAULT_PHP_VER) +. if defined(DEFAULT_PHP_VER) WARNING+= "DEFAULT_PHP_VER is defined, consider using DEFAULT_VERSIONS=php=${DEFAULT_PHP_VER} instead" -.endif +. endif PHPBASE?= ${LOCALBASE} -.if exists(${PHPBASE}/etc/php.conf) +. if exists(${PHPBASE}/etc/php.conf) .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' - -.else +. endif +. else DEFAULT_PHP_VER?= ${PHP_DEFAULT:S/.//} # When adding a version, please keep the comment in # Mk/bsd.default-versions.mk in sync. PHP_VER?= ${DEFAULT_PHP_VER} -.if ${PHP_VER} == 70 +. if ${PHP_VER} == 70 PHP_EXT_DIR= 20151012 PHP_EXT_INC= pcre spl -.elif ${PHP_VER} == 56 +. elif ${PHP_VER} == 56 PHP_EXT_DIR= 20131226 PHP_EXT_INC= pcre spl -.elif ${PHP_VER} == 55 +. elif ${PHP_VER} == 55 PHP_EXT_DIR= 20121212 PHP_EXT_INC= pcre spl -.else +. else # (rene) default to DEFAULT_VERSIONS PHP_EXT_DIR= 20131226 PHP_EXT_INC= pcre spl -.endif +. endif HTTPD?= ${LOCALBASE}/sbin/httpd -.if exists(${HTTPD}) +. if exists(${HTTPD}) APACHE_THR!= ${HTTPD} -V | ${GREP} threaded -. if ${APACHE_THR:Myes} +. if ${APACHE_THR:Myes} PHP_EXT_DIR:= ${PHP_EXT_DIR}-zts -. endif -.elif defined(APACHE_PORT) && (${APACHE_PORT:M*worker*} != "" || ${APACHE_PORT:M*event*} != "") +. endif +. elif defined(APACHE_PORT) && (${APACHE_PORT:M*worker*} != "" || ${APACHE_PORT:M*event*} != "") PHP_EXT_DIR:= ${PHP_EXT_DIR}-zts -.elif defined(WITH_MPM) && (${WITH_MPM} == "worker" || ${WITH_MPM} == "event") +. elif defined(WITH_MPM) && (${WITH_MPM} == "worker" || ${WITH_MPM} == "event") PHP_EXT_DIR:= ${PHP_EXT_DIR}-zts -.endif +. endif -.if defined(WITH_DEBUG) +. if defined(WITH_DEBUG) PHP_EXT_DIR:= ${PHP_EXT_DIR}-debug -.endif +. endif PHP_SAPI?= "" -.endif # .if exists(${PHPBASE}/etc/php.conf) +. endif # .if exists(${PHPBASE}/etc/php.conf) PHP_EXT_INC?= "" -.if defined(IGNORE_WITH_PHP) -. for VER in ${IGNORE_WITH_PHP} -. if ${PHP_VER} == "${VER}" +. if defined(IGNORE_WITH_PHP) +. for VER in ${IGNORE_WITH_PHP} +. if ${PHP_VER} == "${VER}" IGNORE= cannot be installed: doesn't work with lang/php${PHP_VER} port\ (doesn't support PHP ${IGNORE_WITH_PHP:C/^5/5./}) -. endif -. endfor -.endif +. endif +. endfor +. endif -.if defined(WANT_PHP_WEB) -. if defined(WANT_PHP_CGI) || defined(WANT_PHP_MOD) +. if defined(WANT_PHP_WEB) +. if defined(WANT_PHP_CGI) || defined(WANT_PHP_MOD) check-makevars:: @${ECHO_CMD} "If you define WANT_PHP_WEB you cannot set also WANT_PHP_CGI" @${ECHO_CMD} "or WANT_PHP_MOD. Use only one of them." @${FALSE} -. endif -.endif +. endif +. endif -.if defined(WANT_PHP_CGI) -. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" +. if defined(WANT_PHP_CGI) +. if defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "" check-makevars:: @${ECHO_CMD} "This port requires the CGI version of PHP, but you have already" @${ECHO_CMD} "installed a PHP port without CGI." @${FALSE} -. endif -.endif +. endif +. endif -.if defined(WANT_PHP_CLI) -. if defined(PHP_VERSION) && ${PHP_SAPI:Mcli} == "" +. if defined(WANT_PHP_CLI) +. if defined(PHP_VERSION) && ${PHP_SAPI:Mcli} == "" check-makevars:: @${ECHO_CMD} "This port requires the CLI version of PHP, but you have already" @${ECHO_CMD} "installed a PHP port without CLI." @${FALSE} -. endif -.endif +. endif +. endif -.if defined(WANT_PHP_EMB) -. if defined(PHP_VERSION) && ${PHP_SAPI:Membed} == "" +. if defined(WANT_PHP_EMB) +. if defined(PHP_VERSION) && ${PHP_SAPI:Membed} == "" check-makevars:: @${ECHO_CMD} "This port requires the embedded library version of PHP, but you have already" @${ECHO_CMD} "installed a PHP port without the embedded library." @${FALSE} -. endif -.endif +. endif +. endif PHP_PORT?= lang/php${PHP_VER} MOD_PHP_PORT?= www/mod_php${PHP_VER} -.if defined(USE_PHP_BUILD) +. if defined(USE_PHP_BUILD) BUILD_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} -.endif +. endif RUN_DEPENDS+= ${PHPBASE}/include/php/main/php.h:${PHP_PORT} -.if defined(WANT_PHP_MOD) || (defined(WANT_PHP_WEB) && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "") +. if defined(WANT_PHP_MOD) || (defined(WANT_PHP_WEB) && defined(PHP_VERSION) && ${PHP_SAPI:Mcgi} == "" && ${PHP_SAPI:Mfpm} == "") USE_APACHE_RUN= 22+ .include "${PORTSDIR}/Mk/bsd.apache.mk" RUN_DEPENDS+= ${PHPBASE}/${APACHEMODDIR}/libphp5.so:${MOD_PHP_PORT} -.endif +. endif PLIST_SUB+= PHP_EXT_DIR=${PHP_EXT_DIR} SUB_LIST+= PHP_EXT_DIR=${PHP_EXT_DIR} -.if defined(USE_PHPIZE) || defined(USE_PHPEXT) || defined(USE_ZENDEXT) +. if defined(USE_PHPIZE) || defined(USE_PHPEXT) || defined(USE_ZENDEXT) BUILD_DEPENDS+= ${PHPBASE}/bin/phpize:${PHP_PORT} GNU_CONFIGURE= yes USE_AUTOTOOLS+= autoconf:env @@ -166,11 +163,16 @@ phpize-message: do-phpize: @(cd ${WRKSRC}; ${SETENV} ${SCRIPTS_ENV} ${PHPBASE}/bin/phpize) -.endif +. endif +_USES_POST+=php .endif -.if defined(_POSTMKINCLUDED) && (defined(USE_PHPEXT) || defined(USE_ZENDEXT)) +.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PHP_POST_MK) + +_INCLUDE_USES_PHP_POST_MK=yes + +. if (defined(USE_PHPEXT) || defined(USE_ZENDEXT)) PHP_MODNAME?= ${PORTNAME} PHP_HEADER_DIRS?= "" @@ -178,11 +180,11 @@ do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} @${INSTALL_LIB} ${WRKSRC}/modules/${PHP_MODNAME}.so \ ${STAGEDIR}${PREFIX}/lib/php/${PHP_EXT_DIR} -. for header in . ${PHP_HEADER_DIRS} +. for header in . ${PHP_HEADER_DIRS} @${MKDIR} ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} @${INSTALL_DATA} ${WRKSRC}/${header}/*.h \ ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/${header} -. endfor +. endfor @${RM} -f ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h @${GREP} "#define \(COMPILE\|HAVE\|USE\)_" ${WRKSRC}/config.h \ > ${STAGEDIR}${PREFIX}/include/php/ext/${PHP_MODNAME}/config.h @@ -204,22 +206,22 @@ add-plist-phpext: >> ${TMPPLIST} @${ECHO_CMD} "@dir etc/php" \ >> ${TMPPLIST} -.if defined(USE_ZENDEXT) +. if defined(USE_ZENDEXT) @${ECHO_CMD} "@exec echo zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ >> ${TMPPLIST} -.else +. else @${ECHO_CMD} "@exec echo extension=${PHP_MODNAME}.so >> %D/etc/php/extensions.ini" \ >> ${TMPPLIST} -.endif +. endif @${ECHO_CMD} "@unexec cp %D/etc/php/extensions.ini %D/etc/php/extensions.ini.orig" \ >> ${TMPPLIST} -.if defined(USE_ZENDEXT) +. if defined(USE_ZENDEXT) @${ECHO_CMD} "@unexec grep -v zend_extension=%D/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}\\\.so %D/etc/php/extensions.ini.orig > %D/etc/php/extensions.ini || true" \ >> ${TMPPLIST} -.else +. else @${ECHO_CMD} "@unexec grep -v extension=${PHP_MODNAME}\\\.so %D/etc/php/extensions.ini.orig > %D/etc/php/extensions.ini || true" \ >> ${TMPPLIST} -.endif +. endif @${ECHO_CMD} "@unexec rm %D/etc/php/extensions.ini.orig" \ >> ${TMPPLIST} @${ECHO_CMD} "@unexec [ -s %D/etc/php/extensions.ini ] || rm %D/etc/php/extensions.ini" \ @@ -233,17 +235,17 @@ php-ini: @${ECHO_CMD} "The following line has been added to your ${PREFIX}/etc/php/extensions.ini" @${ECHO_CMD} "configuration file to automatically load the installed extension:" @${ECHO_CMD} "" -.if defined(USE_ZENDEXT) +. if defined(USE_ZENDEXT) @${ECHO_CMD} "zend_extension=${PREFIX}/lib/php/${PHP_EXT_DIR}/${PHP_MODNAME}.so" -.else +. else @${ECHO_CMD} "extension=${PHP_MODNAME}.so" -.endif +. endif @${ECHO_CMD} "" @${ECHO_CMD} "****************************************************************************" -.endif +. endif # Extensions -.if defined(_POSTMKINCLUDED) && ${USE_PHP:tl} != "yes" +. if ${USE_PHP:tl} != "yes" # non-version specific components _USE_PHP_ALL= apc bcmath bitset bz2 calendar ctype curl dba dom \ exif fileinfo filter ftp gd gettext gmp \ @@ -261,11 +263,11 @@ _USE_PHP_VER70= ${_USE_PHP_ALL} apc_DEPENDS= www/pecl-APC bcmath_DEPENDS= math/php${PHP_VER}-bcmath -.if ${PHP_VER} == 70 +. if ${PHP_VER} == 70 bitset_DEPENDS= math/pecl-bitset -.else +. else bitset_DEPENDS= math/pecl-bitset2 -.endif +. endif bz2_DEPENDS= archivers/php${PHP_VER}-bz2 calendar_DEPENDS= misc/php${PHP_VER}-calendar ctype_DEPENDS= textproc/php${PHP_VER}-ctype @@ -285,11 +287,11 @@ iconv_DEPENDS= converters/php${PHP_VER}-iconv igbinary_DEPENDS= converters/pecl-igbinary imap_DEPENDS= mail/php${PHP_VER}-imap interbase_DEPENDS= databases/php${PHP_VER}-interbase -.if ${PHP_VER} == 70 +. if ${PHP_VER} == 70 intl_DEPENDS= devel/php${PHP_VER}-intl -.else +. else intl_DEPENDS= devel/pecl-intl -.endif +. endif json_DEPENDS= devel/php${PHP_VER}-json ldap_DEPENDS= net/php${PHP_VER}-ldap mbstring_DEPENDS= converters/php${PHP_VER}-mbstring @@ -344,26 +346,27 @@ xsl_DEPENDS= textproc/php${PHP_VER}-xsl zip_DEPENDS= archivers/php${PHP_VER}-zip zlib_DEPENDS= archivers/php${PHP_VER}-zlib -. for extension in ${USE_PHP} -. if ${_USE_PHP_VER${PHP_VER}:M${extension}} != "" -. if ${PHP_EXT_INC:M${extension}} == "" -. if defined(USE_PHP_BUILD) +. for extension in ${USE_PHP} +. if ${_USE_PHP_VER${PHP_VER}:M${extension}} != "" +. if ${PHP_EXT_INC:M${extension}} == "" +. if defined(USE_PHP_BUILD) BUILD_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${${extension}_DEPENDS} -. endif +. endif RUN_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/${extension}.so:${${extension}_DEPENDS} -. endif -. else +. endif +. else ext= ${extension} -. if ${ext} == "mhash" -. if defined(USE_PHP_BUILD) +. if ${ext} == "mhash" +. if defined(USE_PHP_BUILD) BUILD_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/hash.so:${hash_DEPENDS} -. endif +. endif RUN_DEPENDS+= ${PHPBASE}/lib/php/${PHP_EXT_DIR}/hash.so:${hash_DEPENDS} -. elif ${ext:tl} != "yes" +. elif ${ext:tl} != "yes" check-makevars:: @${ECHO_CMD} "Unknown extension ${extension} for PHP ${PHP_VER}." @${FALSE} -. endif -. endif -. endfor +. endif +. endif +. endfor +. endif .endif diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 0f08760d3164..26dc1146867f 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1359,8 +1359,9 @@ PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg .include "${PORTSDIR}/Mk/bsd.emacs.mk" .endif -.if defined(USE_PHP) -.include "${PORTSDIR}/Mk/bsd.php.mk" +.if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp} )) +DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php" +USES+= php .endif .if defined(USE_FPC) || defined(WANT_FPC_BASE) || defined(WANT_FPC_ALL) @@ -1919,8 +1920,9 @@ _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \ .include "${PORTSDIR}/Mk/bsd.sdl.mk" .endif -.if defined(USE_PHP) -.include "${PORTSDIR}/Mk/bsd.php.mk" +.if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp} )) +DEV_WARNING+= "Using USE_PHP alone is deprecated, please use USES=php" +_USES_POST+= php .endif .if defined(USE_WX) || defined(USE_WX_NOT) |