summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2020-08-01 09:52:51 +0000
committerwiz <wiz@pkgsrc.org>2020-08-01 09:52:51 +0000
commit3f402f29f1cc4104aea6123abfb0f0a295380bfd (patch)
treee59bb66d1658e3033681f0f3fadf9df15bdbcd64
parent8135286d235c2b9cf9ee98d9752b36a222533f9a (diff)
downloadpkgsrc-3f402f29f1cc4104aea6123abfb0f0a295380bfd.tar.gz
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.
-rw-r--r--lang/php56/Makefile.php57
-rw-r--r--lang/php56/PLIST4
-rw-r--r--lang/php56/options.mk70
3 files changed, 75 insertions, 56 deletions
diff --git a/lang/php56/Makefile.php b/lang/php56/Makefile.php
index a062a40bae2..723ca876484 100644
--- a/lang/php56/Makefile.php
+++ b/lang/php56/Makefile.php
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.php,v 1.7 2019/03/31 20:48:18 wiz Exp $
+# $NetBSD: Makefile.php,v 1.8 2020/08/01 09:52:51 wiz Exp $
# used by lang/php56/Makefile
# used by www/ap-php/Makefile
# used by www/php-fpm/Makefile
@@ -42,60 +42,7 @@ CONFIGURE_ARGS+= --enable-xml
CONFIGURE_ARGS+= --with-libxml-dir=${PREFIX}
.include "../../textproc/libxml2/buildlink3.mk"
-PKG_OPTIONS_VAR= PKG_OPTIONS.${PHP_PKG_PREFIX}
-PKG_SUPPORTED_OPTIONS+= inet6 ssl maintainer-zts readline disable-filter-url
-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
+.include "options.mk"
DL_AUTO_VARS= yes
.include "../../mk/dlopen.buildlink3.mk"
diff --git a/lang/php56/PLIST b/lang/php56/PLIST
index c72ae89d018..ae7a4f8f1b0 100644
--- a/lang/php56/PLIST
+++ b/lang/php56/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2017/04/05 12:28:59 fhajny Exp $
+@comment $NetBSD: PLIST,v 1.4 2020/08/01 09:52:51 wiz Exp $
bin/phar
bin/phar.phar
bin/php
@@ -241,6 +241,8 @@ include/php/main/streams/php_streams_int.h
include/php/main/win32_internal_function_disabled.h
include/php/main/win95nt.h
include/php/sapi/cli/cli.h
+${PLIST.embed}include/php/sapi/embed/php_embed.h
+${PLIST.embed}lib/libphp5.so
lib/php/build/Makefile.global
lib/php/build/acinclude.m4
lib/php/build/config.guess
diff --git a/lang/php56/options.mk b/lang/php56/options.mk
new file mode 100644
index 00000000000..a037a745939
--- /dev/null
+++ b/lang/php56/options.mk
@@ -0,0 +1,70 @@
+# $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