summaryrefslogtreecommitdiff
path: root/lang/php81
diff options
context:
space:
mode:
authorMuhammad Moinur Rahman <bofh@FreeBSD.org>2022-02-12 09:38:24 -0600
committerMuhammad Moinur Rahman <bofh@FreeBSD.org>2022-02-12 09:41:51 -0600
commite8d9493812a510f7c1cc94632836e1d5731de250 (patch)
treef337293805bd65725a6bd62da592e11a9668b955 /lang/php81
parent72923f58ba52b846c681aa7262eb161b6152b062 (diff)
downloadfreebsd-ports-e8d9493812a510f7c1cc94632836e1d5731de250.zip
lang/php8[01]: Make openssl as DEFAULT
After the 91fdbed776033fd4b210135429a171ab5fed549b commit fixing the issue for MySQL80 introduced another problem for the ports that depends on php8[01]-openssl port couldn't be built as the fix prevented php8[01]-openssl from being installed as it's already built with default php installation. As the problem has grown much bigger now and php80 is currently the DEFAULT php version so we are switching the behavior of php8[01] ports making the openssl module as default. - Remove non-default OPTION MYSQL80 from lang/php8[01] - Remove ports security/php8[01]-openssl - Remove OPTION OPENSSL from lang/php8[01]-extensions - Mark lang/php8[01] to IGNORE with libressl and libressl-devel Although php builds fine with those most of the extensions do not as they have dependency on curl. So mark it early. - OPTIONIZE lang/php80 - Change openssl_DEPENDS to conditional for php74 only as this module is default from php80 with this commit. php74 do not have the issue where it fails to connect to MySQL80 due to new caching_sha2_password - Remove hash_DEPENDS from php.mk as it is a default module for all php - Change json_DEPENDS to conditional for php74 only as this module is default from php80 PR: 261797 259793 252420 Reported by: sean@rogue-research.com martin@waschbuesch.de Approved by: tz (private email) ale (private email) Sponsored by: Bounce Experts
Diffstat (limited to 'lang/php81')
-rw-r--r--lang/php81/Makefile66
1 files changed, 20 insertions, 46 deletions
diff --git a/lang/php81/Makefile b/lang/php81/Makefile
index 4206fea49ec7..e0d59649dad0 100644
--- a/lang/php81/Makefile
+++ b/lang/php81/Makefile
@@ -1,6 +1,6 @@
PORTNAME= php81
DISTVERSION= 8.1.2
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES?= lang devel www
MASTER_SITES= PHP/distributions
DISTNAME= php-${DISTVERSION}
@@ -11,6 +11,10 @@ COMMENT= PHP Scripting Language (8.1.X branch)
LICENSE= PHP301
USES+= compiler:c11 cpe gnome pkgconfig tar:xz
+# Although php builds fine with libressl* but most of the php modules
+# require curl which fails to build with libressl*. So do an early
+# check and prevent php from being built with libressl*
+IGNORE_SSL= libressl libressl-devel
CPE_PRODUCT= php
PHP_VER= 81
@@ -26,19 +30,21 @@ CONFIGURE_ARGS+= --disable-all \
--with-config-file-scan-dir=${PREFIX}/etc/php \
--with-layout=GNU \
--with-libxml \
+ --with-openssl \
--with-password-argon2=${LOCALBASE}
DESTDIRNAME= INSTALL_ROOT
-USES+= autoreconf:build
+USES+= autoreconf:build ssl
USE_GNOME= libxml2
CPPFLAGS= -I${LOCALBASE}/include
+LDFLAGS= -L${OPENSSLLIB} -lcrypto -lssl
# PR230207 Allow relocations against read-only segments (override lld default)
LDFLAGS_i386= -Wl,-z,notext
OPTIONS_DEFINE+= CGI CLI DEBUG DTRACE EMBED FPM IPV6 LINKTHR \
- MYSQL80 MYSQLND PHPDBG ZTS
+ MYSQLND PHPDBG ZTS
OPTIONS_DEFAULT= CGI CLI DTRACE EMBED FPM LINKTHR MYSQLND
OPTIONS_EXCLUDE_DragonFly= DTRACE
# ld(1) fails to link probes: Relocations in generic ELF (EM: 0)
@@ -62,7 +68,6 @@ CLI_DESC= Build CLI version
EMBED_DESC= Build embedded library
FPM_DESC= Build FPM version
LINKTHR_DESC= Link thread lib (for threaded extensions)
-MYSQL80_DESC= Build with MySQL caching password mechanism
MYSQLND_DESC= Build with MySQL Native Driver
PHPDBG_DESC= Interactive PHP debugger
ZTS_DESC= Force Zend Thread Safety (ZTS) build
@@ -82,12 +87,6 @@ FPM_VARS= PHP_SAPI+=fpm \
USE_RC_SUBR+=php-fpm
IPV6_CONFIGURE_OFF= --disable-ipv6
LINKTHR_LIBS= -lpthread
-MYSQL80_USES= ssl
-MYSQL80_CONFIGURE_ON= --with-openssl
-MYSQL80_CONFIGURE_ENV= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
- OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" \
- PHP_OPENSSL=no
-MYSQL80_LDFLAGS= -L${OPENSSLLIB} -lcrypto -lssl
MYSQLND_CONFIGURE_ON= --enable-mysqlnd
PHPDBG_CONFIGURE_ON= --enable-phpdbg
PHPDBG_VARS= PHP_SAPI+=phpdbg
@@ -126,11 +125,10 @@ PLIST_SUB+= SAPI_INC="@comment "
.endif
CONFIGURE_ENV+= ac_cv_decimal_fp_supported="no" \
- lt_cv_path_SED="sed"
-
-.if ${PORT_OPTIONS:MMYSQL80}
-WARNING= "PHP is now built with MySQL 8.0 support which has caching password mechanism. This implies ${PORTNAME}-openssl module. Hence ${PORTNAME}-openssl can no longer be installed alongside with ${PORTNAME}. If you require ${PORTNAME}-openssl module please rebuild ${PORTNAME} with MYSQL80 OPTION disabled. Otherwise remove ${PORTNAME}-openssl DEPENDENCY from ports."
-.endif
+ lt_cv_path_SED="sed" \
+ OPENSSL_CFLAGS="-I${OPENSSLINC}" \
+ OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" \
+ PHP_OPENSSL=yes
post-patch:
@${TOUCH} ${WRKSRC}/ext/php_config.h
@@ -150,11 +148,6 @@ post-build:
@${ECHO_CMD} "PHP_SAPI=${PHP_SAPI}" >> ${WRKDIR}/php.conf
@${ECHO_CMD} -n "PHP_EXT_DIR=" >> ${WRKDIR}/php.conf
@${SH} ${WRKSRC}/scripts/php-config --extension-dir | ${SED} -ne 's,^${PREFIX}/lib/php/,,p' >> ${WRKDIR}/php.conf
-
-post-build-MYSQL80-off:
- @${ECHO_CMD} "PHP_EXT_INC=hash json pcre spl" >> ${WRKDIR}/php.conf
-
-post-build-MYSQL80-on:
@${ECHO_CMD} "PHP_EXT_INC=hash json openssl pcre spl" >> ${WRKDIR}/php.conf
test: build
@@ -281,8 +274,7 @@ CONFIGURE_ARGS+= --enable-filter
CONFIGURE_ARGS+= --enable-ftp
CONFIGURE_ENV+= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
- OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" \
- PHP_OPENSSL=yes
+ OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
USES+= pkgconfig ssl
@@ -345,9 +337,8 @@ CONFIGURE_ARGS+= --with-imap-ssl=${OPENSSLBASE} \
--with-imap=${LOCALBASE}
CONFIGURE_ENV+= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
- OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto" \
- PHP_OPENSSL=yes
-
+ OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
+
LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
USES+= ssl
.endif
@@ -389,7 +380,7 @@ OPTIONS_DEFINE= MYSQLND
OPTIONS_DEFAULT= MYSQLND
MYSQLND_DESC= Use MySQL Native Driver
-MYSQLND_CONFIGURE_ARGS= --with-mysqli=mysqlnd
+MYSQLND_CONFIGURE_ON= --with-mysqli=mysqlnd
MYSQLND_CONFIGURE_OFF= --with-mysqli=${LOCALBASE}/bin/mysql_config
MYSQLND_USES_OFF= mysql
.endif
@@ -401,13 +392,6 @@ CONFIGURE_ARGS+= --enable-odbc \
--with-unixODBC=${LOCALBASE}
.endif
-.if ${PHP_MODNAME} == "openssl"
-USES+= ssl
-CONFIGURE_ARGS+= --with-openssl
-CONFIGURE_ENV+= OPENSSL_CFLAGS="-I${OPENSSLINC}" \
- OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"
-.endif
-
.if ${PHP_MODNAME} == "opcache"
# This is needed by Zend extensions, keep before everything.
PHP_MOD_PRIO= 10
@@ -453,10 +437,11 @@ OPTIONS_DEFINE= MYSQLND
OPTIONS_DEFAULT= MYSQLND
MYSQLND_DESC= Use MySQL Native Driver
+
MYSQLND_CONFIGURE_OFF= --with-pdo-mysql=${LOCALBASE} \
--with-zlib-dir=/usr
-MYSQLND_CONFIGURE_ON= --with-pdo-mysql=mysqlnd
MYSQLND_USES_OFF= mysql
+MYSQLND_CONFIGURE_ON= --with-pdo-mysql=mysqlnd
USE_PHP= pdo:build
.endif
@@ -626,18 +611,7 @@ USES+= pkgconfig
.include <bsd.port.pre.mk>
-.if ${PHP_MODNAME} == "openssl"
-post-stage:
- @if ${PREFIX}/bin/php -m | grep openssl 2>/dev/null && ( [ ! -f ${PREFIX}/etc/php/ext-20-openssl.ini ] && [ ! -f ${PREFIX}/etc/php/ext-30-openssl.ini ] ); then \
- ${ECHO_CMD}; \
- ${ECHO_MSG} "===> ${PKGNAME} "openssl module is already built with php base.; \
- ${ECHO_CMD}; \
- ${FALSE}; \
- fi
-.endif
-
-.if ${PHP_MODNAME} == "openssl" || ${PHP_MODNAME} == "sqlite3" || ${PHP_MODNAME} == \
- "zlib"
+.if ${PHP_MODNAME} == "sqlite3" || ${PHP_MODNAME} == "zlib"
post-extract:
@${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
.endif