Commits

Anonymous committed 7f25192

add support for forcing python2 in waf (but disabled for now)

Comments (0)

Files changed (2)

kit/create-kit.py

 ## '''
 
 waf_light = os.path.join(os.getcwd(), 'waf-light')
-sub.check_call(
-    [sys.executable,
+cmd = [sys.executable,
      waf_light,
      '--tools=%s' % tools,
      '--prelude=\tfrom waflib.extras.wafflelib import waffle_main;waffle_main.start(cwd, VERSION, wafdir);sys.exit(0)',
-     ],
+     ]
+#println(":: cmd: %s" % cmd)
+
+sub.check_call(
+    cmd,
     cwd=os.path.join(waffledir,'src-waf'),
     )
 
 os.chdir(waffledir)
 
-if os.path.exists('waf'):
-    os.remove('waf')
+for exe in ('waf', 'tmp-waf'):
+    if os.path.exists(exe):
+        os.remove(exe)
 shutil.move(src=os.path.join(waffledir,'src-waf','waf'),
             dst='waf')
 
+## ## force python2 by default
+## with open('waf', 'wb') as waf:
+##     waf.write('#!/usr/bin/env %s\n' % os.getenv('WAF_PYTHON', 'python2'))
+##     lines = open('tmp-waf', 'rb').readlines()[1:]
+##     for l in lines:
+##         waf.write(l)
+##     waf.flush()
+## os.remove('tmp-waf')
+## os.chmod('waf', 0755)
+
 println(":: done")
 println("::::::::::::::::::::::::")
 
Binary file modified.