jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
834B

  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. # Sebastian Schlingmann, 2008
  4. # Thomas Nagy, 2008-2010 (ita)
  5. """
  6. Lua support.
  7. Compile *.lua* files into *.luac*::
  8. def configure(conf):
  9. conf.load('lua')
  10. conf.env.LUADIR = '/usr/local/share/myapp/scripts/'
  11. def build(bld):
  12. bld(source='foo.lua')
  13. """
  14. from waflib.TaskGen import extension
  15. from waflib import Task, Utils
  16. @extension('.lua')
  17. def add_lua(self, node):
  18. tsk = self.create_task('luac', node, node.change_ext('.luac'))
  19. inst_to = getattr(self, 'install_path', self.env.LUADIR and '${LUADIR}' or None)
  20. if inst_to:
  21. self.bld.install_files(inst_to, tsk.outputs)
  22. return tsk
  23. class luac(Task.Task):
  24. run_str = '${LUAC} -s -o ${TGT} ${SRC}'
  25. color = 'PINK'
  26. def configure(conf):
  27. """
  28. Detect the luac compiler and set *conf.env.LUAC*
  29. """
  30. conf.find_program('luac', var='LUAC')