summaryrefslogtreecommitdiff
path: root/python/SConscript
blob: 8eb1136990e7fdff16d301b8deeea606e97aaa2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Import('*')
# describe what we need for Python

EnsurePythonVersion(2, 4)

import distutils.sysconfig
import os.path

# distutils default prefix is the common path between
# distutils.sysconfig.get_python_lib and distutils.sysconfig.get_python_inc
prefix = os.path.commonprefix([
    distutils.sysconfig.get_python_lib(),
    distutils.sysconfig.get_python_inc(),
    ])
# suffix to install .py files to is distutils.sysconfig.get_python_lib()
# after the common prefix
python_suffix = distutils.sysconfig.get_python_lib()[len(prefix):]
# install path for python is then in DESTDIR + python_suffix
python_installdir = DESTDIR + python_suffix + '/subunit'
env.Alias('install', [Install(python_installdir, 'subunit/__init__.py')])