source: waflib/Tools/kde4.py @ c2e0aef

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since c2e0aef was 0fa325b, checked in by Paul Brossier <piem@piem.org>, 11 years ago

waf: unpack

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#! /usr/bin/env python
2# encoding: utf-8
3# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
5import os,sys,re
6from waflib import Options,TaskGen,Task,Utils
7from waflib.TaskGen import feature,after_method
8@feature('msgfmt')
9def apply_msgfmt(self):
10        for lang in self.to_list(self.langs):
11                node=self.path.find_resource(lang+'.po')
12                task=self.create_task('msgfmt',node,node.change_ext('.mo'))
13                langname=lang.split('/')
14                langname=langname[-1]
15                inst=getattr(self,'install_path','${KDE4_LOCALE_INSTALL_DIR}')
16                self.bld.install_as(inst+os.sep+langname+os.sep+'LC_MESSAGES'+os.sep+getattr(self,'appname','set_your_appname')+'.mo',task.outputs[0],chmod=getattr(self,'chmod',Utils.O644))
17class msgfmt(Task.Task):
18        color='BLUE'
19        run_str='${MSGFMT} ${SRC} -o ${TGT}'
20def configure(self):
21        kdeconfig=self.find_program('kde4-config')
22        prefix=self.cmd_and_log('%s --prefix'%kdeconfig).strip()
23        fname='%s/share/apps/cmake/modules/KDELibsDependencies.cmake'%prefix
24        try:os.stat(fname)
25        except OSError:
26                fname='%s/share/kde4/apps/cmake/modules/KDELibsDependencies.cmake'%prefix
27                try:os.stat(fname)
28                except OSError:self.fatal('could not open %s'%fname)
29        try:
30                txt=Utils.readf(fname)
31        except(OSError,IOError):
32                self.fatal('could not read %s'%fname)
33        txt=txt.replace('\\\n','\n')
34        fu=re.compile('#(.*)\n')
35        txt=fu.sub('',txt)
36        setregexp=re.compile('([sS][eE][tT]\s*\()\s*([^\s]+)\s+\"([^"]+)\"\)')
37        found=setregexp.findall(txt)
38        for(_,key,val)in found:
39                self.env[key]=val
40        self.env['LIB_KDECORE']=['kdecore']
41        self.env['LIB_KDEUI']=['kdeui']
42        self.env['LIB_KIO']=['kio']
43        self.env['LIB_KHTML']=['khtml']
44        self.env['LIB_KPARTS']=['kparts']
45        self.env['LIBPATH_KDECORE']=[os.path.join(self.env.KDE4_LIB_INSTALL_DIR,'kde4','devel'),self.env.KDE4_LIB_INSTALL_DIR]
46        self.env['INCLUDES_KDECORE']=[self.env['KDE4_INCLUDE_INSTALL_DIR']]
47        self.env.append_value('INCLUDES_KDECORE',[self.env['KDE4_INCLUDE_INSTALL_DIR']+os.sep+'KDE'])
48        self.find_program('msgfmt',var='MSGFMT')
Note: See TracBrowser for help on using the repository browser.