From: janneke Date: Fri, 9 Jul 2004 15:02:11 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.9^2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6407fbd32972796fe48d8558196b2615f5ab5fd4;p=lilypond.git *** empty log message *** --- diff --git a/Documentation/SConscript b/Documentation/SConscript index d2aad2c257..57f8db9787 100644 --- a/Documentation/SConscript +++ b/Documentation/SConscript @@ -6,7 +6,8 @@ import os here = os.getcwd () reldir = str (Dir ('.').srcnode ()) os.chdir (reldir) -sources = glob.glob ('*.tely') + glob.glob ('user/*.tely') +###sources = glob.glob ('*.tely') + glob.glob ('user/*.tely') +sources = ['user/lilypond.tely', 'user/music-glossary.tely'] os.chdir (here) Import ('env') @@ -29,9 +30,13 @@ LILYPONDPREFIX = env['LILYPONDPREFIX'] mfbuild = os.path.join (env['absbuild'], 'mf', env['out']) +lilybuild = os.path.join (env['absbuild'], 'lily', env['out']) +userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out']) e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'feta16list.ly')) e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly')) +##e.Depends ('lilypond.texi', os.path.join (userbuild, 'music-glossary.texi')) e.Depends ('lilypond.texi', 'lilypond-internals.texi') +e.Depends ('lilypond.texi', os.path.join (lilybuild, 'lilypond-bin')) e.Command ('lilypond-internals.texi', LILYPOND_BIN, ('(cd $$(dirname $TARGET) && \ @@ -40,9 +45,16 @@ e.Command ('lilypond-internals.texi', LILYPOND_BIN, + ' ' + os.path.join (env['srcdir'], 'ly/generate-documentation')\ + ')') % vars ()) -docs = e.Tely2pdf (sources) +doc_stems = map (lambda x: os.path.splitext (x)[0], sources) +texis = map (e.Tely2texi, doc_stems) +dvis = map (e.Texi2dvi, doc_stems) +pss = map (e.PostScript, doc_stems) +pdfs = map (e.Dvi2pdf, doc_stems) -e.Alias ('doc', docs) +e.Alias ('doc', texis) +e.Alias ('doc', dvis) +e.Alias ('doc', pss) +e.Alias ('doc', pdfs) #testing all_sources = ['SConscript',] + sources diff --git a/SConstruct b/SConstruct index 8c6f0edd94..a29592389d 100644 --- a/SConstruct +++ b/SConstruct @@ -28,6 +28,10 @@ prefix=os.path.join (os.environ['HOME'], 'usr', 'pkg', 'lilypond') # TODO: +# * separate environments? +# - compile environment checks headers and libraries +# - doc environment checks doc stuff +# # * running from build-dir, without installing? # - scons will not install, if PREFIX lives outside of CWD # - build symlink tree @@ -337,8 +341,11 @@ env['LILYPOND_BOOK_PATH'] = ['.', '#/input', '#/input/regression', '#/Documentation/user', os.path.join (absbuild, 'Documentation', out)] +env['MAKEINFO_PATH'] = ['.', '#/Documentation/user', + os.path.join (absbuild, 'Documentation', out)] + ## TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper) -env['TEXINFO_PAPERSIZE_OPTION'] = '-t@afourpaper' +env['TEXINFO_PAPERSIZE_OPTION'] = '-t @afourpaper' SConscript ('buildscripts/builder.py') diff --git a/buildscripts/builder.py b/buildscripts/builder.py index fa6c989dbf..c7c87474ff 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -19,7 +19,9 @@ def join_path (path, infix=os.pathsep, prefix = ''): return x return string.join (map (lambda x: prefix + dir (x), path), infix) +MAKEINFO_INCLUDES = join_path (env['MAKEINFO_PATH'], '', ' -I') a = env['MAKEINFO'] + verbose_opt (env, ' --verbose') \ + + MAKEINFO_INCLUDES \ + ' --no-split --no-headers --output=$TARGET $SOURCE' texi2txt = Builder (action = a, suffix = '.txt', src_suffix = '.texi') @@ -47,33 +49,32 @@ if os.environ.has_key ('TEXMF'): env.Append (ENV = {'TEXMF' : '{' + LILYPONDPREFIX + ',' \ + os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}' }) +## + ' --output=$$(basename $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\ a = (r'''rm -f $$(grep -LF '\lilypondend' $$(dirname $TARGET))/lily-*.tex 2>/dev/null;''' \ + 'LILYPONDPREFIX=%(LILYPONDPREFIX)s '\ + PYTHON + ' ' + LILYPOND_BOOK + verbose_opt (env, ' --verbose')\ + ' --include=$$(dirname $TARGET) %(LILYPOND_BOOK_INCLUDES)s'\ + r""" --process='%(LILYPOND_BIN)s %(LILYPOND_BOOK_INCLUDES)s'"""\ - + ' --output=$$(basename $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\ + + ' --output=$$(dirname $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\ %(LILYPOND_BOOK_FLAGS)s\ $SOURCE') % vars () - -tely2pdf = Builder (action = a, suffix = '.texi', src_suffix = '.tely') - -env.Append (BUILDERS = {'Tely2pdf': tely2pdf}) +tely2texi = Builder (action = a, suffix = '.texi', src_suffix = '.tely') +env.Append (BUILDERS = {'Tely2texi': tely2texi}) TEXINFO_PAPERSIZE_OPTION = env['TEXINFO_PAPERSIZE_OPTION'] a = '(cd $$(dirname $TARGET) &&\ - texi2dvi --batch %(TEXINFO_PAPERSIZE_OPTION)s $$(basename $SOURCE)' % vars () - + texi2dvi --batch %(TEXINFO_PAPERSIZE_OPTION)s $$(basename $SOURCE))' % vars () texi2dvi = Builder (action = a, suffix = '.dvi', src_suffix = '.texi') - env.Append (BUILDERS = {'Texi2dvi': texi2dvi}) - -# $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi -# mkdir -p $(dir $@) -# $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(builddir)/Documentation/texinfo.css --html $< -# $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(builddir)/Documentation/texinfo.css --html --no-split --no-headers $< -# perl -i~ -pe 's!../lilypond-internals!lilypond-internals/!g' $(outdir)/lilypond.html -# rm -f $(outdir)/lilypond/*.png $(outdir)/lilypond/*.ly -# -ln -f $(outdir)/*.png $(outdir)/*.ly $(outdir)/lilypond/ - +env.Append (DVIPSFLAGS = '-Ppdf -ta4 +u lilypond.map') + +DVIPS_PAPERSIZE = 'a4' +DVIPSFLAGS = env['DVIPSFLAGS'] +a = ('dvips %(DVIPSFLAGS)s' \ + + ' -o $TARGET.pdfps'\ + + ' -t %(DVIPS_PAPERSIZE)s $SOURCE &&'\ + + ' ps2pdf -sPAPERSIZE=%(DVIPS_PAPERSIZE)s $TARGET.pdfps $TARGET') \ + % vars () +dvi2pdf = Builder (action = a, suffix = '.pdf', src_suffix = '.dvi') +env.Append (BUILDERS = {'Dvi2pdf': dvi2pdf}) diff --git a/python/lilylib.py b/python/lilylib.py index 5652f6faff..220d30bae4 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -235,7 +235,7 @@ def setup_temp (): def command_name (cmd): - # deal with "((latex ) >& 1 ) .." too + # deal with "((latex ) >& 1 ) .." too cmd = re.match ("([\(\)]*)([^ ]*)", cmd).group(2) return os.path.split (cmd)[1]