Skip to content

Commit

Permalink
unit-php: Obtain package options for PHP using pkg-build-options.mk
Browse files Browse the repository at this point in the history
This should unbreak things that attempt to scan the pkgsrc tree without
building dependencies, as observed in morden.netbsd.org daily pkgsrc output
  • Loading branch information
alarixnia committed Mar 10, 2021
1 parent 1217164 commit 5b5e161
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion lang/php73/buildlink3.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.4 2020/11/05 09:06:58 ryoon Exp $
# $NetBSD: buildlink3.mk,v 1.5 2021/03/10 16:35:16 nia Exp $

BUILDLINK_TREE+= php

Expand All @@ -9,6 +9,9 @@ BUILDLINK_API_DEPENDS.php+= php>=7.3.0<7.3.99
BUILDLINK_ABI_DEPENDS.php+= php>=7.3.24nb1
BUILDLINK_PKGSRCDIR.php?= ../../lang/php73

pkgbase := php
.include "../../mk/pkg-build-options.mk"

.include "../../textproc/libxml2/buildlink3.mk"
.endif # PHP_BUILDLINK3_MK

Expand Down
5 changes: 4 additions & 1 deletion lang/php74/buildlink3.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.3 2020/11/05 09:06:58 ryoon Exp $
# $NetBSD: buildlink3.mk,v 1.4 2021/03/10 16:35:17 nia Exp $

BUILDLINK_TREE+= php

Expand All @@ -9,6 +9,9 @@ BUILDLINK_API_DEPENDS.php+= php>=7.4.0<7.5
BUILDLINK_ABI_DEPENDS.php+= php>=7.4.12nb1
BUILDLINK_PKGSRCDIR.php?= ../../lang/php74

pkgbase := php
.include "../../mk/pkg-build-options.mk"

.include "../../textproc/libxml2/buildlink3.mk"
.endif # PHP_BUILDLINK3_MK

Expand Down
4 changes: 3 additions & 1 deletion lang/php80/buildlink3.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.1 2021/03/07 13:41:36 taca Exp $
# $NetBSD: buildlink3.mk,v 1.2 2021/03/10 16:35:17 nia Exp $

BUILDLINK_TREE+= php

Expand All @@ -9,6 +9,8 @@ BUILDLINK_API_DEPENDS.php+= php>=8.0.0<9.0
BUILDLINK_ABI_DEPENDS.php+= php>=8.0.0
BUILDLINK_PKGSRCDIR.php?= ../../lang/php80

pkgbase := php
.include "../../mk/pkg-build-options.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.endif # PHP_BUILDLINK3_MK

Expand Down
10 changes: 4 additions & 6 deletions www/unit-php/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2021/02/27 20:58:26 otis Exp $
# $NetBSD: Makefile,v 1.5 2021/03/10 16:35:17 nia Exp $

PKGNAME= unit-${LANG}${PHP_VERSION:R:S|.||g}-${UNIT_VERSION}
COMMENT= PHP module for NGINX Unit
Expand All @@ -12,11 +12,6 @@ PHP_VERSIONS_ACCEPTED?= 56 73 74

.include "../../lang/php/phpversion.mk"

PHP_BUILD_OPTIONS!= ${RUN} ${PKG_INFO} -Bn php | ${GREP} PKG_OPTIONS
.if empty(PHP_BUILD_OPTIONS:Mphp-embed)
BROKEN= "Requires the php-embed option enabled in PHP."
.endif

post-configure:
${RUN} cd ${WRKSRC} && ${SETENV} ${_CONFIGURE_SCRIPT_ENV} \
${CONFIG_SHELL} ${CONFIG_SHELL_FLAGS} \
Expand All @@ -25,6 +20,9 @@ post-configure:
--module=${MODNAME}

.include "${PHPPKGSRCDIR}/buildlink3.mk"
.if empty(PKG_BUILD_OPTIONS.php:Mphp-embed)
BROKEN= "Requires the php-embed option enabled in PHP."
.endif
.include "../../www/unit/ext.mk"
.include "../../www/unit/Makefile.common"
.include "../../mk/bsd.pkg.mk"

0 comments on commit 5b5e161

Please sign in to comment.