From c9c73b5eadb61c45508c5302e023ff68d267364b Mon Sep 17 00:00:00 2001 From: sthen Date: Mon, 14 Mar 2022 08:23:29 +0000 Subject: [PATCH] Change MODPERL_REGEN_PPPORT to accept a filename. Useful when the port uses a different name or a subdirectory for the file. Adjust some ports to use it: p5-DBI (different name), p5-Template (xs subdirectory). There are others that could use this. OK bluhm@ --- databases/p5-DBI/Makefile | 2 ++ infrastructure/mk/perl.port.mk | 14 +++++++------- textproc/p5-Template/Makefile | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/databases/p5-DBI/Makefile b/databases/p5-DBI/Makefile index df759b50e47..506a4aae1de 100644 --- a/databases/p5-DBI/Makefile +++ b/databases/p5-DBI/Makefile @@ -13,6 +13,8 @@ PERMIT_PACKAGE = Yes WANTLIB += c perl +MODPERL_REGEN_PPPORT = dbipport.h + RUN_DEPENDS = net/p5-PlRPC>=0.2017 \ databases/p5-SQL-Statement>=1.400 \ devel/p5-MLDBM diff --git a/infrastructure/mk/perl.port.mk b/infrastructure/mk/perl.port.mk index 9ffaa51311a..aa5f982257f 100644 --- a/infrastructure/mk/perl.port.mk +++ b/infrastructure/mk/perl.port.mk @@ -1,6 +1,6 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 sw=4 filetype=make: -# $OpenBSD: perl.port.mk,v 1.34 2022/03/12 19:41:34 sthen Exp $ +# $OpenBSD: perl.port.mk,v 1.35 2022/03/14 08:23:29 sthen Exp $ # Based on bsd.port.mk, originally by Jordan K. Hubbard. # This file is in the public domain. @@ -44,7 +44,7 @@ PERL_MB_OPT = --install_path=lib=${LOCALBASE}/${P5SITE} \ CONFIGURE_ENV += PERL_MB_OPT="${PERL_MB_OPT}" #MAKE_ENV += PERL_MB_OPT="${PERL_MB_OPT}" -MODPERL_REGEN_PPPORT ?= Yes +MODPERL_REGEN_PPPORT ?= ppport.h # set /usr/bin/perl for executable scripts MODPERL_BIN_ADJ = perl -pi \ @@ -58,13 +58,13 @@ MODPERL_pre-configure = for f in ${MODPERL_ADJ_FILES}; do \ ${MODPERL_BIN_ADJ} ${WRKSRC}/$${f}; done .endif -.if ${MODPERL_REGEN_PPPORT:L:Myes} +.if ${MODPERL_REGEN_PPPORT:L} != no MODPERL_gen = \ - if test -f ${WRKDIST}/ppport.h; then \ - echo "Regenerating ppport.h"; \ + if test -f ${WRKDIST}/${MODPERL_REGEN_PPPORT}; then \ + echo "Regenerating ${MODPERL_REGEN_PPPORT}"; \ cd ${WRKDIST} && \ - cp ppport.h ppport.h.orig.ppport; \ - perl -MDevel::PPPort -e'Devel::PPPort::WriteFile'; \ + cp ${MODPERL_REGEN_PPPORT} ${MODPERL_REGEN_PPPORT}.orig.ppport; \ + perl -MDevel::PPPort -e'Devel::PPPort::WriteFile("${MODPERL_REGEN_PPPORT}")'; \ fi .endif diff --git a/textproc/p5-Template/Makefile b/textproc/p5-Template/Makefile index 9f61303f5f1..2330da2c9de 100644 --- a/textproc/p5-Template/Makefile +++ b/textproc/p5-Template/Makefile @@ -16,6 +16,8 @@ WANTLIB += c perl RUN_DEPENDS= devel/p5-AppConfig BUILD_DEPENDS= ${RUN_DEPENDS} +MODPERL_REGEN_PPPORT= xs/ppport.h + CONFIGURE_ARGS+= TT_DBI=n TT_LATEX=n TT_ACCEPT=y \ TT_DOCS=n TT_EXAMPLES=n TT_EXTRAS=n \ TT_QUIET=y TT_PREFIX=${PREFIX}/share/tt2