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
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') \
+ ')') % 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):
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
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
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/')
0),
)
-Help (opts.GenerateHelpText (env))
+Help (usage + opts.GenerateHelpText (env))
env = Environment (options = opts)
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
## 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):
prefix = os.path.join (out, 'usr')
if not os.path.exists (prefix):
symlink_tree (prefix)
+
' --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 '\
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}'\
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};" ' \
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})
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
#testing
-all_sources = ['SConscript',] + sources + includes
+all_sources = ['SConscript',] + sources + includes
x = env.Tar (env['tarball'], all_sources)
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')
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
return list
-topdir = ''
+topdir = os.getcwd ()
def gulp_file(f):
try:
i = open(f)