Ignore:
Timestamp:
Mar 14, 2015, 6:06:10 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
6d7acc8
Parents:
5525507
Message:

waf, waflib: update to 1.8.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waflib/Tools/intltool.py

    r5525507 r904702d  
    44
    55import os,re
    6 from waflib import Configure,TaskGen,Task,Utils,Runner,Options,Build,Logs
     6from waflib import Configure,Context,TaskGen,Task,Utils,Runner,Options,Build,Logs
    77import waflib.Tools.ccroot
    8 from waflib.TaskGen import feature,before_method
     8from waflib.TaskGen import feature,before_method,taskgen_method
    99from waflib.Logs import error
     10from waflib.Configure import conf
     11_style_flags={'ba':'-b','desktop':'-d','keys':'-k','quoted':'--quoted-style','quotedxml':'--quotedxml-style','rfc822deb':'-r','schemas':'-s','xml':'-x',}
     12@taskgen_method
     13def ensure_localedir(self):
     14        if not self.env.LOCALEDIR:
     15                if self.env.DATAROOTDIR:
     16                        self.env.LOCALEDIR=os.path.join(self.env.DATAROOTDIR,'locale')
     17                else:
     18                        self.env.LOCALEDIR=os.path.join(self.env.PREFIX,'share','locale')
    1019@before_method('process_source')
    1120@feature('intltool_in')
     
    1322        try:self.meths.remove('process_source')
    1423        except ValueError:pass
    15         if not self.env.LOCALEDIR:
    16                 self.env.LOCALEDIR=self.env.PREFIX+'/share/locale'
     24        self.ensure_localedir()
     25        podir=getattr(self,'podir','.')
     26        podirnode=self.path.find_dir(podir)
     27        if not podirnode:
     28                error("could not find the podir %r"%podir)
     29                return
     30        cache=getattr(self,'intlcache','.intlcache')
     31        self.env.INTLCACHE=[os.path.join(str(self.path.get_bld()),podir,cache)]
     32        self.env.INTLPODIR=podirnode.bldpath()
     33        self.env.append_value('INTLFLAGS',getattr(self,'flags',self.env.INTLFLAGS_DEFAULT))
     34        if'-c'in self.env.INTLFLAGS:
     35                self.bld.fatal('Redundant -c flag in intltool task %r'%self)
     36        style=getattr(self,'style',None)
     37        if style:
     38                try:
     39                        style_flag=_style_flags[style]
     40                except KeyError:
     41                        self.bld.fatal('intltool_in style "%s" is not valid'%style)
     42                self.env.append_unique('INTLFLAGS',[style_flag])
    1743        for i in self.to_list(self.source):
    1844                node=self.path.find_resource(i)
    19                 podir=getattr(self,'podir','po')
    20                 podirnode=self.path.find_dir(podir)
    21                 if not podirnode:
    22                         error("could not find the podir %r"%podir)
    23                         continue
    24                 cache=getattr(self,'intlcache','.intlcache')
    25                 self.env['INTLCACHE']=os.path.join(self.path.bldpath(),podir,cache)
    26                 self.env['INTLPODIR']=podirnode.bldpath()
    27                 self.env['INTLFLAGS']=getattr(self,'flags',['-q','-u','-c'])
    2845                task=self.create_task('intltool',node,node.change_ext(''))
    29                 inst=getattr(self,'install_path','${LOCALEDIR}')
     46                inst=getattr(self,'install_path',None)
    3047                if inst:
    3148                        self.bld.install_files(inst,task.outputs)
     
    3451        try:self.meths.remove('process_source')
    3552        except ValueError:pass
    36         if not self.env.LOCALEDIR:
    37                 self.env.LOCALEDIR=self.env.PREFIX+'/share/locale'
    38         appname=getattr(self,'appname','set_your_app_name')
    39         podir=getattr(self,'podir','')
     53        self.ensure_localedir()
     54        appname=getattr(self,'appname',getattr(Context.g_module,Context.APPNAME,'set_your_app_name'))
     55        podir=getattr(self,'podir','.')
    4056        inst=getattr(self,'install_path','${LOCALEDIR}')
    4157        linguas=self.path.find_node(os.path.join(podir,'LINGUAS'))
     
    6379        color='BLUE'
    6480class intltool(Task.Task):
    65         run_str='${INTLTOOL} ${INTLFLAGS} ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}'
     81        run_str='${INTLTOOL} ${INTLFLAGS} ${INTLCACHE_ST:INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}'
    6682        color='BLUE'
     83@conf
     84def find_msgfmt(conf):
     85        conf.find_program('msgfmt',var='MSGFMT')
     86@conf
     87def find_intltool_merge(conf):
     88        if not conf.env.PERL:
     89                conf.find_program('perl',var='PERL')
     90        conf.env.INTLCACHE_ST='--cache=%s'
     91        conf.env.INTLFLAGS_DEFAULT=['-q','-u']
     92        conf.find_program('intltool-merge',interpreter='PERL',var='INTLTOOL')
    6793def configure(conf):
    68         conf.find_program('msgfmt',var='MSGFMT')
    69         conf.find_perl_program('intltool-merge',var='INTLTOOL')
    70         prefix=conf.env.PREFIX
    71         datadir=conf.env.DATADIR
    72         if not datadir:
    73                 datadir=os.path.join(prefix,'share')
    74         conf.define('LOCALEDIR',os.path.join(datadir,'locale').replace('\\','\\\\'))
    75         conf.define('DATADIR',datadir.replace('\\','\\\\'))
     94        conf.find_msgfmt()
     95        conf.find_intltool_merge()
    7696        if conf.env.CC or conf.env.CXX:
    7797                conf.check(header_name='locale.h')
Note: See TracChangeset for help on using the changeset viewer.