From: Jan Nieuwenhuizen Date: Sun, 11 Jul 2004 23:19:40 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.7~69 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=128fc77d2c86e4e0b7716512073d7e448b00c802;p=lilypond.git *** empty log message *** --- diff --git a/Documentation/user/SConscript b/Documentation/user/SConscript index 794c27c675..d83f978cd7 100644 --- a/Documentation/user/SConscript +++ b/Documentation/user/SConscript @@ -13,13 +13,8 @@ pngs = glob.glob ('*.png') os.chdir (here) Import ('env') -e = env.Copy () outdir = os.path.join (env['build'], reldir, env['out']) -# Too late -e.Append (LILYPOND_BOOK_PATH = [os.path.join (env['srcdir'], reldir, 'user')]) -e['LILYPOND_BOOK_PATH'].append (os.path.join (env['srcdir'], reldir, 'user')) - def verbose_opt (env, opt): if env['verbose']: return opt @@ -33,22 +28,25 @@ lilybuild = os.path.join (env['absbuild'], 'lily', env['out']) userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out']) # more of these? -- howto? -e.Depends ('lilypond.texi', os.path.join (mfbuild, 'feta16list.ly')) -e.Depends ('lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly')) +env.Depends ('lilypond.texi', os.path.join (mfbuild, 'feta16list.ly')) +env.Depends ('lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly')) # or these -e.Depends ('doc', os.path.join (mfbuild, 'feta20.enc')) -e.Depends ('doc', os.path.join (mfbuild, 'feta20.enc')) +env.Depends ('doc', os.path.join (mfbuild, 'feta20.enc')) +env.Depends ('doc', os.path.join (mfbuild, 'feta20.enc')) -e.Depends ('lilypond.texi', LILYPOND_BIN) -e.Depends ('lilypond.texi', 'lilypond-internals.texi') +env.Depends ('lilypond.texi', LILYPOND_BIN) +env.Depends ('lilypond.texi', 'lilypond-internals.texi') -e.Depends ('lilypond.texi', 'fonts') +##env.Depends ('lilypond.texi', 'fonts') + +# simple: +env.Depends ('doc', mfbuild) png_stems = map (lambda x: os.path.splitext (x)[0], pngs) -epss = map (e.Png2eps, png_stems) -e.Depends ('lilypond.texi', epss) +epss = map (env.Png2eps, png_stems) +env.Depends ('lilypond.texi', epss) -e.Command ('lilypond-internals.texi', LILYPOND_BIN, +env.Command ('lilypond-internals.texi', LILYPOND_BIN, ('(cd ${TARGET.dir} && \ LILYPONDPREFIX=%(LILYPONDPREFIX)s %(LILYPOND_BIN)s ' \ + verbose_opt (env, ' --verbose') \ @@ -56,10 +54,10 @@ e.Command ('lilypond-internals.texi', LILYPOND_BIN, + ')') % vars ()) 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, map (lambda x: x + '.dvi', doc_stems)) -pdfs = map (e.Dvi2pdf, doc_stems) +texis = map (env.Tely2texi, doc_stems) +dvis = map (env.Texi2dvi, doc_stems) +pss = map (env.PostScript, map (lambda x: x + '.dvi', doc_stems)) +pdfs = map (env.Dvi2pdf, doc_stems) def file_subst (file_name, find, subst): @@ -90,17 +88,18 @@ def url_fixup (target, source, env): file_subst (str (target[0]), '\.\./lilypond-internals', 'lilypond-internals/') c = 'pwd; ln -f %(userbuild)s/*.png %(userbuild)s/*.ly ${TARGET.dir}/' % vars () +e = env.Copy () e.Command ('lilypond/lilypond.html', 'lilypond.texi', [a, url_fixup, c]) e.Command ('lilypond-internals/lilypond-internals.html', 'lilypond-internals.texi', a) -e.Alias ('doc', texis) -e.Alias ('doc', dvis) -e.Alias ('doc', pss) -e.Alias ('doc', pdfs) +env.Alias ('doc', texis) +env.Alias ('doc', dvis) +env.Alias ('doc', pss) +env.Alias ('doc', pdfs) -e.Alias ('doc', 'lilypond-internals/lilypond.html') -e.Alias ('doc', 'lilypond-internals/lilypond-internals.html') +env.Alias ('doc', 'lilypond-internals/lilypond.html') +env.Alias ('doc', 'lilypond-internals/lilypond-internals.html') #testing all_sources = ['SConscript',] + sources + pngs diff --git a/SConstruct b/SConstruct index c73c4f05c0..c4495795bc 100644 --- a/SConstruct +++ b/SConstruct @@ -57,6 +57,15 @@ import os import sys import string +subdirs = ['flower', 'lily', 'mf', 'scm', 'ly', 'Documentation', + 'Documentation/user', 'input'] + +usage = r'''Usage: +scons [KEY=VALUE].. [TARGET].. + +where TARGET is lily|all|fonts|doc|tar|dist|release +''' + env = Environment () # Without target arguments, build lily only @@ -64,10 +73,12 @@ if not COMMAND_LINE_TARGETS: env.Default ('lily') # Target 'all' builds everything -if 'all' in COMMAND_LINE_TARGETS: - env.Default ('lily', 'fonts', 'doc') +#if 'all' in COMMAND_LINE_TARGETS: +# env.Default ( + +env.Alias ('all', ['lily', 'mf', 'input', 'Documentation']) -# put your favourite stuff in custom.py +# Put your favourite stuff in custom.py opts = Options ('custom.py', ARGUMENTS) #opts = Options (['config.cache', 'custom.py'], ARGUMENTS) opts.Add ('prefix', 'Install prefix', '/usr/') @@ -90,7 +101,7 @@ opts.AddOptions ( 0), ) -Help (opts.GenerateHelpText (env)) +Help (usage + opts.GenerateHelpText (env)) env = Environment (options = opts) @@ -321,19 +332,6 @@ if optional: for i in optional: print '%s: %s-%s or newer (found: %s %s)' % i -#env['tarball'] = os.path.join (outdir, -# package.name + '-' + env['version'] + '.tar.gz') - -env['tarball'] = os.path.join (os.environ['HOME'], 'tmp', - package.name + '-' + env['version'] + '.tar.gz') - -# huh? -if 'tar' in COMMAND_LINE_TARGETS: - #env.Default (env['tarball']) - #env.Default (tar) - env.Default (env['tarball']) - #Default (tar) - Export ('env') #ugr @@ -368,50 +366,60 @@ env['MAKEINFO_PATH'] = ['.', '#/Documentation/user', ## TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper) env['TEXINFO_PAPERSIZE_OPTION'] = '-t @afourpaper' -env.Append (PYTHONPATH = [os.path.join (outdir, 'usr/lib/python'), - os.path.join (srcdir, 'buildscripts'), - os.path.join (srcdir, 'python')]) -# huh, aha? -# GS_FONTPATH, GS_LIB? -env.Append (ENV = { 'PYTHONPATH' : string.join (env['PYTHONPATH'], - os.pathsep) } ) -# UGHR, lilypond.py uses lilypond-bin from PATH -env.Append (ENV = { 'PATH' : os.path.join (outdir, 'usr/bin') }) -SConscript ('buildscripts/builder.py') +tarbase = package.name + '-' + env['version'] +tarname = tarbase + '.tar.gz' +tarball = os.path.join (outdir, tarname) +env['tarball'] = tarball -#subdirs = ['mf',] -#subdirs = ['flower', 'lily', 'parser', 'gui', 'main',] -#subdirs = ['flower', 'lily', 'mf', 'scm', 'ly'] -subdirs = ['flower', 'lily', 'mf', 'scm', 'ly', 'Documentation', - 'Documentation/user', 'input'] -for d in subdirs: - b = os.path.join (build, d, out) - # Support clean sourctree build (srcdir build) - # and outdir build. - # TODO: figure out SConscript (dir, builddir, duplicate)) feature - if (build and build != '.') \ - or (out and out != '.'): - env.BuildDir (b, d, duplicate=0) - SConscript (os.path.join (b, 'SConscript')) +ballprefix = os.path.join (outdir, tarbase) + '/' +env['ballprefix'] = ballprefix + +SConscript ('buildscripts/builder.py') readme_files = ['ChangeLog', 'COPYING', 'DEDICATION', 'ROADMAP', 'THANKS'] readme_txt = ['AUTHORS.txt', 'README.txt', 'INSTALL.txt', 'NEWS.txt'] # to be [re]moved after spit patch_files = ['emacsclient.patch', 'server.el.patch', 'darwin.patch'] -map (lambda x: env.Texi2txt (x, os.path.join ('Documentation/topdocs', - os.path.splitext (x)[0])), - readme_txt) - #testing env.Append (TARFLAGS = '-z --owner=0 --group=0') env.Append (GZIPFLAGS = '-9') -all_sources = ['SConstruct',] + subdirs \ - + ['VERSION', '.cvsignore']\ +all_sources = ['SConstruct', 'VERSION', '.cvsignore']\ + readme_files + readme_txt + patch_files +map (lambda x: env.Texi2txt (x, os.path.join ('Documentation/topdocs', + os.path.splitext (x)[0])), + readme_txt) + +#print `all_sources` +#print `map (lambda x: env['ballprefix'] + x, all_sources)` +#ballize = map (env.BALL, all_sources) +#ballize = map (env.BALL, ['SConstruct', 'VERSION']) +#tar = env.Tar (tarball, map (lambda x: env['ballprefix'] + x, all_sources)) tar = env.Tar (env['tarball'], all_sources) +env.Alias ('tar', tar) + +distball = os.path.join (package.release_dir, tarname) +env.Command (distball, tarball, + 'if [ -e $SOURCE -a -e $TARGET ]; then rm $TARGET; fi;' \ + + 'ln $SOURCE $TARGET') +env.Depends ('dist', distball) +patchfile = os.path.join (outdir, tarbase + '.diff.gz') +patch = env.PATCH (patchfile, tarball) +env.Depends (patchfile, distball) +env.Alias ('release', patch) + + +for d in subdirs: + b = os.path.join (build, d, out) + # Support clean sourctree build (srcdir build) + # and outdir build. + # TODO: figure out SConscript (dir, builddir, duplicate)) feature + if (build and build != '.') \ + or (out and out != '.'): + env.BuildDir (b, d, duplicate=0) + SConscript (os.path.join (b, 'SConscript')) # as a builder? def symlink_tree (prefix): @@ -462,3 +470,4 @@ if env['debugging']: prefix = os.path.join (out, 'usr') if not os.path.exists (prefix): symlink_tree (prefix) + diff --git a/buildscripts/builder.py b/buildscripts/builder.py index ce84e087f8..2629e84075 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -39,17 +39,28 @@ LILYPOND_BOOK_INCLUDES = join_path (env['LILYPOND_BOOK_PATH'], '', ' --include=') LILYPONDPREFIX = env['LILYPONDPREFIX'] -env.Append (ENV = {'PATH' : os.environ['PATH']}) -if os.environ.has_key ('LD_LIBRARY_PATH'): - env.Append (ENV = {'LD_LIBRARY_PATH' : os.environ['LD_LIBRARY_PATH']}) -if os.environ.has_key ('GUILE_LOAD_PATH'): - env.Append (ENV = {'GUILE_LOAD_PATH' : os.environ['GUILE_LOAD_PATH']}) +# UGHR, lilypond.py uses lilypond-bin from PATH +#env.Append (ENV = {'PATH' : os.environ['PATH']}) +env.PrependENVPath ('PATH', + os.path.join (env['absbuild'], env['out'], 'usr/bin')) if os.environ.has_key ('TEXMF'): env.Append (ENV = {'TEXMF' : os.environ['TEXMF']}) env.Append (ENV = {'TEXMF' : '{' + LILYPONDPREFIX + ',' \ + os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}' }) +if os.environ.has_key ('LD_LIBRARY_PATH'): + env.Append (ENV = {'LD_LIBRARY_PATH' : os.environ['LD_LIBRARY_PATH']}) +if os.environ.has_key ('GUILE_LOAD_PATH'): + env.Append (ENV = {'GUILE_LOAD_PATH' : os.environ['GUILE_LOAD_PATH']}) + +env.Append (PYTHONPATH = [os.path.join (env['absbuild'], env['out'], + 'usr/lib/python'), + os.path.join (srcdir, 'buildscripts'), + os.path.join (srcdir, 'python')]) +env.Append (ENV = { 'PYTHONPATH' : string.join (env['PYTHONPATH'], + os.pathsep) } ) + verbose = verbose_opt (env, ' --verbose') a = (r'''rm -f $$(grep -LF '\lilypondend' ${TARGET.dir}/lily-*.tex 2>/dev/null); ''' \ + 'LILYPONDPREFIX=%(LILYPONDPREFIX)s '\ @@ -88,7 +99,8 @@ def add_ps_target (target, source, env): base = os.path.splitext (str (target[0]))[0] return (target + [base + '.ps'], source) -a = ('LILYPONDPREFIX=%(LILYPONDPREFIX)s '\ +#a = ('echo "PATH=$$PATH"; echo "TEXMF=$$TEXMF"; which lilypond-bin;'\ +a = (' LILYPONDPREFIX=%(LILYPONDPREFIX)s '\ + '%(PYTHON)s %(LILYPOND_PY)s%(verbose)s'\ + ' --include=${TARGET.dir}'\ + ' --output=${TARGET.base}'\ @@ -124,13 +136,8 @@ def add_suffixes (target, source, env, target_suffixes, src_suffixes): return (target + map (lambda x: base + x, target_suffixes), source + map (lambda x: base + x, src_suffixes)) -#outdir = os.path.join (env['build'], reldir, env['out']) -outdir = '${TARGET.dir}' scrdir = env['srcdir'] -#MFINPUTS = '.:' + str (Dir ('#/mf')) -#MFINPUTS = '.:${SOURCE.dir}' a = ('(cd ${TARGET.dir} &&'\ -# + ' MFINPUTS=.:${SOURCE.dir}'\ + ' MFINPUTS=.:${SOURCE.dir}:%(srcdir)s/${SOURCE.dir}'\ + ' mf "\\mode:=%(MFMODE)s; nonstopmode;'\ + ' input ${SOURCE.filebase};" ' \ @@ -180,24 +187,18 @@ pfa = Builder (action = a, suffix = '.pfa', src_suffix = '.mf', emitter = add_enc_src) - -def run_mftrace (target, source, env): - TARGET = target[0] - SOURCE = source[0] - mf = os.path.basename (str (source[0])) - base = os.path.splitext (os.path.basename (str (target[0])))[0] - enc = base + '.enc' - encoding = encoding_opt (target) - verbose = verbose_opt (env, ' --verbose') - command = ('(cd $$(dirname %(TARGET)s && ' - + ' MFINPUTS=.:$$(dirname %(TARGET)s):$$(dirname %(SOURCE)s'\ - + ' mftrace --pfa --simplify --keep-trying%(verbose)s'\ - + ' --include=${TARGET.dir}'\ - + ' %(encoding)s %(mf)s)') % vars () - return os.system (command) - -xpfa = Builder (action = run_mftrace, suffix = '.pfa', src_suffix = '.mf', - emitter = add_enc_src) env.Append (BUILDERS = {'PFA': pfa}) - +# FIXMExo +#verbose = verbose_opt (env, ' --verbose') +verbose = '' +DIFF_PY = os.path.join (srcdir, 'stepmake/bin/package-diff.py') +verbose = '' +a = ('%(PYTHON)s %(DIFF_PY)s%(verbose)s'\ + + ' --outdir=${TARGET.dir}') % vars () +patch = Builder (action = a, suffix = '.diff', src_suffix = '.tar.gz') +env.Append (BUILDERS = {'PATCH': patch}) + +# Ugh, how to make a sane tarball with scons? +ball = Builder (prefix = env['ballprefix'], action = 'ln $SOURCE $TARGET') +env.Append (BUILDERS = {'BALL': ball}) diff --git a/input/SConscript b/input/SConscript index 4e5df4bf7a..db73109641 100644 --- a/input/SConscript +++ b/input/SConscript @@ -11,24 +11,22 @@ abc_sources = glob.glob ('*.abc') os.chdir (here) Import ('env') -e = env.Copy () #outdir = os.path.join (env['build'], reldir, env['out']) # examples = simple simple-song les-nereides puer-fragment wilhelmus paddy stems = map (lambda x: os.path.splitext (x)[0], sources) -pdfs = map (e.LilyPond, stems) - abc_stems = map (lambda x: os.path.splitext (x)[0], abc_sources) -lys = map (e.Abc2ly, abc_stems) -pdfs = pdfs + map (e.LilyPond, lys) +lys = map (env.Abc2ly, abc_stems) +examples = map (env.LilyPond, stems + abc_stems) +env.Alias ('doc', examples) LILYPOND_BIN = env['LILYPOND_BIN'] mfbuild = os.path.join (env['absbuild'], 'mf', env['out']) -e.Depends ('doc', 'fonts') -e.Depends ('doc', LILYPOND_BIN) -e.Alias ('doc', pdfs) +#e.Depends ('doc', 'fonts') +env.Depends ('doc', mfbuild) +env.Depends ('doc', LILYPOND_BIN) #testing all_sources = ['SConscript',] + sources + abc_sources diff --git a/lily/SConscript b/lily/SConscript index 2a0a83a38e..c5bde0c080 100644 --- a/lily/SConscript +++ b/lily/SConscript @@ -44,5 +44,5 @@ env.Alias ('lily', lily) #testing -all_sources = ['SConscript',] + sources + includes +all_sources = ['SConscript',] + sources + includes x = env.Tar (env['tarball'], all_sources) diff --git a/mf/SConscript b/mf/SConscript index 60305b1064..12ab4d5754 100644 --- a/mf/SConscript +++ b/mf/SConscript @@ -20,17 +20,16 @@ mf_sources = reduce (lambda x, y: x + y, os.chdir (here) Import ('env') -e = env.Copy () #mf_sources = ('feta16.mf',) #mf_sources = ('feta-braces-a.mf',) font_stems = map (lambda x: os.path.splitext (x)[0], mf_sources) -t = map (e.TFM, font_stems) -a = map (e.AFM, font_stems) -p = map (e.PFA, font_stems) +t = map (env.TFM, font_stems) +a = map (env.AFM, font_stems) +p = map (env.PFA, font_stems) -map (lambda x: e.Depends (x + '.pfa', x + '.enc'), font_stems) -#map (lambda x: e.Depends (x + '.pfa', x + '.log'), font_stems) +map (lambda x: env.Depends (x + '.pfa', x + '.enc'), font_stems) +#map (lambda x: env.Depends (x + '.pfa', x + '.log'), font_stems) tfmdir = os.path.join (env['lilypondprefix'], 'fonts/tfm') afmdir = os.path.join (env['lilypondprefix'], 'afm') @@ -44,7 +43,10 @@ env.Alias ('install', afmdir) env.Alias ('install', pfadir) map (lambda x: env.Alias ('fonts', x), t + a + p) -map (lambda x: env.Alias ('mf', x), t + a + p) +outcmr = os.path.join (env['absbuild'], reldir, env['out'], 'cmr.enc') +env.Command (outcmr, os.path.join (reldir, 'cmr.enc'), 'cp $SOURCE $TARGET') +env.Alias ('fonts', outcmr) +env.Alias ('mf', 'fonts') #testing all_sources = ['SConscript',] + sources diff --git a/stepmake/bin/package-diff.py b/stepmake/bin/package-diff.py index 284e2c6e8e..65c91eb845 100644 --- a/stepmake/bin/package-diff.py +++ b/stepmake/bin/package-diff.py @@ -40,7 +40,7 @@ def find(pattern, dir = os.curdir): return list -topdir = '' +topdir = os.getcwd () def gulp_file(f): try: i = open(f)