MacPorts automake and python

Eric A. Borisch eborisch at macports.org
Thu Mar 20 14:51:24 PDT 2014


Brining back to dev list; seems like the right place.

On Thu, Mar 20, 2014 at 4:01 PM, Sean Farley <sean at macports.org> wrote:

>
> Adam Mercer <ram at macports.org> writes:
>
> > On Thu, Mar 20, 2014 at 2:55 PM, Sean Farley <sean at macports.org> wrote:
> >
> >> I tend to agree with you but need help seeing how this worked
> >> before. What path did automake pick up before this change?
> >
> > If you look at the patch you can see the original paths:
> >
> > <
> http://trac.macports.org/browser/trunk/dports/devel/automake/files/patch-m4-python.m4.diff
> >
> >
> > The original paths are:
> >
> > AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
> > AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
> >
> > Just to clarify this isn't the MacPorts prefix but the prefix for the
> > running configure process.
>
> Right, sorry, I meant more along the lines of:
>
> Before: my project installed into /path/foo/a
> After:  my project installed into /path/foo/b


I think the issue here is that automake is getting patched to *only*
support MacPorts-managed builds, but really automake should still be
available for use to build non-MP software.

What was broken that needed fixing (by the original change)? Is there a
particular port that needed the change? Is there another way to fix it
without modifying automake?

Assuming the change is/was needed (and the best solution), perhaps setting
an environment variable during MP managed builds could be used here to
switch the behavior? Something along the lines of:

AC_SUBST([PYTHON_PREFIX], [`[ ${__MP_BUILD__} ] && $PYTHON -c "import sys;
sys.stdout.write(sys.prefix);" || echo -n ${prefix}`])

where __MP_BUILD__=1 during a managed build, and undefined otherwise?

This way when a user outside of MacPorts is installing a
python-using-software (built against MP-provided python) and they have set
$prefix via configure, it doesn't get crowbarred into /opt/local/ (or
wherever MP is installed.) (Granted, as the .m4 file notes, they will need
to set PYTHONPATH or tell python about it in some manner to use it.)

 - Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20140320/d4d56a52/attachment.html>


More information about the macports-dev mailing list