* GNUmakefile.in: Generate builddir locale tree too.
* scripts/ly2dvi.py:
* scripts/midi2ly.py:
* scripts/mup2ly.py:
* scripts/update-lily.py:
* lily/main.cc (setup_paths): Fix for locales setup.
+2002-11-03 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * stepmake/stepmake/po-targets.make: Remove --c++ option.
+
+ * scripts/midi2ly.py: Fix global syntax warnings.
+
+ * GNUmakefile.in: Generate builddir locale tree too.
+
+ * scripts/ly2dvi.py:
+ * scripts/midi2ly.py:
+ * scripts/mup2ly.py:
+ * scripts/update-lily.py:
+ * lily/main.cc (setup_paths): Fix for locales setup.
+
2002-10-29 Jan Nieuwenhuizen <janneke@gnu.org>
* Documentation/windows/installing.texi: Soften wording about
builddir-setup: $(builddir)/share/lilypond-force
+PO_FILES = $(wildcard $(srcdir)/po/*.po)
+HELP_CATALOGS = $(PO_FILES:$(srcdir)/po/%.po=%)
+CATALOGS = $(HELP_CATALOGS:lilypond=)
+
$(builddir)/share/lilypond-force:
# Preparing LilyPond tree for builddir exec
cd $(builddir) && rm -rf share
ln -s ../../../mf/$(outconfbase) afm && \
ln -s ../../../mf/$(outconfbase) tfm && \
ln -s ../../../mf/$(outconfbase) type1
+ $(foreach i,$(CATALOGS), \
+ mkdir -p $(builddir)/share/locale/$i/LC_MESSAGES && \
+ cd $(builddir)/share/locale/$i/LC_MESSAGES && \
+ ln -fs ../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true
touch $@
local-clean: builddir-setup-clean
prefix_directory[1] = lilypond_prefix;
#if HAVE_GETTEXT
- setlocale (LC_ALL, ""); /* enable locales */
- setlocale (LC_NUMERIC, "C"); /* musn't have comma's in TeX output... */
+ /* Enable locales */
+ setlocale (LC_ALL, "");
+ /* Mustn't have commas in TeX output... */
+ setlocale (LC_NUMERIC, "C");
String lily_locale_dir;
String name (PACKAGE);
name.to_lower ();
-
- /*
- urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share
- handy for multiple source-dir runs, though...
- */
- if (!String (prefix_directory[0]).empty_b ())
- {
- lily_locale_dir = String (prefix_directory[0]) + "/share/locale";
- bindtextdomain (name.to_str0 (), lily_locale_dir.to_str0 ());
- }
- else
- bindtextdomain (name.to_str0 (), LOCALEDIR);
+ bindtextdomain (name.to_str0 (), LOCALEDIR);
textdomain (name.to_str0 ());
#endif
verbose_p = 0
-
+localedir = '@localedir@'
try:
import gettext
gettext.bindtextdomain ('lilypond', localedir)
except:
pass
+localedir = '@localedir@'
try:
import gettext
gettext.bindtextdomain ('lilypond', localedir)
name = re.match ('[ \t]*([^ \t]*)', cmd).group (1)
msg = name + ': ' + _ ("command exited with value %d") % st
if ignore_error:
- if not quiet:
+ if not quiet or verbose_p:
warning (msg + ' ' + _ ("(ignored)") + ' ')
else:
error (msg)
-kpse = os.popen ('kpsexpand \$TEXMF').read()
-kpse = re.sub('[ \t\n]+$','', kpse)
-type1_paths = os.popen ('kpsewhich -expand-path=\$T1FONTS').read ()
-
-environment = {
- # TODO: * prevent multiple addition.
- # * clean TEXINPUTS, MFINPUTS, TFMFONTS,
- # as these take prevalence over $TEXMF
- # and thus may break tex run?
- 'TEXMF' : "{%s,%s}" % (datadir, kpse) ,
- 'GS_FONTPATH' : type1_paths,
- 'GS_LIB' : datadir + '/ps',
-}
-
# tex needs lots of memory, more than it gets by default on Debian
non_path_environment = {
'extra_mem_top' : '1000000',
'pool_size' : '250000',
}
+def command_name (cmd):
+ return re.match ('^[ \t]*([^ \t]*)', cmd).group (1)
+
+def error_log (name):
+ return os.path.join (__main__.temp_dir, '%s.errorlog' % name)
+
+def read_pipe (cmd, mode = 'r'):
+ redirect = ''
+ if verbose_p:
+ progress (_ ("Opening pipe `%s\'") % cmd)
+ redirect = ' 2>%s' % error_log (command_name (cmd))
+ pipe = os.popen (cmd + redirect, mode)
+ output = pipe.read ()
+ status = pipe.close ()
+ # successful pipe close returns 'None'
+ if not status:
+ status = 0
+ signal = 0x0f & status
+ exit_status = status >> 8
+
+ if status:
+ sys.stderr.write (_ ("`%s\' failed (%d)") % (cmd, exit_status))
+ if not verbose_p:
+ sys.stderr.write (_ ("The error log is as follows:"))
+ sys.stderr.write (open (error_log (command_name (cmd)).read ()))
+ sys.exit (status)
+ if __main__.verbose_p:
+ progress ('\n')
+ return output
+
def setup_environment ():
+ global environment
+
+ kpse = read_pipe ('kpsexpand \$TEXMF')
+ texmf = re.sub ('[ \t\n]+$','', kpse)
+ type1_paths = read_pipe ('kpsewhich -expand-path=\$T1FONTS')
+
+ environment = {
+ # TODO: * prevent multiple addition.
+ # * clean TEXINPUTS, MFINPUTS, TFMFONTS,
+ # as these take prevalence over $TEXMF
+ # and thus may break tex run?
+ 'TEXMF' : "{%s,%s}" % (datadir, texmf) ,
+ 'GS_FONTPATH' : type1_paths,
+ 'GS_LIB' : datadir + '/ps',
+ }
+
# $TEXMF is special, previous value is already taken care of
if os.environ.has_key ('TEXMF'):
del os.environ['TEXMF']
if outdir != '.' and (track_dependencies_p or targets):
mkdir_p (outdir, 0777)
- setup_environment ()
tmpdir = setup_temp ()
+ setup_environment ()
# to be sure, add tmpdir *in front* of inclusion path.
#os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
#
# source file of the GNU LilyPond music typesetter
#
-# convert MIDI to LilyPond source
-#
+# (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# Jan Nieuwenhuizen <janneke@gnu.org>
'''
return (o, n, a)
def dump (self):
+ global reference_note
s = chr ((self.notename + 2) % 7 + ord ('a'))
s = s + self.alteration_names[self.alteration + 2]
if absolute_p:
s = s + "," * -commas
if explicit_durations_p \
- or Duration.compare (self.duration, reference_note.duration):
+ or Duration.compare (self.duration,
+ reference_note.duration):
s = s + self.duration.dump ()
- global reference_note
reference_note = self
# TODO: move space
elif o == '--absolute-pitches' or o == '-a':
- global absolute_p
absolute_p = 1
elif o == '--duration-quant' or o == '-d':
- global duration_quant
duration_quant = string.atoi (a)
elif o == '--explicit-durations' or o == '-e':
- global explicit_durations_p
explicit_durations_p = 1
elif o == '--key' or o == '-k':
(alterations, minor) = map (string.atoi, string.split (a + ':0', ':'))[0:2]
sharps = alterations
else:
flats = - alterations
- global key
key = Key (sharps, flats, minor)
elif o == '--start-quant' or o == '-s':
start_quant = string.atoi (a)
keep_temp_dir_p = 0
verbose_p = 0
+localedir = '@localedir@'
try:
import gettext
- gettext.bindtextdomain ('lilypond', '@localedir@')
+ gettext.bindtextdomain ('lilypond', localedir)
gettext.textdomain ('lilypond')
_ = gettext.gettext
except:
patch_dir = build_root + '/patches'
-
+localedir = '@localedir@'
try:
import gettext
- gettext.bindtextdomain ('lilypond', '@localedir@')
+ gettext.bindtextdomain ('lilypond', localedir)
gettext.textdomain ('lilypond')
_ = gettext.gettext
except: