Commit e8d94938 authored by Muhammad Moinur Rahman's avatar Muhammad Moinur Rahman
Browse files

lang/php8[01]: Make openssl as DEFAULT

After the 91fdbed7 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
parent 72923f58
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16889,3 +16889,5 @@ security/rubygem-devise-two-factor-rails60|security/rubygem-devise-two-factor-ra
korean/nanumcoding-ttf|korean/nanum-gothic-coding|2022-02-10|Renamed to match upstream naming
korean/nanumfonts-otf|korean/nanumfonts|2022-02-10|Split into multiple ports, use korean/nanumfonts meta-port instead
korean/nanumfonts-ttf|korean/nanumfonts|2022-02-10|Split into multiple ports, use korean/nanumfonts meta-port instead
security/php80-openssl||2022-02-12|php80-openssl module is a default module for lang/php80 from now on
security/php81-openssl||2022-02-12|php81-openssl module is a default module for lang/php81 from now on
+7 −4
Original line number Diff line number Diff line
@@ -178,17 +178,17 @@ PHP_VER= ${FLAVOR:S/^php//}
# Mk/bsd.default-versions.mk in sync.
.    if ${PHP_VER} == 81
PHP_EXT_DIR=   20210902
PHP_EXT_INC=    hash json pcre spl
PHP_EXT_INC=    hash json openssl pcre spl
.    elif ${PHP_VER} == 80
PHP_EXT_DIR=   20200930
PHP_EXT_INC=    hash json pcre spl
PHP_EXT_INC=    hash json openssl pcre spl
.    elif ${PHP_VER} == 74
PHP_EXT_DIR=   20190902
PHP_EXT_INC=    hash pcre spl
.    else
# (rene) default to DEFAULT_VERSIONS
PHP_EXT_DIR=   20200930
PHP_EXT_INC=    hash json pcre spl
PHP_EXT_INC=    hash json openssl pcre spl
.    endif

# Try to figure out what the PHP_EXT_DIR should be WRT the
@@ -403,12 +403,13 @@ ftp_DEPENDS= ftp/php${PHP_VER}-ftp
gd_DEPENDS=	graphics/php${PHP_VER}-gd
gettext_DEPENDS=devel/php${PHP_VER}-gettext
gmp_DEPENDS=	math/php${PHP_VER}-gmp
hash_DEPENDS=	security/php${PHP_VER}-hash
iconv_DEPENDS=	converters/php${PHP_VER}-iconv
igbinary_DEPENDS=	converters/pecl-igbinary@${PHP_FLAVOR}
imap_DEPENDS=	mail/php${PHP_VER}-imap
intl_DEPENDS=	devel/php${PHP_VER}-intl
.if ${PHP_VER} < 80
json_DEPENDS=	devel/php${PHP_VER}-json
.endif
ldap_DEPENDS=	net/php${PHP_VER}-ldap
mbstring_DEPENDS=	converters/php${PHP_VER}-mbstring
mcrypt_DEPENDS=	security/pecl-mcrypt@${PHP_FLAVOR}
@@ -418,7 +419,9 @@ 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
.if ${PHP_VER} < 80
openssl_DEPENDS=security/php${PHP_VER}-openssl
.endif
pcntl_DEPENDS=	devel/php${PHP_VER}-pcntl
pdf_DEPENDS=	print/pecl-pdflib@${PHP_FLAVOR}
pdo_DEPENDS=	databases/php${PHP_VER}-pdo
+12 −0
Original line number Diff line number Diff line
@@ -5,6 +5,18 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20220212:
  AFFECTS: users of lang/php8[01][-extensions]?
  AUTHOR: bofh@FreeBSD.org
  Non-Default OPTION MYSQL80 has been removed in lieu of making
  php8[01]-openssl as part of DEFAULT php8[01] installation. Although
  for php74 it is not the case. Ports that depends on
  security/php8[01]-openssl will no longer be installed as these have
  been removed. There is no side effect of this for ports which have
  USE_PHP=openssl. In case for php74 as the default php74-openssl will
  be installed otherwise it will be used from php installation.
20220207:
  AFFECTS: users of security/amavisd-new
  AUTHOR: flo@FreeBSD.org
+3 −5
Original line number Diff line number Diff line
PORTNAME=	php80
PORTVERSION=	1.0
PORTVERSION=	1.1
CATEGORIES=	lang
PKGNAMESUFFIX=	-extensions

@@ -12,9 +12,8 @@ IGNORE_WITH_PHP= 74 81

OPTIONS_DEFINE=	BCMATH BZ2 CALENDAR CTYPE CURL DBA \
		DOM ENCHANT EXIF FILEINFO FILTER FTP GD GETTEXT \
		GMP ICONV INTL IMAP LDAP MBSTRING \
		MYSQLI \
		ODBC OPCACHE OPENSSL PCNTL PDO PDO_DBLIB PDO_FIREBIRD \
		GMP ICONV INTL IMAP LDAP MBSTRING MYSQLI \
		ODBC OPCACHE PCNTL PDO PDO_DBLIB PDO_FIREBIRD \
		PDO_MYSQL PDO_ODBC PDO_PGSQL PDO_SQLITE PGSQL PHAR POSIX \
		PSPELL READLINE SESSION SHMOP SIMPLEXML SNMP SOAP \
		SOCKETS SODIUM SQLITE3 SYSVMSG SYSVSEM SYSVSHM \
@@ -44,7 +43,6 @@ MBSTRING_DESC= multibyte string support
MYSQLI_DESC=		MySQLi database support
ODBC_DESC=		ODBC support
OPCACHE_DESC=		OPcache support
OPENSSL_DESC=		OpenSSL support
PCNTL_DESC=		pcntl support (CLI only)
PDO_DESC=		PHP Data Objects Interface (PDO)
PDO_DBLIB_DESC=		PDO DBLIB-DB driver
+19 −28
Original line number Diff line number Diff line
PORTNAME=	php80
DISTVERSION=	8.0.15
PORTREVISION?=	0
PORTREVISION?=	1
CATEGORIES?=	lang devel www
MASTER_SITES=	PHP
DISTNAME=	php-${DISTVERSION}
@@ -12,6 +12,10 @@ COMMENT= PHP Scripting Language
LICENSE=	PHP301

USES+=		compiler:c11 tar:xz cpe gnome pkgconfig
# 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

CONFLICTS_INSTALL?=	php[0-9][0-9]${PKGNAMESUFFIX}
@@ -21,20 +25,24 @@ LIB_DEPENDS= libpcre2-8.so:devel/pcre2 \
		libargon2.so:security/libargon2

GNU_CONFIGURE=	yes
CONFIGURE_ARGS+=--with-layout=GNU \
		--with-config-file-scan-dir=${PREFIX}/etc/php \
CONFIGURE_ARGS+=	\
		--disable-all \
		--program-prefix="" \
		--with-config-file-scan-dir=${PREFIX}/etc/php \
		--with-layout=GNU \
		--with-libxml \
		--with-password-argon2=${LOCALBASE} \
		--program-prefix=""
USES+=		autoreconf:build
		--with-openssl \
		--with-password-argon2=${LOCALBASE}

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+=CLI CGI FPM EMBED PHPDBG DEBUG DTRACE IPV6 MYSQLND MYSQL80 LINKTHR ZTS
OPTIONS_DEFINE+=CLI CGI FPM EMBED PHPDBG DEBUG DTRACE IPV6 MYSQLND 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,7 +66,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
@@ -77,12 +84,6 @@ FPM_CONFIGURE_ON=--enable-fpm \
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
@@ -123,15 +124,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 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
		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
@@ -151,11 +147,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
Loading