4 from distutils
.sysconfig
import get_python_version
6 # Python site-packages helper
7 def get_site_packages(env
):
8 python_version
= get_python_version()
9 python_api
= 'python' + python_version
10 # Allow "env PYTHON=/usr/bin/python2.4 waf ..." overrides
11 python
= env
['PYTHON']
12 if python
[-3:] != python_version
:
13 if re
.match(r
'\d+\.\d+', python
[-3:]):
14 python_api
= os
.path
.basename(python
)
15 return os
.path
.join(env
['PREFIX'], 'lib', python_api
, 'site-packages')
18 conf
.check_tool('python')
19 conf
.env
['PYTHON_SITE_PACKAGES'] = get_site_packages(conf
.env
)
22 # Compile all Python modules
23 pyqt
= bld
.create_obj('py')
24 pyqt
.inst_var
= 'PYTHON_SITE_PACKAGES'
25 pyqt
.find_sources_in_dirs('.')