From owner-dev-commits-ports-main@freebsd.org Tue Apr 6 10:14:49 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 975B15C8AF8; Tue, 6 Apr 2021 10:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FF3L13sSrz4QxS; Tue, 6 Apr 2021 10:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77ABB1C78; Tue, 6 Apr 2021 10:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 136AEn7N057840; Tue, 6 Apr 2021 10:14:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 136AEntm057839; Tue, 6 Apr 2021 10:14:49 GMT (envelope-from git) Date: Tue, 6 Apr 2021 10:14:49 GMT Message-Id: <202104061014.136AEntm057839@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 91fdbed77603 - main - lang/php80: Adding MySQL 8.0 'caching_sha2_password' support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91fdbed776033fd4b210135429a171ab5fed549b Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2021 10:14:49 -0000 The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=91fdbed776033fd4b210135429a171ab5fed549b commit 91fdbed776033fd4b210135429a171ab5fed549b Author: Muhammad Moinur Rahman AuthorDate: 2021-04-06 10:06:56 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2021-04-06 10:14:41 +0000 lang/php80: Adding MySQL 8.0 'caching_sha2_password' support - Pet portlint - Add non-default OPTION MYSQL80 This patch adds an OPTION for adding 'caching_sha2_password' (Default Password mechanism in MySQL >= 8.0) in php80. If the OPTION MYSQL80 is selected it will build openssl module with base PHP including mysqlnd. This will also prevent php80-openssl module from being installed in the future. php80-mysqli and php80-pdo_mysql will use mysqlnd. PR: 252420 Reported by: sean@rogue-research.com Approved by: tz Sponsored by: Bounce Experts Differential Revision: https://reviews.freebsd.org/D29491 --- lang/php80/Makefile | 29 +++++++++++++++++++++++++---- lang/php80/Makefile.ext | 10 ++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lang/php80/Makefile b/lang/php80/Makefile index c9b0f4d04d8e..70e4af93259a 100644 --- a/lang/php80/Makefile +++ b/lang/php80/Makefile @@ -4,7 +4,7 @@ PORTNAME= php80 DISTVERSION= 8.0.3 PORTREVISION?= 0 CATEGORIES?= lang devel www -MASTER_SITES= PHP/distributions +MASTER_SITES= PHP/distributions DISTNAME= php-${DISTVERSION} MAINTAINER= tz@FreeBSD.org @@ -27,14 +27,14 @@ CONFIGURE_ARGS+=--with-layout=GNU \ --with-libxml \ --with-password-argon2=${LOCALBASE} \ --program-prefix="" -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" +CPPFLAGS= -I${LOCALBASE}/include USES+= autoreconf:build USE_GNOME= libxml2 # PR230207 Allow relocations against read-only segments (override lld default) LDFLAGS_i386= -Wl,-z,notext -OPTIONS_DEFINE+=CLI CGI FPM EMBED PHPDBG DEBUG DTRACE IPV6 MYSQLND LINKTHR ZTS +OPTIONS_DEFINE+=CLI CGI FPM EMBED PHPDBG DEBUG DTRACE IPV6 MYSQLND MYSQL80 LINKTHR ZTS OPTIONS_DEFAULT=CLI CGI FPM EMBED MYSQLND LINKTHR DTRACE OPTIONS_EXCLUDE_DragonFly= DTRACE # ld(1) fails to link probes: Relocations in generic ELF (EM: 0) @@ -58,9 +58,17 @@ FPM_DESC= Build FPM version EMBED_DESC= Build embedded library PHPDBG_DESC= Interactive PHP debugger MYSQLND_DESC= Build with MySQL Native Driver +MYSQL80_DESC= Build with MySQL caching password mechanism LINKTHR_DESC= Link thread lib (for threaded extensions) ZTS_DESC= Force Zend Thread Safety (ZTS) build +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 +MYSQL80_USES= ssl + CONFLICTS= php72-* php73-* php74-* DESTDIRNAME= INSTALL_ROOT @@ -152,6 +160,14 @@ PLIST_SUB+= DTRACE="@comment " CONFIGURE_ARGS+=--disable-ipv6 .endif +.if ${PORT_OPTIONS:MMYSQL80} +WARNING= "PHP is now built with MySQL 8.0 support which has caching password mechanism. \ + This implies php80-openssl module. Hence php80-openssl can no longer be \ + installed alongside with php80. If you require php80-openssl module please \ + rebuild php80 with MYSQL80 OPTION disabled. Otherwise remove php80-openssl \ + DEPENDENCY from ports." +.endif + post-patch: @${TOUCH} ${WRKSRC}/ext/php_config.h @${REINPLACE_CMD} "s|^\(extension_dir\)|; \1|" ${WRKSRC}/php.ini-* @@ -168,10 +184,15 @@ post-build: @${ECHO_CMD} "PHP_VER=80" > ${WRKDIR}/php.conf @${ECHO_CMD} "PHP_VERSION=${PORTVERSION}" >> ${WRKDIR}/php.conf @${ECHO_CMD} "PHP_SAPI=${PHP_SAPI}" >> ${WRKDIR}/php.conf - @${ECHO_CMD} "PHP_EXT_INC=hash json pcre spl" >> ${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 @(cd ${WRKSRC} && ${MAKE} test) diff --git a/lang/php80/Makefile.ext b/lang/php80/Makefile.ext index bafb34446ef5..e8764dca70f5 100644 --- a/lang/php80/Makefile.ext +++ b/lang/php80/Makefile.ext @@ -534,6 +534,16 @@ CONFIGURE_ARGS+=--disable-mbregex . endif .endif +.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" post-extract: @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4