From 5ab62297f4880aae026d9f1f16477f9b78f4f3a9 Mon Sep 17 00:00:00 2001 From: zhuk Date: Mon, 6 May 2013 21:16:18 +0000 Subject: [PATCH] Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES, similar to other port modules. Tested with the upcoming print/texlive/base big shebang adjustment patch. "Makes sense" sthen@ --- infrastructure/mk/perl.port.mk | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/infrastructure/mk/perl.port.mk b/infrastructure/mk/perl.port.mk index fadf86bebe7..c1627edcd10 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.21 2013/03/11 11:50:17 espie Exp $ +# $OpenBSD: perl.port.mk,v 1.22 2013/05/06 21:16:18 zhuk Exp $ # Based on bsd.port.mk, originally by Jordan K. Hubbard. # This file is in the public domain. @@ -8,6 +8,18 @@ TEST_TARGET ?= test MODPERL_BUILD ?= Build SHARED_ONLY ?= No +# set /usr/bin/perl for executable scripts +MODPERL_BIN_ADJ = perl -pi \ + -e '$$. == 1 && s|^.*env perl([\s].*)?$$|\#!/usr/bin/perl$$1|;' \ + -e '$$. == 1 && s|^.*bin/perl([\s].*)?$$|\#!/usr/bin/perl$$1|;' \ + -e 'close ARGV if eof;' + +MODPERL_ADJ_FILES ?= +.if !empty(MODPERL_ADJ_FILES) +MODPERL_pre-configure = for f in ${MODPERL_ADJ_FILES}; do \ + ${MODPERL_BIN_ADJ} ${WRKSRC}/$${f}; done +.endif + .if ${CONFIGURE_STYLE:L:Mmodbuild} MODPERL_configure = \ arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \