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]..
bindir = bindir,
sharedir = sharedir,
lilypond_datadir = sharedir_package,
+ localedir = localedir,
local_lilypond_datadir = sharedir_package_version,
lilypondprefix = lilypondprefix,
sharedir_package = sharedir_package,
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'])
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})
Import ('env')
sources = env['src_glob'] (env, '*.cc')
+includes = env['src_glob'] (env, '*.hh')
outdir = Dir ('.').path
# abs_srcdir = Dir ('.').srcnode ().abspath
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)
env.Install (env['bindir'], lily)
env.Alias ('install', env['bindir'])
-env.Alias ('lily', lily)
+#po = e.PO (sources + includes)
+#env.Alias ('po', po)
--- /dev/null
+# -*-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)
+
# -*-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)
gens = map (env.AT_COPY, sources)
dir = env['bindir']
env.Install (dir, gen_files)
+
+#pot = env.POT (sources)
+#env.Alias ('pot', pot)