wscript 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Jérôme Carretero, 2010 (zougloub)
  4. import sys, os
  5. from Utils import subprocess
  6. def configure(cfg):
  7. cfg.load("tex")
  8. def build(bld):
  9. def waf_cmd(task):
  10. outfile = os.path.join(task.generator.cwd, "output")
  11. with open(outfile, "w") as f:
  12. cmd = [
  13. sys.executable,
  14. sys.argv[0],
  15. "configure",
  16. "build",
  17. ]
  18. proc = subprocess.Popen(cmd, cwd=task.generator.cwd, stdout=f, stderr=f)
  19. ret = proc.wait()
  20. if ret != 0:
  21. raise Exception("command failed in %s: %s" % (task.generator.cwd, cmd))
  22. waf_dirs = [ os.path.join(bld.path.abspath(), "snippets", d) for d in ("waf-1", "waf-2") ]
  23. for d in waf_dirs:
  24. bld(
  25. rule=waf_cmd,
  26. cwd=d,
  27. always=True,
  28. name=d,
  29. )
  30. make_dirs = [ os.path.join(bld.path.abspath(), "snippets", d) for d in ("make-1", "make-2") ]
  31. for d in make_dirs:
  32. bld(
  33. rule="make -B > output",
  34. cmd="",
  35. cwd=d,
  36. always=True,
  37. name=d,
  38. )
  39. bld.add_group()
  40. bld(
  41. features="tex",
  42. type="xelatex",
  43. source="slides.tex",
  44. prompt=0,
  45. )