Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-06 Thread Vadim Zhukov
2013/5/4 Vadim Zhukov persg...@gmail.com

  Just add them in the VARIABLES section of bsd.port.mk(5), which already
  has various MODPERL_* variables.

 Something like this?
 --
   WBR,
 Vadim Zhukov


 Index: bsd.port.mk.5
 ===
 RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
 retrieving revision 1.373
 diff -u -p -r1.373 bsd.port.mk.5
 --- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
 +++ bsd.port.mk.5   4 May 2013 11:33:49 -
 @@ -1852,6 +1852,16 @@ tedious.
  .It Ev MODGNU_CONFIG_GUESS_DIRS
  If a port uses config.guess outside WRKSRC, the directories
  containing the other copies must be set here.
 +.It Ev MODPERL_ADJ_FILES
 +List of executable scripts under
 +.Ev WRKSRC
 +which should have shebangs adjusted to safe form like
 +.Dq #!/usr/bin/perl .
 +.It Ev MODPERL_BIN_ADJ
 +Shell fragment to patch the interpreter path in executable scripts.
 +If names of files to be patched are known, they better to be listed in
 +.Ev MODPERL_ADJ_FILES
 +instead.
  .It Ev MODPERL_BUILD_TARGET
  Normal content of
  .Ar do-build


ping.

--
  WBR,
  Vadim Zhukov


Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-06 Thread Stuart Henderson
On 2013/05/06 14:51, Vadim Zhukov wrote:
 Index: bsd.port.mk.5
 ===
 RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
 retrieving revision 1.373
 diff -u -p -r1.373 bsd.port.mk.5
 --- bsd.port.mk.5       25 Mar 2013 13:13:13 -      1.373
 +++ bsd.port.mk.5       4 May 2013 11:33:49 -
 @@ -1852,6 +1852,16 @@ tedious.
  .It Ev MODGNU_CONFIG_GUESS_DIRS
  If a port uses config.guess outside WRKSRC, the directories
  containing the other copies must be set here.
 +.It Ev MODPERL_ADJ_FILES
 +List of executable scripts under
 +.Ev WRKSRC
 +which should have shebangs adjusted to safe form like
 +.Dq #!/usr/bin/perl .
 +.It Ev MODPERL_BIN_ADJ
 +Shell fragment to patch the interpreter path in executable
 scripts.
 +If names of files to be patched are known, they better to be
 listed in
 +.Ev MODPERL_ADJ_FILES
 +instead.
  .It Ev MODPERL_BUILD_TARGET
  Normal content of
  .Ar do-build
 
 
 ping.

Here's alternative wording, some of it borrowed from port-modules(5)
where it talks about the same thing.

Index: bsd.port.mk.5
===
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
retrieving revision 1.373
diff -u -p -r1.373 bsd.port.mk.5
--- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
+++ bsd.port.mk.5   6 May 2013 20:07:27 -
@@ -1852,6 +1852,19 @@ tedious.
 .It Ev MODGNU_CONFIG_GUESS_DIRS
 If a port uses config.guess outside WRKSRC, the directories
 containing the other copies must be set here.
+.It Ev MODPERL_ADJ_FILES
+If any files have a perl shebang line which needs to be replaced
+with
+.Dq #!/usr/bin/perl ,
+list them in
+.Ev MODPERL_ADJ_FILES .
+These are prefixed with WRKSRC and replaced automatically
+at the end of
+.Ar pre-configure .
+.It Ev MODPERL_BIN_ADJ
+Shell fragment to patch the Perl interpreter path in executable scripts.
+Used by
+.Ev MODPERL_ADJ_FILES .
 .It Ev MODPERL_BUILD_TARGET
 Normal content of
 .Ar do-build




Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-06 Thread Vadim Zhukov
2013/5/7 Stuart Henderson st...@openbsd.org

 On 2013/05/06 14:51, Vadim Zhukov wrote:
  Index: bsd.port.mk.5
  ===
  RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
  retrieving revision 1.373
  diff -u -p -r1.373 bsd.port.mk.5
  --- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
  +++ bsd.port.mk.5   4 May 2013 11:33:49 -
  @@ -1852,6 +1852,16 @@ tedious.
   .It Ev MODGNU_CONFIG_GUESS_DIRS
   If a port uses config.guess outside WRKSRC, the directories
   containing the other copies must be set here.
  +.It Ev MODPERL_ADJ_FILES
  +List of executable scripts under
  +.Ev WRKSRC
  +which should have shebangs adjusted to safe form like
  +.Dq #!/usr/bin/perl .
  +.It Ev MODPERL_BIN_ADJ
  +Shell fragment to patch the interpreter path in executable
  scripts.
  +If names of files to be patched are known, they better to be
  listed in
  +.Ev MODPERL_ADJ_FILES
  +instead.
   .It Ev MODPERL_BUILD_TARGET
   Normal content of
   .Ar do-build
 
 
  ping.

 Here's alternative wording, some of it borrowed from port-modules(5)
 where it talks about the same thing.


Looks like much better than mine, thanks! One minor nit below, though:


 Index: bsd.port.mk.5
 ===
 RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
 retrieving revision 1.373
 diff -u -p -r1.373 bsd.port.mk.5
 --- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
 +++ bsd.port.mk.5   6 May 2013 20:07:27 -
 @@ -1852,6 +1852,19 @@ tedious.
  .It Ev MODGNU_CONFIG_GUESS_DIRS
  If a port uses config.guess outside WRKSRC, the directories
  containing the other copies must be set here.
 +.It Ev MODPERL_ADJ_FILES
 ​​
 +If any files have a perl shebang line which needs to be replaced
 +with
 +.Dq #!/usr/bin/perl ,
 +list them in
 +.Ev MODPERL_ADJ_FILES .
 +These are prefixed with WRKSRC and replaced automatically
 +at the end of
 ​​​
 ​​​
 ​
 ​​
 +.Ar pre-configure .


The word prefixed​ is about file names, and replaced is about shebang
lines in files. So mixing them in one sentence creates some sort of
confusion, at least for me. Maybe something like that, if I'm not mistaken?

​If any files have a Perl shebang line, which needs to be replaced
with
.Dq #!/usr/bin/perl ,
list them in
.Ev MODPERL_ADJ_FILES .
File paths here should be relative to
.Ev WRKSRC .
These files are patched automatically​ at the end of
​
​​​
​
​​
.Ar pre-configure .


 ​​
 +.It Ev MODPERL_BIN_ADJ
 +Shell fragment to patch the Perl interpreter path in executable scripts.
 +Used by
 +.Ev MODPERL_ADJ_FILES .
  .It Ev MODPERL_BUILD_TARGET
  Normal content of
  .Ar do-build



--
  WBR,
  Vadim Zhukov


Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-06 Thread Stuart Henderson
On 2013/05/07 00:35, Vadim Zhukov wrote:
  --- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
  +++ bsd.port.mk.5   6 May 2013 20:07:27 -
  @@ -1852,6 +1852,19 @@ tedious.
   .It Ev MODGNU_CONFIG_GUESS_DIRS
   If a port uses config.guess outside WRKSRC, the directories
   containing the other copies must be set here.
  +.It Ev MODPERL_ADJ_FILES
  ​​
  +If any files have a perl shebang line which needs to be replaced
  +with
  +.Dq #!/usr/bin/perl ,
  +list them in
  +.Ev MODPERL_ADJ_FILES .
  +These are prefixed with WRKSRC and replaced automatically
  +at the end of
  ​​​
  ​​​
  ​
  ​​
  +.Ar pre-configure .
 
 
 The word prefixed​ is about file names, and replaced is about shebang
 lines in files. So mixing them in one sentence creates some sort of
 confusion, at least for me. Maybe something like that, if I'm not mistaken?
 
 ​If any files have a Perl shebang line, which needs to be replaced
 with
 .Dq #!/usr/bin/perl ,
 list them in
 .Ev MODPERL_ADJ_FILES .
 File paths here should be relative to
 .Ev WRKSRC .
 These files are patched automatically​ at the end of
 ​
 ​​​
 ​
 ​​
 .Ar pre-configure .

Yes that makes sense to me.

gmail has done some strange things with your mail btw, loads of unicode
zero-width space characters scattered through it...




Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-04 Thread Stuart Henderson
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/cowsaynet/sirc
net/smokeping   textproc/groff  www/p5-SOAP-Lite
www/rackmonkey  x11/beltx11/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 -  1.21
 +++ perl.port.mk  4 May 2013 08:07:07 -
 @@ -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;'`; \



Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-04 Thread Vadim Zhukov
 Makes sense, but it also needs a diff to the bsd.port.mk(5) manpage.

bsd.port.mk(5) talks about CONFIGURE_STYLE only, maybe it will be
better to patch port-modules(5) instead? I didn't find a good place
in bsd.port.mk(5) where to place this info. :( Any clues, maybe, please?

 It's not used *all* that widely though..the list looks something like

Well, I can add at least 4 ports to that list. :) I plan to update all
custom constructions after updating perl.port.mk.

--
  WBR,
Vadim Zhukov


Index: port-modules.5
===
RCS file: /cvs/src/share/man/man5/port-modules.5,v
retrieving revision 1.160
diff -u -p -r1.160 port-modules.5
--- port-modules.5  16 Apr 2013 13:17:40 -  1.160
+++ port-modules.5  4 May 2013 11:02:36 -
@@ -892,9 +892,16 @@ Also affects
 and
 .Ev SUBST_VARS .
 .It perl
-This module is documented in the main
+Provides
+.Ev MODPERL_BIN_ADJ
+shell fragment to patch the interpreter path in executable scripts.
+If names of files to be patched are known, they can be listed in
+.Ev MODPERL_ADJ_FILES
+instead.
+Other parts of this module are documented in the main
 .Xr bsd.port.mk 5
-manpage.
+manpage, when talking about
+.Ev CONFIGURE_STYLE .
 .It textproc/intltool
 Sets
 .Ev MODINTLTOOL_OVERRIDE .



Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-04 Thread Stuart Henderson
On 2013/05/04 15:12, Vadim Zhukov wrote:
  Makes sense, but it also needs a diff to the bsd.port.mk(5) manpage.
 
 bsd.port.mk(5) talks about CONFIGURE_STYLE only, maybe it will be
 better to patch port-modules(5) instead? I didn't find a good place
 in bsd.port.mk(5) where to place this info. :( Any clues, maybe, please?

port-modules says:

 perl  This module is documented in the main bsd.port.mk(5)
   manpage.

Just add them in the VARIABLES section of bsd.port.mk(5), which already
has various MODPERL_* variables.



Re: Add MODPERL_BIN_ADJ and MODPERL_ADJ_FILES to perl.port.mk

2013-05-04 Thread Vadim Zhukov
 Just add them in the VARIABLES section of bsd.port.mk(5), which already
 has various MODPERL_* variables.

Something like this?
--
  WBR,
Vadim Zhukov


Index: bsd.port.mk.5
===
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
retrieving revision 1.373
diff -u -p -r1.373 bsd.port.mk.5
--- bsd.port.mk.5   25 Mar 2013 13:13:13 -  1.373
+++ bsd.port.mk.5   4 May 2013 11:33:49 -
@@ -1852,6 +1852,16 @@ tedious.
 .It Ev MODGNU_CONFIG_GUESS_DIRS
 If a port uses config.guess outside WRKSRC, the directories
 containing the other copies must be set here.
+.It Ev MODPERL_ADJ_FILES
+List of executable scripts under
+.Ev WRKSRC
+which should have shebangs adjusted to safe form like
+.Dq #!/usr/bin/perl .
+.It Ev MODPERL_BIN_ADJ
+Shell fragment to patch the interpreter path in executable scripts.
+If names of files to be patched are known, they better to be listed in
+.Ev MODPERL_ADJ_FILES
+instead.
 .It Ev MODPERL_BUILD_TARGET
 Normal content of
 .Ar do-build