From 1cb85fd64f8024816275e6333063d2b3f57887a6 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 27 Mar 2001 16:38:36 +0200 Subject: [PATCH] patch::: 1.3.143.jcn2 1.3.143.jcn2 ============ * Added environment settings to ly2dvi and lilypond-book. * Bugfix: make diff links diff into patch-dir, like make release. * Bugfix: make diff/release for different configs. * Bugfix: convert-ly: don't change item name ChordName to ChordNames. * Added flag (LilyPond-kick-xdvi) to LilyPond emacs mode to allow simultaneous view processes. --- CHANGES | 14 +++++++++++++ VERSION | 2 +- 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 ++-- lilypond-mode.el | 31 ++++++++++++++++------------ scripts/convert-ly.py | 1 + scripts/lilypond-book.py | 24 ++++++++++++++++++++++ scripts/ly2dvi.py | 29 ++++++++++++++++++++++---- scripts/update-lily.py | 1 + stepmake/bin/package-diff.py | 35 ++++++++++++++++++++++---------- stepmake/bin/release.py | 2 +- stepmake/stepmake/package.make | 3 ++- 16 files changed, 173 insertions(+), 50 deletions(-) create mode 100644 input/bugs/lyrics-spacing.ly diff --git a/CHANGES b/CHANGES index cbdfc1be33..74a6a0dd35 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +1.3.143.jcn2 +============ + +* Added environment settings to ly2dvi and lilypond-book. + +* Bugfix: make diff links diff into patch-dir, like make release. + +* Bugfix: make diff/release for different configs. + +* Bugfix: convert-ly: don't change item name ChordName to ChordNames. + +* Added flag (LilyPond-kick-xdvi) to LilyPond emacs mode to allow +simultaneous view processes. + 1.3.143.jcn1 ============ diff --git a/VERSION b/VERSION index 74ac448509..ad508afa16 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=143 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilypond-login.sh b/buildscripts/lilypond-login.sh index 38fb855e80..436c53d0c1 100755 --- 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 100755 --- 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/lilypond-mode.el b/lilypond-mode.el index 15dc21ae6e..a72f32a034 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -3,7 +3,7 @@ ;;; ;;; source file of the GNU LilyPond music typesetter ;;; -;;; (c) 1999, 2000 Jan Nieuwenhuizen +;;; (c) 1999--2001 Jan Nieuwenhuizen ;;; Inspired on auctex @@ -19,7 +19,7 @@ (require 'easymenu) (require 'compile) -(defconst LilyPond-version "1.3.103" +(defconst LilyPond-version "1.3.143" "`LilyPond-mode' version number.") (defconst LilyPond-help-address "bug-gnu-music@gnu.org" @@ -28,6 +28,9 @@ (defvar LilyPond-mode-hook nil "*Hook called by `LilyPond-mode'.") +(defvar LilyPond-kick-xdvi nil + "If true, no simultaneous xdvi's are started, but reload signal is sent.") + (defvar LilyPond-regexp-alist '(("\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2)) "Regexp used to match LilyPond errors. See `compilation-error-regexp-alist'.") @@ -305,17 +308,19 @@ command." (if entry (let ((command (LilyPond-command-expand (cadr entry) (apply file nil)))) - (let* ( - (buffer-xdvi (get-buffer "*view*")) - (process-xdvi (if buffer-xdvi (get-buffer-process buffer-xdvi) nil))) - (if (and process-xdvi - (string-equal name "View")) - ;; Don't open new xdvi window, but force redisplay - ;; We could make this an option. - (signal-process (process-id process-xdvi) 'SIGUSR1) - (progn - (setq LilyPond-command-default name) - (LilyPond-compile-file command name)))))))) + (if (string-equal name "View") + (let ((buffer-xdvi (get-buffer-create "*view*"))) + (if LilyPond-kick-xdvi + (let ((process-xdvi (get-buffer-process buffer-xdvi))) + (if process-xdvi + ;; Don't open new xdvi window, but force redisplay + ;; We could make this an option. + (signal-process (process-id process-xdvi) 'SIGUSR1) + (start-process-shell-command name buffer-xdvi command))) + (start-process-shell-command name buffer-xdvi command))) + (progn + (setq LilyPond-command-default name) + (LilyPond-compile-file command name))))))) ;; XEmacs stuff ;; Sadly we need this for a macro in Emacs 19. diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index e24b537299..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')) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index e15ee356dd..e4bb7ffef3 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -44,6 +44,29 @@ program_version = '@TOPLEVEL_VERSION@' if program_version == '@' + 'TOPLEVEL_VERSION' + '@': program_version = '1.4pre' +# +# 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 + + + include_path = [os.getcwd()] @@ -1219,6 +1242,7 @@ if g_outdir: error ("outdir is a file: %s" % g_outdir) if not os.path.exists(g_outdir): os.mkdir(g_outdir) +setup_environment () for input_filename in files: do_file(input_filename) diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index ccd80c8378..56de2cb14a 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -20,9 +20,6 @@ TODO: * head/header tagline/endfooter - * check/set TEXINPUTS: see to it that/warn if not/ - kpathsea can find titledefs.tex? - * dvi from lilypond .tex output? This is hairy, because we create dvi from lilypond .tex *and* header output. @@ -43,7 +40,8 @@ import __main__ import operator import tempfile -sys.path.append ('@datadir@/python') +datadir = '@datadir@' +sys.path.append (datadir + '/python') try: import gettext gettext.bindtextdomain ('lilypond', '@localedir@') @@ -107,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)) @@ -544,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) diff --git a/scripts/update-lily.py b/scripts/update-lily.py index 4248459bb8..1e2c75afee 100644 --- a/scripts/update-lily.py +++ b/scripts/update-lily.py @@ -222,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), 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