Sat Aug 1 09:52:51 2020 UTC ()
php56: add default-off php-embed option to install embed SAPI

Requested by Sergey Osokin in PR 55508.

While here, split off option handling into options.mk.


(wiz)
diff -r1.7 -r1.8 pkgsrc/lang/php56/Makefile.php
diff -r1.3 -r1.4 pkgsrc/lang/php56/PLIST
diff -r0 -r1.1 pkgsrc/lang/php56/options.mk

cvs diff -r1.7 -r1.8 pkgsrc/lang/php56/Makefile.php (expand / switch to unified diff)

--- pkgsrc/lang/php56/Makefile.php 2019/03/31 20:48:18 1.7
+++ pkgsrc/lang/php56/Makefile.php 2020/08/01 09:52:51 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile.php,v 1.7 2019/03/31 20:48:18 wiz Exp $ 1# $NetBSD: Makefile.php,v 1.8 2020/08/01 09:52:51 wiz Exp $
2# used by lang/php56/Makefile 2# used by lang/php56/Makefile
3# used by www/ap-php/Makefile 3# used by www/ap-php/Makefile
4# used by www/php-fpm/Makefile 4# used by www/php-fpm/Makefile
5 5
6.include "../../lang/php56/Makefile.common" 6.include "../../lang/php56/Makefile.common"
7 7
8DISTINFO_FILE= ${.CURDIR}/../../lang/php56/distinfo 8DISTINFO_FILE= ${.CURDIR}/../../lang/php56/distinfo
9PATCHDIR= ${.CURDIR}/../../lang/php56/patches 9PATCHDIR= ${.CURDIR}/../../lang/php56/patches
10 10
11USE_LIBTOOL= YES 11USE_LIBTOOL= YES
12USE_LANGUAGES= c c++ 12USE_LANGUAGES= c c++
13GNU_CONFIGURE= YES 13GNU_CONFIGURE= YES
14BUILD_DEFS+= VARBASE 14BUILD_DEFS+= VARBASE
@@ -32,70 +32,17 @@ CONFIGURE_ARGS+= --without-sqlite3 @@ -32,70 +32,17 @@ CONFIGURE_ARGS+= --without-sqlite3
32#CONFIGURE_ARGS+= --without-intl 32#CONFIGURE_ARGS+= --without-intl
33 33
34CONFIGURE_ARGS+= --disable-posix 34CONFIGURE_ARGS+= --disable-posix
35CONFIGURE_ARGS+= --disable-opcache 35CONFIGURE_ARGS+= --disable-opcache
36CONFIGURE_ARGS+= --disable-pdo 36CONFIGURE_ARGS+= --disable-pdo
37CONFIGURE_ARGS+= --disable-json 37CONFIGURE_ARGS+= --disable-json
38 38
39CONFIGURE_ARGS+= --enable-cgi 39CONFIGURE_ARGS+= --enable-cgi
40CONFIGURE_ARGS+= --enable-mysqlnd 40CONFIGURE_ARGS+= --enable-mysqlnd
41CONFIGURE_ARGS+= --enable-xml 41CONFIGURE_ARGS+= --enable-xml
42CONFIGURE_ARGS+= --with-libxml-dir=${PREFIX} 42CONFIGURE_ARGS+= --with-libxml-dir=${PREFIX}
43.include "../../textproc/libxml2/buildlink3.mk" 43.include "../../textproc/libxml2/buildlink3.mk"
44 44
45PKG_OPTIONS_VAR= PKG_OPTIONS.${PHP_PKG_PREFIX} 45.include "options.mk"
46PKG_SUPPORTED_OPTIONS+= inet6 ssl maintainer-zts readline disable-filter-url 
47PKG_SUGGESTED_OPTIONS+= inet6 ssl 
48 
49.if ${OPSYS} == "SunOS" || ${OPSYS} == "Darwin" || ${OPSYS} == "FreeBSD" 
50PKG_SUPPORTED_OPTIONS+= dtrace 
51.endif 
52 
53.include "../../mk/bsd.options.mk" 
54 
55.if !empty(PKG_OPTIONS:Minet6) 
56CONFIGURE_ARGS+= --enable-ipv6 
57.else 
58CONFIGURE_ARGS+= --disable-ipv6 
59.endif 
60 
61.if !empty(PKG_OPTIONS:Mssl) 
62. include "../../security/openssl/buildlink3.mk" 
63. if ${OPSYS} == "SunOS" 
64CONFIGURE_ARGS+= --with-openssl=yes 
65LIBS.SunOS+= -lcrypto 
66. else 
67CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl} 
68. endif 
69PATCH_SITES+= http://zettasystem.com/ 
70PATCHFILES+= PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch 
71PATCH_DIST_STRIP= -p1 
72.else 
73CONFIGURE_ARGS+= --without-openssl 
74.endif 
75 
76.if !empty(PKG_OPTIONS:Mmaintainer-zts) 
77CONFIGURE_ARGS+= --enable-maintainer-zts 
78.endif 
79 
80.if !empty(PKG_OPTIONS:Mreadline) 
81USE_GNU_READLINE= yes 
82.include "../../devel/readline/buildlink3.mk" 
83CONFIGURE_ARGS+= --with-readline=${BUILDLINK_PREFIX.readline} 
84.else 
85CONFIGURE_ARGS+= --without-readline 
86.endif 
87 
88.if !empty(PKG_OPTIONS:Mdtrace) 
89PLIST.dtrace= yes 
90CONFIGURE_ARGS+= --enable-dtrace 
91 
92# See https://bugs.php.net/bug.php?id=61268 
93INSTALL_MAKE_FLAGS+= -r 
94.endif 
95 
96.if !empty(PKG_OPTIONS:Mdisable-filter-url) 
97CFLAGS+= -DDISABLE_FILTER_URL 
98.endif 
99 46
100DL_AUTO_VARS= yes 47DL_AUTO_VARS= yes
101.include "../../mk/dlopen.buildlink3.mk" 48.include "../../mk/dlopen.buildlink3.mk"

cvs diff -r1.3 -r1.4 pkgsrc/lang/php56/PLIST (expand / switch to unified diff)

--- pkgsrc/lang/php56/PLIST 2017/04/05 12:28:59 1.3
+++ pkgsrc/lang/php56/PLIST 2020/08/01 09:52:51 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1@comment $NetBSD: PLIST,v 1.3 2017/04/05 12:28:59 fhajny Exp $ 1@comment $NetBSD: PLIST,v 1.4 2020/08/01 09:52:51 wiz Exp $
2bin/phar 2bin/phar
3bin/phar.phar 3bin/phar.phar
4bin/php 4bin/php
5bin/php-config 5bin/php-config
6bin/phpize 6bin/phpize
7include/php/TSRM/TSRM.h 7include/php/TSRM/TSRM.h
8include/php/TSRM/readdir.h 8include/php/TSRM/readdir.h
9include/php/TSRM/tsrm_config.h 9include/php/TSRM/tsrm_config.h
10include/php/TSRM/tsrm_config.w32.h 10include/php/TSRM/tsrm_config.w32.h
11include/php/TSRM/tsrm_config_common.h 11include/php/TSRM/tsrm_config_common.h
12include/php/TSRM/tsrm_nw.h 12include/php/TSRM/tsrm_nw.h
13include/php/TSRM/tsrm_strtok_r.h 13include/php/TSRM/tsrm_strtok_r.h
14include/php/TSRM/tsrm_win32.h 14include/php/TSRM/tsrm_win32.h
@@ -231,26 +231,28 @@ include/php/main/rfc1867.h @@ -231,26 +231,28 @@ include/php/main/rfc1867.h
231include/php/main/snprintf.h 231include/php/main/snprintf.h
232include/php/main/spprintf.h 232include/php/main/spprintf.h
233include/php/main/streams/php_stream_context.h 233include/php/main/streams/php_stream_context.h
234include/php/main/streams/php_stream_filter_api.h 234include/php/main/streams/php_stream_filter_api.h
235include/php/main/streams/php_stream_glob_wrapper.h 235include/php/main/streams/php_stream_glob_wrapper.h
236include/php/main/streams/php_stream_mmap.h 236include/php/main/streams/php_stream_mmap.h
237include/php/main/streams/php_stream_plain_wrapper.h 237include/php/main/streams/php_stream_plain_wrapper.h
238include/php/main/streams/php_stream_transport.h 238include/php/main/streams/php_stream_transport.h
239include/php/main/streams/php_stream_userspace.h 239include/php/main/streams/php_stream_userspace.h
240include/php/main/streams/php_streams_int.h 240include/php/main/streams/php_streams_int.h
241include/php/main/win32_internal_function_disabled.h 241include/php/main/win32_internal_function_disabled.h
242include/php/main/win95nt.h 242include/php/main/win95nt.h
243include/php/sapi/cli/cli.h 243include/php/sapi/cli/cli.h
 244${PLIST.embed}include/php/sapi/embed/php_embed.h
 245${PLIST.embed}lib/libphp5.so
244lib/php/build/Makefile.global 246lib/php/build/Makefile.global
245lib/php/build/acinclude.m4 247lib/php/build/acinclude.m4
246lib/php/build/config.guess 248lib/php/build/config.guess
247lib/php/build/config.sub 249lib/php/build/config.sub
248lib/php/build/libtool.m4 250lib/php/build/libtool.m4
249lib/php/build/ltmain.sh 251lib/php/build/ltmain.sh
250lib/php/build/mkdep.awk 252lib/php/build/mkdep.awk
251lib/php/build/phpize.m4 253lib/php/build/phpize.m4
252lib/php/build/run-tests.php 254lib/php/build/run-tests.php
253lib/php/build/scan_makefile_in.awk 255lib/php/build/scan_makefile_in.awk
254lib/php/build/shtool 256lib/php/build/shtool
255libexec/cgi-bin/php 257libexec/cgi-bin/php
256man/man1/phar.1 258man/man1/phar.1

File Added: pkgsrc/lang/php56/options.mk
# $NetBSD: options.mk,v 1.1 2020/08/01 09:52:51 wiz Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.${PHP_PKG_PREFIX}
PKG_SUPPORTED_OPTIONS+=	inet6 ssl maintainer-zts readline disable-filter-url php-embed
PKG_SUGGESTED_OPTIONS+=	inet6 ssl

.if ${OPSYS} == "SunOS" || ${OPSYS} == "Darwin" || ${OPSYS} == "FreeBSD"
PKG_SUPPORTED_OPTIONS+=	dtrace
.endif

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Minet6)
CONFIGURE_ARGS+=	--enable-ipv6
.else
CONFIGURE_ARGS+=	--disable-ipv6
.endif

.if !empty(PKG_OPTIONS:Mssl)
.  include "../../security/openssl/buildlink3.mk"
.  if ${OPSYS} == "SunOS"
CONFIGURE_ARGS+=	--with-openssl=yes
LIBS.SunOS+=		-lcrypto
.  else
CONFIGURE_ARGS+=	--with-openssl=${BUILDLINK_PREFIX.openssl}
.  endif
PATCH_SITES+=		http://zettasystem.com/
PATCHFILES+=		PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch
PATCH_DIST_STRIP=	-p1
.else
CONFIGURE_ARGS+=	--without-openssl
.endif

.if !empty(PKG_OPTIONS:Mmaintainer-zts)
CONFIGURE_ARGS+=	--enable-maintainer-zts
.endif

.if !empty(PKG_OPTIONS:Mreadline)
USE_GNU_READLINE=	yes
.include "../../devel/readline/buildlink3.mk"
CONFIGURE_ARGS+=	--with-readline=${BUILDLINK_PREFIX.readline}
.else
CONFIGURE_ARGS+=	--without-readline
.endif

.if !empty(PKG_OPTIONS:Mdtrace)
PLIST.dtrace=		yes
CONFIGURE_ARGS+=	--enable-dtrace

# See https://bugs.php.net/bug.php?id=61268
INSTALL_MAKE_FLAGS+=	-r
.endif

.if !empty(PKG_OPTIONS:Mdisable-filter-url)
CFLAGS+=		-DDISABLE_FILTER_URL
.endif

PLIST_VARS+=	embed

.if !empty(PKG_OPTIONS:Mphp-embed)
CONFIGURE_ARGS+=	--enable-embed
INSTALLATION_DIRS+=	include/php/sapi/embed
PLIST.embed=		yes

.PHONY: post-install-embed
post-install: post-install-embed
post-install-embed:
	${INSTALL_DATA} ${WRKSRC}/sapi/embed/php_embed.h ${DESTDIR}${PREFIX}/include/php/sapi/embed/
	${INSTALL_LIB} ${WRKSRC}/libs/libphp5.so ${DESTDIR}${PREFIX}/lib/
.endif