How to enforce a particular Python version during port build

Ralph Seichter abbot at monksofcool.net
Sun Sep 1 00:30:10 UTC 2019


* Blair Zajac:

> You’ll want to avoid the PATH approach as it requires that
> ${prefix}/bin/python be symlinked to a Python 3.x, which isn’t always
> the case.

Not always, but it is for me:

  $ ls -dl /opt/local/bin/python
  lrwxr-xr-x  1 root  admin    24B 11 Jul 16:50 /opt/local/bin/python@ -> /opt/local/bin/python3.7

Does this not mean it should work on my machine unless something is
screwing with the PATH variable?

> Instead tell it to use ${prefix}/bin/python3.7. You’ll have to poke
> into the project to see how to tell it specifically which Python
> binary to use.

Are you saying that I cannot enforce/extend PATH in the Portfile? I'd
rather not patch the sources if I can avoid it.

-Ralph


More information about the macports-dev mailing list