From 15623d9ba7ae386cb2b8004d5135c5af7a8338a4 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:59:30 +0000 Subject: [PATCH] lilypond-1.3.144 --- buildscripts/lilypond-login.sh | 12 +++-- buildscripts/lilypond-profile.sh | 32 +++++++++---- input/bugs/lyrics-spacing.ly | 27 +++++++++++ input/test/american-chords.ly | 4 +- input/test/chords.ly | 2 +- input/test/jazz-chords.ly | 4 +- scripts/convert-ly.py | 8 ++++ scripts/ly2dvi.py | 79 ++++++++++++++++++++++++++------ scripts/update-lily.py | 32 +++++++++---- stepmake/bin/package-diff.py | 35 +++++++++----- stepmake/bin/release.py | 2 +- stepmake/stepmake/package.make | 3 +- 12 files changed, 185 insertions(+), 55 deletions(-) create mode 100644 input/bugs/lyrics-spacing.ly diff --git a/buildscripts/lilypond-login.sh b/buildscripts/lilypond-login.sh index 38fb855e80..436c53d0c1 100644 --- a/buildscripts/lilypond-login.sh +++ b/buildscripts/lilypond-login.sh @@ -1,12 +1,14 @@ #!/bin/csh -# env. vars for the C-shell. -# set environment for LilyPond. To be installed in /etc/profile.d/ +# Setup TeX/LaTeX Ghostscript C-shell environment for LilyPond. +# +# Red Hat-like systems should install this in /etc/profile.d/ -setenv GS_FONTPATH "@datadir@/afm" +setenv GS_FONTPATH "@datadir@/afm:@datadir@/pfa:$GS_FONTPATH" +setenv GS_LIB "@datadir@/ps:$GS_LIB" # bit silly. for ly2dvi, overrules compiled-in datadir... -setenv LILYPONDPREFIX "@datadir@" +# setenv LILYPONDPREFIX "@datadir@" # include an empty path component for the system wide includes. if ($?MFINPUTS) then @@ -19,7 +21,7 @@ if ($?TEXINPUTS) then else setenv TEXINPUTS "/usr/share/lilypond/tex::" endif -if ($?TEXINPUTS) then +if ($?TFMFONTS) then setenv TFMFONTS "@datadir@/tfm:$TFMFONTS" else setenv TFMFONTS "@datadir@/tfm:" diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 48e60c0f3e..576a30b9fe 100644 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -1,20 +1,34 @@ #!/bin/sh +# Setup TeX/LaTeX Ghostscript environment for LilyPond. -# set environment for LilyPond. To be installed in /etc/profile.d/ -GS_FONTPATH="@datadir@/afm:@datadir@/pfa" +# Red Hat-like systems should install this in /etc/profile.d/ + +# This is a bit of a kludge. Ideally, lilypond's tex, afm, pfa, ps +# directories should be installed into their location in the texmf/gs +# trees, rather than messing around with environment variables (eg, +# see Debian or SuSE package). + +datadir="@datadir@" + +# For direct ps output fonts +GS_FONTPATH="$datadir/afm:$datadir/pfa" + +# For direct ps output: ps/lilyponddefs.ps +GS_LIB="$datadir/ps" # bit silly. for ly2dvi, overrules compiled-in datadir... -LILYPONDPREFIX="@datadir@" +# Better comment this out. Compiled-in datadir serves exactly the +# same purpose, but is more likely to be correct (think multiple +# versions of lilypond). +# LILYPONDPREFIX="$datadir" # include an empty path component for the system wide includes. -MFINPUTS="@datadir@/mf:"${MFINPUTS:=":"} -TEXINPUTS="@datadir@/tex:@datadir@/ps:"${TEXINPUTS:=":"} - -# TFMFONTS="@datadir@/tfm:$TFMFONTS" +MFINPUTS="$datadir/mf:"${MFINPUTS:=":"} +TEXINPUTS="$datadir/tex:$datadir/ps:"${TEXINPUTS:=":"} +TFMFONTS="$datadir/tfm:"${TFMFONTS:=":"} -## gs_lib ??? -export LILYINCLUDE LILYPONDPREFIX MFINPUTS TEXINPUTS GS_LIB GS_FONTPATH +export MFINPUTS TEXINPUTS TFMFONTS GS_LIB GS_FONTPATH diff --git a/input/bugs/lyrics-spacing.ly b/input/bugs/lyrics-spacing.ly new file mode 100644 index 0000000000..bb43fbc2f6 --- /dev/null +++ b/input/bugs/lyrics-spacing.ly @@ -0,0 +1,27 @@ +\include "norsk.ly" + +\header { +texidoc ="``baz'' should be centered on the a (tenor voice), but it is +not."; +} + +\version "1.3.140"; + +sop = \notes \transpose c'' {e2 e fis1 } +alt = \notes \relative c' {cis2 e e d } +ten = \notes \relative c' {a2 a a1 } +txt = \lyrics {foo2 bar baz jazz } + +\score { + < + \context Staff = up \notes < + \context Voice=sopv {\stemUp \sop} + \context Voice=altv {\stemDown \alt} + > + \context Staff = down \notes < \clef "F"; + \context Voice=tenv {\stemUp \ten} + > + \context Lyrics = la { \txt } + > + \paper { linewidth = -1; } +} diff --git a/input/test/american-chords.ly b/input/test/american-chords.ly index 0b356c2980..6adc6167d3 100644 --- a/input/test/american-chords.ly +++ b/input/test/american-chords.ly @@ -48,8 +48,8 @@ scheme = \chords { \paper { \translator { \ChordNamesContext - ChordNames \override #'word-space = #1 - ChordNames \override #'style = #'american + ChordName \override #'word-space = #1 + ChordName \override #'style = #'american } } } diff --git a/input/test/chords.ly b/input/test/chords.ly index 051ea928d4..14669e7a00 100644 --- a/input/test/chords.ly +++ b/input/test/chords.ly @@ -62,7 +62,7 @@ keys = \notes{ \paper{ \translator { \ChordNamesContext - ChordNames \override #'word-space = #1 + ChordName \override #'word-space = #1 } } } diff --git a/input/test/jazz-chords.ly b/input/test/jazz-chords.ly index 59f350aebb..9ff4455d7f 100644 --- a/input/test/jazz-chords.ly +++ b/input/test/jazz-chords.ly @@ -60,8 +60,8 @@ scheme = \chords { \paper { \translator { \ChordNamesContext - ChordNames \override #'word-space = #1 - ChordNames \override #'style = #'jazz + ChordName \override #'word-space = #1 + ChordName \override #'style = #'jazz } } } diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index c27f2f19d3..583d7f5f9e 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -675,6 +675,7 @@ if 1: str = re.sub ('LyricVoice', 'LyricsVoice', str) # old fix str = re.sub ('Chord[Nn]ames*.Chord[Nn]ames*', 'ChordNames.ChordName', str) + str = re.sub ('Chord[Nn]ames([ \t\n]+\\\\override)', 'ChordName\\1', str) return str conversions.append (((1,3,113), conv, 'LyricVoice -> LyricsVoice')) @@ -773,6 +774,13 @@ if 1: conversions.append (((1,3,141), conv, 'xNoDots -> xSolid')) +if 1: + def conv (str): + str = re.sub ('([Cc])horda', '\\1orda', str) + return str + + conversions.append (((1,3,144), conv, 'Chorda -> Corda')) + ############################ diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 8d81d27fc8..56de2cb14a 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -16,12 +16,16 @@ TODO: endfooter=\tagline -> 'lily was here ' } + lilytagline (->lily was here), usertagline, copyright etc. + * head/header tagline/endfooter * dvi from lilypond .tex output? This is hairy, because we create dvi from lilypond .tex *and* header output. - * windows compatibility: rm -rf, cp file... dir + * multiple \score blocks? + + * windows-sans-cygwin compatibility? rm -rf, cp file... dir ''' @@ -36,11 +40,16 @@ import __main__ import operator import tempfile -sys.path.append ('@datadir@/python') -import gettext -gettext.bindtextdomain ('lilypond', '@localedir@') -gettext.textdomain('lilypond') -_ = gettext.gettext +datadir = '@datadir@' +sys.path.append (datadir + '/python') +try: + import gettext + gettext.bindtextdomain ('lilypond', '@localedir@') + gettext.textdomain('lilypond') + _ = gettext.gettext +except: + def _ (s): + return s layout_fields = ['title', 'subtitle', 'subsubtitle', 'footer', 'head', @@ -96,6 +105,27 @@ temp_dir = '%s.dir' % program_name keep_temp_dir_p = 0 verbose_p = 0 +# +# Try to cater for bad installations of LilyPond, that have +# broken TeX setup. Just hope this doesn't hurt good TeX +# setups. Maybe we should check if kpsewhich can find +# feta16.{afm,mf,tex,tfm}, and only set env upon failure. +# +environment = { + 'MFINPUTS' : datadir + '/mf:', + 'TEXINPUTS': datadir + '/tex:' + datadir + '/ps:.:', + 'TFMFONTS' : datadir + '/tfm:', + 'GS_FONTPATH' : datadir + '/afm:' + datadir + '/pfa', + 'GS_LIB' : datadir + '/ps', +} + +def setup_environment (): + for key in environment.keys (): + val = environment[key] + if os.environ.has_key (key): + val = val + os.pathsep + os.environ[key] + os.environ[key] = val + def identify (): sys.stdout.write ('%s (GNU LilyPond) %s\n' % (program_name, program_version)) @@ -222,7 +252,7 @@ def system (cmd, ignore_error = 0): def cleanup_temp (): if not keep_temp_dir_p: if verbose_p: - progress (_ ('Cleaning up `%s\'') % temp_dir) + progress (_ ("Cleaning %s...") % temp_dir) system ('rm -rf %s' % temp_dir) @@ -388,9 +418,10 @@ def global_latex_definition (tfiles, extra): orientation = extra['orientation'][0] # set sane geometry width (a4-width) for linewidth = -1. - linewidth = extra['linewidth'][0] - if linewidth < 0: + if not extra['linewidth'] or extra['linewidth'][0] < 0: linewidth = 597 + else: + linewidth = extra['linewidth'][0] s = s + '\geometry{width=%spt%s,headheight=2mm,headsep=0pt,footskip=2mm,%s}\n' % (linewidth, textheight, orientation) s = s + r''' @@ -419,7 +450,7 @@ def global_latex_definition (tfiles, extra): s = s + r''' \makeatletter -\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\lilypondtagline}}% +\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\makelilypondtagline}}% \makeatother ''' s = s + '\\end{document}' @@ -532,6 +563,8 @@ files = map (lambda x: strip_extension (x, '.ly'), files) if files: setup_temp () + setup_environment () + extra = extra_init dvi_name = do_files (files, extra) @@ -556,11 +589,22 @@ if files: type = 'DVI' dest = os.path.join (outdir, dest) + midi = base + '.midi' + midi = os.path.join (outdir, midi) + if outdir != '.': system ('mkdir -p %s' % outdir) - system ('cp \"%s\" \"%s\"' % (srcname, dest )) - if re.match ('[.]midi', string.join (os.listdir ('.'))): - system ('cp *.midi %s' % outdir, ignore_error = 1) + + #if re.match ('.*[.]dvi', string.join (os.listdir ('.'))): + if os.path.isfile (srcname): + # huh, and what bout all other (-1, -2) scores? + system ('cp \"%s\" \"%s\"' % (srcname, dest)) + else: + dest = 0 + if re.match ('.*[.]midi', string.join (os.listdir ('.'))): + system ('cp *.midi %s' % outdir) + else: + midi = 0 depfile = os.path.join (outdir, base + '.dep') @@ -571,8 +615,13 @@ if files: cleanup_temp () # most insteresting info last - progress (_ ("dependencies output to %s...") % depfile) - progress (_ ("%s output to %s...") % (type, dest)) + # don't say silly things + if os.path.isfile (depfile): + progress (_ ("dependencies output to %s...") % depfile) + if dest and os.path.isfile (dest): + progress (_ ("%s output to %s...") % (type, dest)) + if midi and os.path.isfile (midi): + progress (_ ("%s output to %s...") % ('MIDI', midi)) diff --git a/scripts/update-lily.py b/scripts/update-lily.py index b758cccb28..1e2c75afee 100644 --- a/scripts/update-lily.py +++ b/scripts/update-lily.py @@ -9,8 +9,7 @@ ''' TODO: - * more flexible build paths - * cleanup previous tree + * more flexible build/ftp/patches/releases paths * flexible build command * show only? ''' @@ -26,6 +25,14 @@ import __main__ import operator import tempfile +try: + import gettext + gettext.bindtextdomain ('lilypond', '@localedir@') + gettext.textdomain('lilypond') + _ = gettext.gettext +except: + def _ (s): + return s sys.path.append ('@datadir@/python') import gettext @@ -38,7 +45,8 @@ program_name = 'build-lily' package_name = 'lilypond' help_summary = _("Fetch and rebuild from latest source package") build_root = os.environ ['HOME'] + '/usr/src' -build_command = './configure; make web' +build_command = '(./configure --prefix=$HOME/usr && make all web) >> log.txt 2>&1' + release_dir = build_root + '/releases' patch_dir = build_root + '/patches' @@ -46,6 +54,8 @@ url = 'file:/home/ftp/pub/gnu/LilyPond/development/lilypond-*.tar.gz' url = 'ftp://appel.lilypond.org/pub/gnu/LilyPond/development/lilypond-*.tar.gz' url = 'ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/development/lilypond-*.tar.gz' +remove_previous_p = 0 + # lily_py.py -- options and stuff # @@ -189,7 +199,7 @@ def system (cmd, ignore_error = 0): def cleanup_temp (): if not keep_temp_dir_p: if verbose_p: - progress (_ ('Cleaning up `%s\'') % temp_dir) + progress (_ ("Cleaning %s...") % temp_dir) system ('rm -rf %s' % temp_dir) @@ -212,6 +222,7 @@ option_definitions = [ ('DIR', 'b', 'build-root', _ ("unpack and build in DIR [%s]") % build_root), ('', 'h', 'help', _ ("this help")), ('', 'k', 'keep', _ ("keep all output, and name the directory %s") % temp_dir), + ('', 'r', 'remove-previous', _ ("remove previous build")), ('', 'V', 'verbose', _ ("verbose")), ('', 'v', 'version', _ ("print version number")), ('URL', 'u', 'url', _ ("fetch and build URL [%s]") % url), @@ -328,6 +339,8 @@ def find_latest (url): def build (p): os.chdir (build_root) system ('tar xzf %s/%s.tar.gz' % (release_dir, p)) + system ('rm -f building') + os.symlink ('%s/%s' % (build_root, p), 'building') os.chdir (p) return system (build_command) @@ -348,6 +361,8 @@ for opt in options: help () elif o == '--buid-root' or o == '-b': build_root = a + elif o == '--remove-previous' or o == '-r': + remove_previous_p = 1 elif o == '--url' or o == '-u': url = a elif o == '--verbose' or o == '-V': @@ -362,7 +377,8 @@ for opt in options: if 1: latest = find_latest (url) - if os.path.isdir ('%s/%s' % (build_root, latest)): + #if os.path.isdir ('%s/%s' % (build_root, latest)): + if os.path.isdir ('%s/%s/%s' % (build_root, latest, 'lily/out/lilypond')): progress (_ ("latest is %s") % latest) progress (_ ("relax, %s is up to date" % package_name)) sys.exit (0) @@ -387,15 +403,15 @@ if 1: progress (_ ("fetching %s...") % get) copy_url (get, '.') - build_command = './configure --prefix=$HOME/usr && make web' if not build (latest): if os.path.isdir ('%s/%s' % (build_root, package_name)): os.chdir ('%s/%s' % (build_root, package_name)) previous = os.getcwd () os.chdir (build_root) - system ('rm -f %s' % package_name) - system ('echo rm -rf %s/%s' % (build_root, previous)) + if remove_previous_p: + system ('echo rm -rf %s/%s' % (build_root, previous)) + system ('rm -f %s' % package_name) os.symlink ('%s/%s' % (build_root, latest), package_name) os.chdir (original_dir) diff --git a/stepmake/bin/package-diff.py b/stepmake/bin/package-diff.py index 16e8f992fc..bc2c8a8eba 100644 --- a/stepmake/bin/package-diff.py +++ b/stepmake/bin/package-diff.py @@ -49,6 +49,8 @@ def help (): 'Generate a patch to go to current version\n' ' -f, --from=FROM old is FROM\n' ' -h, --help print this help\n' + ' --outdir=DIR generate in DIR\n' + ' -o, --output=NAME write patch to NAME\n' ' -p, --package=DIR specify package\n' ' -r, --release diff against latest release\n' ' -t, --to=TO to version TO\n' @@ -57,12 +59,12 @@ def help (): ) def cleanup (): - global from_diff, to_diff, prev_cwd + global from_diff, to_diff, original_dir os.chdir ('/tmp/package-diff') sys.stderr.write ('Cleaning ... ') os.system ('rm -fr %s %s' % (from_diff, to_diff)) sys.stderr.write ('\n') - os.chdir (prev_cwd) + os.chdir (original_dir) def untar (fn): # os.system ('pwd'); @@ -176,11 +178,13 @@ def makediff (fromdir, todir, patch_name): os.environ['GZIP'] = '-q' -print 'argv: ' + string.join (sys.argv[2:]) +print 'argv: ' + string.join (sys.argv[1:]) (options, files) = getopt.getopt (sys.argv[1:], - 'hF:f:o:p:rT:t:', ['from=', 'dir-from=', 'dir-to=', 'help', 'output=', 'package=', 'release', 'to=']) + 'hF:f:o:p:rT:t:', ['conf=', 'from=', 'dir-from=', 'dir-to=', 'help', 'outdir=', 'output=', 'package=', 'release', 'to=']) patch_name = '' +conf = '' +outdir = '' from_src = '' to_src = '' release=0 @@ -200,8 +204,12 @@ for opt in options: elif o == '--help' or o == '-h': help () sys.exit (0) + elif o == '--outdir': + outdir = a + elif o == '--conf': + conf = a elif o == '--output' or o == '-o': - patch_name = os.path.join (os.getcwd (), a) + patch_name = a elif o == '-p' or o == '--package': topdir = a elif o == '--release' or o == '-r': @@ -241,7 +249,7 @@ if release: flags.from_version[1], flags.from_version[2], ''); import tempfile -prev_cwd = os.getcwd (); +original_dir = os.getcwd (); os.system ('rm -rf /tmp/package-diff') try: @@ -260,10 +268,15 @@ if to_diff == from_diff: sys.stderr.write (patch_name + ': nothing to do: to == from = ' + from_diff + '\n') sys.exit (1) +def compat_abspath (path): + return os.path.normpath (os.path.join (os.getcwd (), path)) + +if conf and not outdir: + outdir = 'out-' + conf + if not patch_name: - pn = to_diff + '.diff' - patch_name = os.path.join (os.getcwd (), 'out') - patch_name = os.path.join (patch_name, pn) + to_diff + '.diff' +patch_name = compat_abspath (os.path.join (outdir, to_diff + '.diff')) from_diff = '/tmp/package-diff/' + from_diff to_diff = '/tmp/package-diff/' + to_diff @@ -271,7 +284,7 @@ to_diff = '/tmp/package-diff/' + to_diff if not from_src: os.chdir ('/tmp/package-diff') untar (released_tarball (flags.from_version)) - os.chdir (prev_cwd) + os.chdir (original_dir) else: sys.stderr.write ('copying ' + from_src + ' to ' + from_diff + '\n') # os.system ('cp -pr %s %s' % (srcdir, from_diff)) @@ -284,7 +297,7 @@ else: if not to_src: os.chdir ('/tmp/package-diff') untar (released_tarball (flags.to_version)) - os.chdir (prev_cwd) + os.chdir (original_dir) else: sys.stderr.write ('copying ' + to_src + ' to ' + to_diff + '\n') os.system ('mkdir -p %s '% (to_diff)) diff --git a/stepmake/bin/release.py b/stepmake/bin/release.py index cc6d6ec5ed..4b563143da 100755 --- a/stepmake/bin/release.py +++ b/stepmake/bin/release.py @@ -61,7 +61,7 @@ except: os.link(orig, os.path.join (package.release_dir, tarball)) # urg: howto check exit code? -os.system(sys.executable + ' ' + package.topdir + '/stepmake/bin/package-diff.py --package=' + topdir) +os.system(sys.executable + ' ' + package.topdir + '/stepmake/bin/package-diff.py --outdir=%s --package=%s' % (outdir, topdir)) diffname = pn + '.diff.gz' rel_pn = package.patch_dir + diffname diff --git a/stepmake/stepmake/package.make b/stepmake/stepmake/package.make index 8c75e8cc01..f0fa0c0330 100644 --- a/stepmake/stepmake/package.make +++ b/stepmake/stepmake/package.make @@ -20,7 +20,8 @@ deb: makeflags=$(patsubst %==, %, $(patsubst ---%,,$(patsubst ----%,,$(MAKEFLAGS:%=--%)))) diff: - $(PYTHON) $(step-bindir)/package-diff.py --package=$(topdir) $(makeflags) + $(PYTHON) $(step-bindir)/package-diff.py --outdir=$(topdir)/$(outdir) --package=$(topdir) $(makeflags) + -ln -f $(depth)/$(outdir)/$(distname).diff.gz $(patch-dir) release: $(PYTHON) $(step-bindir)/release.py --outdir=$(topdir)/$(outdir) --package=$(topdir) -- 2.39.5