PortGroup perl5 dependencies for non-module ports

Rainer Müller raimue at macports.org
Thu Jan 10 07:56:05 PST 2013


On 2013-01-10 16:21, Michael Schout wrote:
> On 1/10/13 8:23 AM, Rainer Müller wrote:
> 
>> I tried to use the perl5 port group to create a port for an application,
>> not a module. The port group insists on using the version of perl
>> extracted from the currently installed ${prefix}/bin/perl.
> 
> This seems like the right thing to do IMO. ${prefix}/bin/perl is the
> default macports perl after all.

This is wrong as ${prefix}/bin/perl might not yet exist on a system. In
this case the port group falls back to perl5.12. When we build a binary
archive from this port, it would use perl5.12 and install the
dependencies as p5.12-*.

On my system ${prefix}/bin/perl is perl5.16. When I would install this
port, it would install the dependencies as p5.16-*, but still fetch any
binary archive that is available. This is not what the binary archive
expects and this tool would not work.

>> Actually this
>> is the renaming of p5-app-ack, #37595 [1].
>>
>>   name                ack
>>   perl5.branches      5.12
>>   perl5.setup         ack 1.96 App
>>
>> With this, it's still trying to use ${prefix}/bin/perl:
> 
> Why shouldn't it?  I'll admit perhaps I don't grasp enough of the
> macports perl infrastructure, but if ${prefix}/bin/perl is the default
> perl, then that's what ack should be using.

Using ${prefix}/bin/perl will produce different files on disk for some
systems. This would not be a reproducible installation as it depends on
some factor not specified in the Portfile.

>> I found a possible solution in the port biblatex-biber:
>>
>>   name                    ack
>>   perl5.branches          5.12
>>   perl5.default_branch    5.12
>>   perl5.setup             ack 1.96 App
> 
> Am I correct in assuming this FORCES ack to depend on perl 5.12?  That
> seems broken to me.  If I am using perl 5.14, I shouldn't have to
> install perl 5.12 just to get ack.

Yes, it will only use perl5.12. The dependencies need to be pinned to a
specific version. Note that perl5.12 is the recommended and default perl
version as declared in the port group and the perl5 port. If there is a
need to choose the version of perl then there should be variants
+perl5.XY for this.

> p5-app-ack already works fine, provided I have
> ${prefix}/libexec/perl5.14 in my path.

Is there a reason to have multiple versions of ack installed in
parallel? I don't see any as this is not a perl module (or at least,
App::Ack isn't meant to be used by anything else, right?).

I just noticed my conversion added to ticket #37595 is not yet complete:

 * It still installs as ${prefix}/bin/ack-5.12,
   instead of ${prefix}/bin/ack

 * The man page needs to be installed to
   ${prefix}/share/man/man1/ack.1

 * It executes #!/usr/bin/env perl
   (and it even did this before, this is wrong!)

Regarding the last point, ports need to specify ${prefix}/bin/perl5.XY
in the shebang line to ensure that the required modules are actually
available for the current version of perl. With the ports in trunk at
the moment, this would break when you install the ports p5.16-app-ack,
but perl5 with the +perl5.12 variant. ack-5.16 would be executed using
perl5.12 for which no App::Ack would be installed.

Rainer


More information about the macports-dev mailing list