From 36a2ef8fd1db451ea9318743561856b4f0907ba2 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 13 Jul 2004 23:36:35 +0000 Subject: [PATCH] *** empty log message *** --- SConstruct | 4 ++-- buildscripts/builder.py | 17 +++++++++++++++++ flower/SConscript | 6 ++++++ lily/SConscript | 3 ++- po/SConscript | 22 ++++++++++++++++++++++ scm/SConscript | 2 +- scripts/SConscript | 3 +++ 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 po/SConscript diff --git a/SConstruct b/SConstruct index 539a03cf7d..a71953922b 100644 --- a/SConstruct +++ b/SConstruct @@ -75,7 +75,7 @@ FOOSUMS = 1 subdirs = ['flower', 'lily', 'mf', 'scm', 'ly', 'Documentation', 'Documentation/user', 'Documentation/topdocs', 'input', 'scripts', 'elisp', - 'buildscripts', 'cygwin', 'debian'] + 'buildscripts', 'cygwin', 'debian', 'po'] usage = r'''Usage: scons [KEY=VALUE].. [TARGET].. @@ -184,6 +184,7 @@ env.Append ( bindir = bindir, sharedir = sharedir, lilypond_datadir = sharedir_package, + localedir = localedir, local_lilypond_datadir = sharedir_package_version, lilypondprefix = lilypondprefix, sharedir_package = sharedir_package, @@ -596,7 +597,6 @@ patch = env.PATCH (patch_name, tar_ball) env.Depends (patch_name, dist_ball) env.Alias ('release', patch) - for d in subdirs: if os.path.exists (os.path.join (d, 'SConscript')): b = os.path.join (env['build'], d, env['out']) diff --git a/buildscripts/builder.py b/buildscripts/builder.py index 6253bde17e..93b811300c 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -215,3 +215,20 @@ def at_copy (target, source, env): AT_COPY = Builder (action = at_copy) env.Append (BUILDERS = {'AT_COPY': AT_COPY}) +MO = Builder (action = '$MSGFMT -o $TARGET $SOURCE', + suffix = '.mo', src_suffix = '.po') +env.Append (BUILDERS = {'MO': MO}) + +a = 'xgettext --default-domain=lilypond --join \ +--output-dir=${TARGET.dir} --add-comments \ +--keyword=_ --keyword=_f --keyword=_i $SOURCES' +POT = Builder (action = a, suffix = '.pot') +#env.Append (BUILDERS = {'POT': POT}) +#env.Command(env['absbuild'] + '/po/' + env['out'] + '/lilypond.pot', +env['pottarget'] = os.path.join (env['absbuild'], 'po', env['out'], + 'lilypond.pot') +env['potcommand'] = a + +a = 'msgmerge ${SOURCE} ${TARGET.dir}/lilypond.pot -o ${TARGET}' +POMERGE = Builder (action = a, suffix = '.pom', src_suffix = '.po') +env.Append (BUILDERS = {'POMERGE': POMERGE}) diff --git a/flower/SConscript b/flower/SConscript index e4d36036e6..8b7d6e9866 100644 --- a/flower/SConscript +++ b/flower/SConscript @@ -2,6 +2,7 @@ Import ('env') sources = env['src_glob'] (env, '*.cc') +includes = env['src_glob'] (env, '*.hh') outdir = Dir ('.').path # abs_srcdir = Dir ('.').srcnode ().abspath @@ -14,3 +15,8 @@ if env['static']: e.Library (name, sources) if not env['static'] or env['shared']: e.SharedLibrary (name, sources) + +#pot = env.POT (sources + includes) +#map (lambda x: e.Depends +pot = env.Command (env['pottarget'], sources + includes, env['potcommand']) +env.Alias ('pot', pot) diff --git a/lily/SConscript b/lily/SConscript index d027ea99e0..224b8a4236 100644 --- a/lily/SConscript +++ b/lily/SConscript @@ -21,4 +21,5 @@ lily = e.Program (name, sources) env.Install (env['bindir'], lily) env.Alias ('install', env['bindir']) -env.Alias ('lily', lily) +#po = e.PO (sources + includes) +#env.Alias ('po', po) diff --git a/po/SConscript b/po/SConscript new file mode 100644 index 0000000000..07696b6244 --- /dev/null +++ b/po/SConscript @@ -0,0 +1,22 @@ +# -*-python-*- + +Import ('env') +pos = env['glob'] (env, '*.po') +#pot = env['glob'] (env, '*.pot') +#pot = 'lilypond' +mos = map (env.MO, pos) +dir = env['localedir'] +env.Install (dir, mos) +env.Alias ('install', dir) + + + +outdir = Dir ('.').abspath +env.Depends ('po', 'pot') +env.Depends ('po', env['pottarget']) + +#pots = map (lambda x: outdir + '/' + x + '.po', pos) +map (lambda x: env.Depends (outdir + '/lilypond.pot', x), pos) +poms = map (env.POMERGE, pos) +env.Alias ('po', poms) + diff --git a/scm/SConscript b/scm/SConscript index c0c45dd4df..0559bbc8cd 100644 --- a/scm/SConscript +++ b/scm/SConscript @@ -1,7 +1,7 @@ # -*-python-*- Import ('env') -sources = env['src_glob'] (env, '*.scm') +sources = env['glob'] (env, '*.scm') dir = env['sharedir_package_version'] + '/scm' env.Install (dir, sources) env.Alias ('install', dir) diff --git a/scripts/SConscript b/scripts/SConscript index d69b615b8a..859c7b7cc1 100644 --- a/scripts/SConscript +++ b/scripts/SConscript @@ -8,3 +8,6 @@ gen_files = map (lambda x: os.path.splitext (x)[0], sources) gens = map (env.AT_COPY, sources) dir = env['bindir'] env.Install (dir, gen_files) + +#pot = env.POT (sources) +#env.Alias ('pot', pot) -- 2.39.5