cantera: Fix passing 'python_prefix' variable into installation path

The '${python_prefix}' substring for installation prefix path
was accepted as mapping key for '.format()' function resulting in
a 'KeyError' failure of 'cantera/interfaces/cython/SConscript' script
in case of `env[libdirname] == 'lib64'`.

Moreover the early applied pull request[1] didn't take into account
the additional setting of installation prefix path in the cases
when 'libdirname' takes values different from 'lib64'.

This patch resolves both those issues.

[1]: https://github.com/Cantera/cantera/pull/661
This commit is contained in:
band-a-prend 2019-07-25 23:55:21 +03:00 committed by Ray Speth
parent d263566670
commit 582eb42b2f

View file

@ -101,11 +101,11 @@ elif localenv['python_prefix']:
extra = ''
elif localenv['OS'] == 'Darwin':
extra = localenv.subst(' --prefix=${python_prefix}')
elif localenv['libdirname'] == 'lib64':
# 64-bit RHEL / Fedora
elif localenv['libdirname'] != 'lib':
# 64-bit RHEL / Fedora etc. or e.g. x32 Gentoo profile
extra = localenv.subst(
' --prefix=${python_prefix}'
' --install-lib=${python_prefix}/lib64/python{}/site-packages'.format(py_version))
' --install-lib=${{python_prefix}}/${{libdirname}}/python{}/site-packages'.format(py_version))
else:
extra = '--user'
localenv.AppendENVPath(