comparison wscript @ 20:07ff8cf8a0f1

Fixed WAF install paths issue on Windows. * Reorganized the waf_paths.py WAF tool so that install paths are correctly set on Windows. * Added ordereddict.py for use by the waf_paths.py WAF tool on python versions less than 2.7. * Renamed the waf script to waf.py so that Windows users get the benefits of the .py file extension. * Fixed a bug where the FifePath entry in parpg.cfg was not getting set to the default python site-package path. * Fixed a bug in the Windows parpg.bat launcher where quotation marks (") were screwing up the PYTHONPATH variable.
author M. George Hansen <technopolitica@gmail.com>
date Wed, 15 Jun 2011 13:21:25 -1000
parents 2e2d6d9009a3
children feceb6130570
comparison
equal deleted inserted replaced
19:e97972cc7110 20:07ff8cf8a0f1
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # encoding: utf-8 2 # encoding: utf-8
3 import sys
4 import os 3 import os
4 import platform
5 5
6 APPNAME = 'parpg' 6 APPNAME = 'parpg'
7 VERSION = '0.2.0' 7 VERSION = '0.2.0'
8 8
9 def options(opt): 9 def options(opt):
26 min_python_version = (2, 7) 26 min_python_version = (2, 7)
27 else: 27 else:
28 min_python_version = (2, 6) 28 min_python_version = (2, 6)
29 cnf.check_python_version(min_python_version) 29 cnf.check_python_version(min_python_version)
30 30
31 cnf.env['FIFEPATH'] = \ 31 if not cnf.options.fifepath:
32 os.path.abspath(os.path.expanduser(cnf.options.fifepath)) or \ 32 cnf.env['FIFEPATH'] = os.path.abspath(
33 cnf.env['PYTHONDIR'] 33 os.path.expanduser(cnf.options.fifepath)
34 )
35 else:
36 cnf.env['FIFEPATH'] = cnf.env['PYTHONDIR']
34 37
35 def build(bld): 38 def build(bld):
36 subst_vars = _get_subst_vars(bld) 39 subst_vars = _get_subst_vars(bld)
37 40
38 if sys.platform == 'Windows': 41 if platform.system() == 'Windows':
39 launcher_template = 'bin/parpg.bat.in' 42 launcher_template = bld.path.find_node('bin/parpg.bat.in')
40 launcher = 'parpg.bat' 43 launcher = bld.path.find_or_declare('parpg.bat')
41 else: 44 else:
42 launcher_template = 'bin/parpg.sh.in' 45 launcher_template = bld.path.find_node('bin/parpg.sh.in')
43 launcher = 'parpg' 46 launcher = bld.path.find_or_declare('parpg')
44 args = dict( 47 args = dict(
45 features='subst', 48 features='subst',
46 source=launcher_template, 49 source=launcher_template,
47 target=launcher, 50 target=launcher,
48 install_path='${BINDIR}', 51 install_path='${BINDIR}',
57 install_from='src', 60 install_from='src',
58 ) 61 )
59 62
60 args = dict( 63 args = dict(
61 features='subst', 64 features='subst',
62 source='parpg.cfg.in', 65 source=bld.path.find_node('parpg.cfg.in'),
63 target='parpg.cfg', 66 target=bld.path.find_or_declare('parpg.cfg'),
64 install_path='${SYSCONFDIR}', 67 install_path='${SYSCONFDIR}',
65 chmod=0644, 68 chmod=0644,
66 ) 69 )
67 args.update(subst_vars) 70 args.update(subst_vars)
68 bld(**args) 71 bld(**args)
69 72
70 bld.install_files( 73 bld.install_files(
71 files=bld.path.find_node('data').ant_glob('**/*'), 74 files=bld.path.find_node('data').ant_glob('**/*'),
72 dest='${DATADIR}', 75 dest='${DATADIR}',
73 relative_trick=True, 76 relative_trick=True,
77 cwd=bld.path.find_node('data'),
74 chmod=0644, 78 chmod=0644,
75 ) 79 )
76 80
77 def _get_subst_vars(cnf): 81 def _get_subst_vars(cnf):
78 # Set up substitution variables for the launcher and configuration files. 82 # Set up substitution variables for the launcher and configuration files.