2002-06-16 Jan Nieuwenhuizen <janneke@gnu.org>
+ * GNUmakefile.in (builddir-setup): Bugfix: include srcdir/tex as
+ well as mf/out as subdirs of tex, for kpathsea to find through TEXMF.
+
+ * scripts/lilypond-book.py (environment): Bugfix: update to new
+ TEXMF scheme, from ly2dvi.
+
* lily/lookup.cc (slur): Invoke bezier-bow.
* scm/tex.scm (bezier-bow):
ln -s ../../../mf/$(outconfbase) tfm && \
ln -s ../../../$(srcdir)/mf && \
ln -s ../../../$(srcdir)/ps && \
- ln -s ../../../$(srcdir)/scm && \
- ln -s ../../../$(srcdir)/tex
+ ln -s ../../../$(srcdir)/scm
+ @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
+ mkdir tex
+ @cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/tex && \
+ ln -s ../../../../$(srcdir)/tex source && \
+ ln -s ../../../../mf/$(outconfbase) generate
@cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \
mkdir fonts
@cd $(depth)/$(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/fonts && \
while datadir[-1] == os.sep:
datadir= datadir[:-1]
-# 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.
+kpse = os.popen ('kpsexpand \$TEXMF').read()
+kpse = re.sub('[ \t\n]+$','', kpse)
+type1_paths = os.popen ('kpsewhich -expand-path=\$T1FONTS').read ()
+
environment = {
- 'MFINPUTS' : datadir + '/mf:',
- 'TEXINPUTS': datadir + '/tex:' + datadir + '/ps:.:',
- 'TFMFONTS' : datadir + '/tfm:',
- 'GS_FONTPATH' : datadir + '/afm:' + datadir + '/pfa',
+ # 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',
}
}
def setup_environment ():
+ # $TEXMF is special, previous value is already taken care of
+ if os.environ.has_key ('TEXMF'):
+ del os.environ['TEXMF']
+
for key in environment.keys ():
val = environment[key]
if os.environ.has_key (key):
f.close ()
for e in eps:
- cmd = r"tex '\nonstopmode \input %s'" % e
+ cmd = r"echo $TEXMF; tex '\nonstopmode \input %s'" % e
quiet_system (cmd, 'TeX')
cmd = r"dvips -E -o %s %s" % (e + '.eps', e)
type1_paths = os.popen ('kpsewhich -expand-path=\$T1FONTS').read ()
environment = {
- ## todo: prevent multiple addition.
+ # 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',
if os.environ.has_key ('TEXMF'):
del os.environ['TEXMF']
-
for key in environment.keys ():
val = environment[key]
if os.environ.has_key (key):