diff 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
line wrap: on
line diff
--- a/wscript	Fri Jun 10 11:57:39 2011 -1000
+++ b/wscript	Wed Jun 15 13:21:25 2011 -1000
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # encoding: utf-8
-import sys
 import os
+import platform
 
 APPNAME = 'parpg'
 VERSION = '0.2.0'
@@ -28,19 +28,22 @@
         min_python_version = (2, 6)
     cnf.check_python_version(min_python_version)
     
-    cnf.env['FIFEPATH'] = \
-        os.path.abspath(os.path.expanduser(cnf.options.fifepath)) or \
-        cnf.env['PYTHONDIR']
+    if not cnf.options.fifepath:
+        cnf.env['FIFEPATH'] = os.path.abspath(
+            os.path.expanduser(cnf.options.fifepath)
+        )
+    else:
+        cnf.env['FIFEPATH'] = cnf.env['PYTHONDIR']
 
 def build(bld):
     subst_vars = _get_subst_vars(bld)
     
-    if sys.platform == 'Windows':
-        launcher_template = 'bin/parpg.bat.in'
-        launcher = 'parpg.bat'
+    if platform.system() == 'Windows':
+        launcher_template = bld.path.find_node('bin/parpg.bat.in')
+        launcher = bld.path.find_or_declare('parpg.bat')
     else:
-        launcher_template = 'bin/parpg.sh.in'
-        launcher = 'parpg'
+        launcher_template = bld.path.find_node('bin/parpg.sh.in')
+        launcher = bld.path.find_or_declare('parpg')
     args = dict(
         features='subst',
         source=launcher_template,
@@ -59,8 +62,8 @@
     
     args = dict(
         features='subst',
-        source='parpg.cfg.in',
-        target='parpg.cfg',
+        source=bld.path.find_node('parpg.cfg.in'),
+        target=bld.path.find_or_declare('parpg.cfg'),
         install_path='${SYSCONFDIR}',
         chmod=0644,
     )
@@ -71,6 +74,7 @@
         files=bld.path.find_node('data').ant_glob('**/*'),
         dest='${DATADIR}',
         relative_trick=True,
+        cwd=bld.path.find_node('data'),
         chmod=0644,
     )