perl versions and intltool

Anders F Björklund afb at macports.org
Mon Sep 12 01:45:13 PDT 2011


Ports that use "intltool", now require that the "perl"
symlink is set to perl5.12 (i.e. that the perl5 port
uses the +perl5.12 variant), or it will fail to build.
This is because the intltool.m4 includes a perl check:

checking for intltool-update... /opt/local/bin/intltool-update
checking for intltool-merge... /opt/local/bin/intltool-merge
checking for intltool-extract... /opt/local/bin/intltool-extract
checking for xgettext... /opt/local/bin/xgettext
checking for msgmerge... /opt/local/bin/msgmerge
checking for msgfmt... /opt/local/bin/msgfmt
checking for gmsgfmt... /opt/local/bin/msgfmt
checking for perl... /opt/local/bin/perl
checking for perl >= 5.8.1... 5.10.1
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool

But intltool port doesn't use bin/perl and p5-xml-parser
anymore*, it now uses bin/perl5.12 and p5.12-xml-parser...
And you can't activate both, since the manpages conflict.
So in order to use intltool, you need to set INTLTOOL_PERL.

* http://trac.macports.org/changeset/82553/trunk/dports/textproc/intltool/Portfile

Unfortunately this also means that you need to require
whatever perl version intltool happens to be using at
the time, in _three_ places in every port using it...
(i.e. INTLTOOL_PERL, perl5.12 and p5.12-xml-parser deps)

configure.env   INTLTOOL_PERL=${prefix}/bin/perl5.12
depends_build   port:intltool port:perl5.12 port:p5.12-xml-parser

Maybe there is some clever way to get INTLTOOL_PERL from
the intltool port files, and lose the hardcoded version ?

e.g. something like this (but transcoded to Tcl)
INTLTOOL_PERL=`head -n 1 /opt/local/bin/intltool-update | sed -e 's/^#!//' | cut -d' ' -f1`


Sadly, using Perl is now every bit as awkward as Python.
i.e. you can't really use naked "perl" or "python" bins.

The conflicting manpages should probably be fixed though,
so that both could be installed without getting conflicts:

Error: Target org.macports.activate returned: Image error: /opt/local/share/man/man3/XML::Parser.3pm.gz is being used by the active p5.12-xml-parser port.  Please deactivate this port first, or use 'port -f activate p5.10-xml-parser' to force the activation.

--anders



More information about the macports-dev mailing list