~ubuntu-branches/ubuntu/saucy/xmms2/saucy-proposed

« back to all changes in this revision

Viewing changes to wafadmin/Tools/dbus.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ragwitz
  • Date: 2009-05-02 08:31:32 UTC
  • mto: (1.1.6 upstream) (6.1.3 sid)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090502083132-y0ulwiqbk4lxfd4z
ImportĀ upstreamĀ versionĀ 0.6DrMattDestruction

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# encoding: utf-8
 
3
# Ali Sabil, 2007
 
4
 
 
5
 
 
6
import Task, Utils
 
7
from TaskGen import taskgen, before, after, feature
 
8
 
 
9
@taskgen
 
10
def add_dbus_file(self, filename, prefix, mode):
 
11
        if not hasattr(self, 'dbus_lst'):
 
12
                self.dbus_lst = []
 
13
        self.meths.append('process_dbus')
 
14
        self.dbus_lst.append([filename, prefix, mode])
 
15
 
 
16
@taskgen
 
17
@before('apply_core')
 
18
def process_dbus(self):
 
19
        for filename, prefix, mode in getattr(self, 'dbus_lst', []):
 
20
                env = self.env.copy()
 
21
                node = self.path.find_resource(filename)
 
22
 
 
23
                if not node:
 
24
                        raise Utils.WafError('file not found ' + filename)
 
25
 
 
26
                env['DBUS_BINDING_TOOL_PREFIX'] = prefix
 
27
                env['DBUS_BINDING_TOOL_MODE']   = mode
 
28
 
 
29
                task = self.create_task('dbus_binding_tool', env)
 
30
                task.set_inputs(node)
 
31
                task.set_outputs(node.change_ext('.h'))
 
32
 
 
33
Task.simple_task_type('dbus_binding_tool',
 
34
        '${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}',
 
35
        color='BLUE', before='cc')
 
36
 
 
37
def detect(conf):
 
38
        dbus_binding_tool = conf.find_program('dbus-binding-tool', var='DBUS_BINDING_TOOL')
 
39