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@
This commit is contained in:
sthen 2022-03-14 08:23:29 +00:00
parent 1cf506e2d3
commit c9c73b5ead
3 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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