diff options
author | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2022-02-12 15:38:24 +0000 |
---|---|---|
committer | Muhammad Moinur Rahman <bofh@FreeBSD.org> | 2022-02-12 15:41:51 +0000 |
commit | e8d9493812a510f7c1cc94632836e1d5731de250 (patch) | |
tree | f337293805bd65725a6bd62da592e11a9668b955 /lang/php80 | |
parent | 72923f58ba52b846c681aa7262eb161b6152b062 (diff) | |
download | ports-e8d9493812a510f7c1cc94632836e1d5731de250.tar.gz 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/php80')
-rw-r--r-- | lang/php80/Makefile | 47 | ||||
-rw-r--r-- | lang/php80/Makefile.ext | 173 |
2 files changed, 63 insertions, 157 deletions
diff --git a/lang/php80/Makefile b/lang/php80/Makefile index 940c5d9d106e..6049b8ee56c0 100644 --- a/lang/php80/Makefile +++ b/lang/php80/Makefile @@ -1,6 +1,6 @@ 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 diff --git a/lang/php80/Makefile.ext b/lang/php80/Makefile.ext index a1c1228785f4..1ec7953be95e 100644 --- a/lang/php80/Makefile.ext +++ b/lang/php80/Makefile.ext @@ -3,7 +3,7 @@ COMMENT= The ${PHP_MODNAME} shared extension for php USES+= php:ext,noflavors PHP_MODNAME= ${PKGNAMESUFFIX:S/-//} PHP_VER= 80 -IGNORE_WITH_PHP= 72 73 74 +IGNORE_WITH_PHP= 74 81 EXTSUBDIR= ${DISTNAME}/ext/${PHP_MODNAME} WRKSRC= ${WRKDIR}/${EXTSUBDIR} @@ -52,6 +52,21 @@ INIFILE_DESC= INI file support FLATFILE_DESC= flatfile support LMDB_DESC= LMDB database support +CDB_CONFIGURE_OFF=--without-cdb +DB4_CONFIGURE_ON=--with-db4=${LOCALBASE} +DB4_USES= bdb +DB4_VARS= WITH_BDB_HIGHEST=yes +FLATFILE_CONFIGURE_OFF=--disable-flatfile +GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm +GDBM_CONFIGURE_ON=--with-gdbm=${LOCALBASE} +INIFILE_CONFIGURE_OFF=--disable-inifile +LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb +LMDB_CONFIGURE_ON= --with-lmdb=${LOCALBASE} +QDBM_LIB_DEPENDS= libqdbm.so:databases/qdbm +QDBM_CONFIGURE_ON=--with-qdbm=${LOCALBASE} +TOKYO_LIB_DEPENDS= libtokyocabinet.so:databases/tokyocabinet +TOKYO_CONFIGURE_ON=--with-tcadb=${LOCALBASE} + PHP_HEADER_DIRS= libcdb libflatfile libinifile .endif @@ -94,8 +109,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+= ssl pkgconfig @@ -120,6 +134,12 @@ JIS_DESC= Enable JIS-mapped Japanese font support WEBP_DESC= Enable WebP image format support X11_DESC= Enable XPM support +JIS_CONFIGURE_ON=--enable-gd-jis-conv +WEBP_CONFIGURE_ON=--with-webp +WEBP_LIB_DEPENDS= libwebp.so:graphics/webp +X11_USES= xorg +X11_USE= XORG=xpm +X11_CONFIGURE_ON=--with-xpm .endif .if ${PHP_MODNAME} == "gettext" @@ -148,13 +168,15 @@ OPTIONS_DEFAULT=PANDA CCLIENT_DESC= Uses the original but unmaintained cclient PANDA_DESC= Uses the forked panda-cclient instead of the original cclient +PANDA_LIB_DEPENDS= libc-client4.so.10:mail/panda-cclient +PANDA_LIB_DEPENDS_OFF= libc-client4.so.9:mail/cclient + CONFIGURE_ARGS+=--with-imap=${LOCALBASE} \ --with-pcre-dir=${LOCALBASE} \ --with-imap-ssl=${OPENSSLBASE} 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 @@ -187,6 +209,10 @@ OPTIONS_DEFAULT=REGEX REGEX_DESC= Enable multibyte regex support +REGEX_CONFIGURE_OFF=--disable-mbregex +REGEX_CONFIGURE_ON=--with-onig=${LOCALBASE} +REGEX_LIB_DEPENDS= libonig.so:devel/oniguruma + PHP_HEADER_DIRS=libmbfl libmbfl/filters libmbfl/mbfl libmbfl/nls .endif @@ -195,6 +221,10 @@ OPTIONS_DEFINE= MYSQLND OPTIONS_DEFAULT=MYSQLND MYSQLND_DESC= Use MySQL Native Driver + +MYSQLND_CONFIGURE_ON=--with-mysqli=mysqlnd +MYSQLND_CONFIGURE_OFF=--with-mysqli=${LOCALBASE}/bin/mysql_config +MYSQLND_USES_OFF= mysql .endif .if ${PHP_MODNAME} == "odbc" @@ -204,13 +234,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 @@ -234,6 +257,9 @@ USE_PHP= pdo:build OPTIONS_DEFINE= MSSQL MSSQL_DESC= Enable Microsoft SQL Server support + +MSSQL_LIB_DEPENDS= libsybdb.so:databases/freetds +MSSQL_LIB_DEPENDS_OFF= libct.so:databases/freetds .endif .if ${PHP_MODNAME} == "pdo_firebird" @@ -256,6 +282,11 @@ OPTIONS_DEFAULT=MYSQLND MYSQLND_DESC= Use MySQL Native Driver +MYSQLND_CONFIGURE_ON=--with-pdo-mysql=mysqlnd +MYSQLND_CONFIGURE_OFF=--with-pdo-mysql=${LOCALBASE} \ + --with-zlib-dir=/usr +MYSQLND_USES_OFF= mysql + USE_PHP= pdo:build .endif @@ -433,131 +464,15 @@ CONFIGURE_ARGS+=--with-zlib=/usr USES+= pkgconfig .endif -.include <bsd.port.options.mk> - -.if ${PHP_MODNAME} == "dba" -. if empty(PORT_OPTIONS:MCDB) -CONFIGURE_ARGS+=--without-cdb -. endif -. if ${PORT_OPTIONS:MDB4} -CONFIGURE_ARGS+=--with-db4=${LOCALBASE} - -USES+= bdb -WITH_BDB_HIGHEST= yes -. endif -. if ${PORT_OPTIONS:MGDBM} -LIB_DEPENDS+= libgdbm.so:databases/gdbm - -CONFIGURE_ARGS+=--with-gdbm=${LOCALBASE} -. endif -. if ${PORT_OPTIONS:MQDBM} -LIB_DEPENDS+= libqdbm.so:databases/qdbm - -CONFIGURE_ARGS+=--with-qdbm=${LOCALBASE} -. endif -. if ${PORT_OPTIONS:MTOKYO} -LIB_DEPENDS+= libtokyocabinet.so:databases/tokyocabinet - -CONFIGURE_ARGS+=--with-tcadb=${LOCALBASE} -. endif -. if empty(PORT_OPTIONS:MINIFILE) -CONFIGURE_ARGS+=--disable-inifile -. endif -. if empty(PORT_OPTIONS:MFLATFILE) -CONFIGURE_ARGS+=--disable-flatfile -. endif - -. if ${PORT_OPTIONS:MLMDB} -LIB_DEPENDS+= liblmdb.so:databases/lmdb -CONFIGURE_ARGS+= --with-lmdb=${LOCALBASE} -.endif -.endif - -.if ${PHP_MODNAME} == "mysqli" -. if ${PORT_OPTIONS:MMYSQLND} -CONFIGURE_ARGS+=--with-mysqli=mysqlnd -. else -CONFIGURE_ARGS+=--with-mysqli=${LOCALBASE}/bin/mysql_config -USES+= mysql -. endif -.endif - -.if ${PHP_MODNAME} == "pdo_mysql" -. if ${PORT_OPTIONS:MMYSQLND} -CONFIGURE_ARGS+=--with-pdo-mysql=mysqlnd -. else -CONFIGURE_ARGS+=--with-pdo-mysql=${LOCALBASE} \ - --with-zlib-dir=/usr -USES+= mysql -. endif -.endif - -.if ${PHP_MODNAME} == "gd" -. if ${PORT_OPTIONS:MJIS} -CONFIGURE_ARGS+=--enable-gd-jis-conv -. endif -. if ${PORT_OPTIONS:MWEBP} -LIB_DEPENDS+= libwebp.so:graphics/webp - -CONFIGURE_ARGS+=--with-webp -. endif -. if ${PORT_OPTIONS:MX11} -USES+= xorg -USE_XORG= xpm - -CONFIGURE_ARGS+=--with-xpm -. endif -.endif - .include <bsd.port.pre.mk> -.if ${PHP_MODNAME} == "imap" -. if ${PORT_OPTIONS:MPANDA} -LIB_DEPENDS+= libc-client4.so.10:mail/panda-cclient -. else -LIB_DEPENDS+= libc-client4.so.9:mail/cclient -. endif -.endif - -.if ${PHP_MODNAME} == "mbstring" -. if ${PORT_OPTIONS:MREGEX} -LIB_DEPENDS+= libonig.so:devel/oniguruma -CONFIGURE_ARGS+=--with-onig=${LOCALBASE} -. else -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" +.if ${PHP_MODNAME} == "sqlite3" || ${PHP_MODNAME} == "zlib" post-extract: @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4 .endif -.if ${PHP_MODNAME} == "pdo_dblib" -. if ${PORT_OPTIONS:MMSSQL} -LIB_DEPENDS+= libsybdb.so:databases/freetds -. else -LIB_DEPENDS+= libct.so:databases/freetds -. endif -.endif - .if ${PHP_MODNAME} == "xml" post-extract: @${MKDIR} ${WRKSRC}/ext/xml @${CP} ${WRKSRC}/expat_compat.h ${WRKSRC}/ext/xml .endif - -.if ${PHP_MODNAME} == "zlib" -post-extract: - @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4 -.endif |