make symlinking python3->python optional (#7960)

* Make symlinking python3->python optional
* Added reference to PEP 394
This commit is contained in:
Elizabeth Fischer 2018-05-02 15:26:30 -04:00 committed by Todd Gamblin
parent 7909e15d83
commit cbd77e3a8d

View file

@ -93,6 +93,10 @@ class Python(AutotoolsPackage):
default=False,
description='Enable expensive build-time optimizations, if available'
)
# See https://legacy.python.org/dev/peps/pep-0394/
variant('pythoncmd', default=True,
description="Symlink 'python3' executable to 'python' "
"(not PEP 394 compliant)")
depends_on("openssl")
depends_on("bzip2")
@ -231,7 +235,7 @@ def post_install(self):
os.symlink(os.path.join(src, f),
os.path.join(dst, f))
if spec.satisfies('@3:'):
if spec.satisfies('@3:') and spec.satisfies('+pythoncmd'):
os.symlink(os.path.join(prefix.bin, 'python3'),
os.path.join(prefix.bin, 'python'))
os.symlink(os.path.join(prefix.bin, 'python3-config'),