diff --git a/SConstruct b/SConstruct index 1d9118c69..28dc21460 100644 --- a/SConstruct +++ b/SConstruct @@ -1150,6 +1150,10 @@ if any(name.startswith('/usr/lib64/python') for name in sys.path): else: env['libdirname'] = 'lib' +# On Debian-based systems, need to special-case installation to +# /usr/local because of dist-packages vs site-packages +env['debian'] = any(name.endswith('dist-packages') for name in sys.path) + # Directories where things will be after actually being installed. These # variables are the ones that are used to populate header files, scripts, etc. env['ct_installroot'] = env['prefix'] diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index 4fadc93a6..30125177c 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -81,7 +81,10 @@ def install_module(prefix, python_version): extra += ' --prefix=""' elif prefix: # A specific location for the Cantera python module has been given - if localenv['OS'] == 'Darwin': + if localenv['debian'] and localenv.subst(prefix) == '/usr/local': + # Installation to /usr/local is the default on Debian-based distributions + extra = '' + elif localenv['OS'] == 'Darwin': extra = localenv.subst(' --prefix=${python%s_prefix}' % ver) elif localenv['libdirname'] == 'lib64': # 64-bit RHEL / Fedora