On 2013/05/04 12:10, Vadim Zhukov wrote:
> This patch adds MODPERL_BIN_ADJ and MODPERL_ADJ_FILES, similar to
> what other MODULEs do. There are already quite a few ports that
> could use this functionality instead of inventing analogs each time.
> 
> Okay? Already tested with upcoming TeXLive shebangs patch.

Makes sense, but it also needs a diff to the bsd.port.mk(5) manpage.
It's not used *all* that widely though..the list looks something like

audio/vlorb     games/cowsay    net/sirc
net/smokeping   textproc/groff  www/p5-SOAP-Lite
www/rackmonkey  x11/belt        x11/kde/sdk3

> 
> --
>   WBR,
>     Vadim Zhukov
> 
> 
> Index: perl.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/perl.port.mk,v
> retrieving revision 1.21
> diff -u -p -r1.21 perl.port.mk
> --- perl.port.mk      11 Mar 2013 11:50:17 -0000      1.21
> +++ perl.port.mk      4 May 2013 08:07:07 -0000
> @@ -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";'`; \

Reply via email to