[enhancement] proposal - make all ports independent of which version of Perl is installed or the major one

Joshua Root jmr at macports.org
Sun May 27 20:23:02 PDT 2012


On 2012-5-28 12:40 , Bradley Giesbrecht wrote:
> 
> On May 27, 2012, at 2:29 PM, Lawrence Velázquez wrote:
> 
>> On May 25, 2012, at 11:02 a.m., Bradley Giesbrecht wrote:
>>
>>> https://trac.macports.org/attachment/ticket/34617/patch-perl5.xx.diff
>>>
>>> The patch looks reasonable to me. I look forward to hearing what others think.
>>
>> As has been pointed out several times already, using ${perl5.major} in these ports makes their builds unrepeatable.
> 
> I was wrong in thinking ${perl5.major} would be what ever the default of the perl5 portgroup was.

Even if it was, that still wouldn't avoid the need to use variants (or
possibly subports in some cases) to change the version of perl used.

> Shouldn't perl5.default_branch be a static version?
> _resources/port1.0/group/perl5-1.0.tcl:
> ...
> options perl5.default_branch perl5.branches
> default perl5.branches {"5.8 5.10 5.12 5.14 5.16"}
> default perl5.default_branch {[perl5_get_default_branch]}
> proc perl5_get_default_branch {} {
>     global prefix
>     # use whatever ${prefix}/bin/perl5 was chosen, and if none, fall back to 5.12
>     if {![catch {set val [lindex [split [exec ${prefix}/bin/perl5 -V:version] {'}] 1]}]} {
>         return [join [lrange [split $val .] 0 1] .]
>     } else {
>         return 5.12
>     }
> }
> ...
> default perl5.major {${perl5.default_branch}}
> ...

This works in the specific case of the p5-* ports because they don't
install any files (except for a README that's just there so the destroot
isn't empty).

- Josh


More information about the macports-dev mailing list