From: Jan Nieuwenhuizen Date: Tue, 6 Jun 2006 21:48:15 +0000 (+0000) Subject: * scripts/lilypond-book.py (process_snippets): Argument fix. X-Git-Tag: release/2.10.0-2~555 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e10092cbaddbbe8bf2a3668eb70ee4dafb54af8a;p=lilypond.git * scripts/lilypond-book.py (process_snippets): Argument fix. * SConstruct: * buildscripts/builder.py: * lily/SConscript: * mf/SConscript: * Documentation/user/SConscript: More SCons fixes. * lily/font-config.cc (init_fontconfig): Only initialize if global cache_file is found. --- diff --git a/ChangeLog b/ChangeLog index 899f05535f..8687dfa23c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-06-06 Jan Nieuwenhuizen + + * scripts/lilypond-book.py (process_snippets): Argument fix. + + * SConstruct: + * buildscripts/builder.py: + * lily/SConscript: + * mf/SConscript: + * Documentation/user/SConscript: More SCons fixes. + +2006-06-03 Jan Nieuwenhuizen + + * lily/font-config.cc (init_fontconfig): Only initialize if + global cache_file is found. + 2006-06-06 Erik Sandberg * ly/music-functions-init.ly: Updated \overrideProperty to use the diff --git a/Documentation/user/SConscript b/Documentation/user/SConscript index bbdf7aec77..5d653a01f8 100644 --- a/Documentation/user/SConscript +++ b/Documentation/user/SConscript @@ -3,9 +3,9 @@ import os import string -Import ('env', 'base_glob') +Import ('env', 'base_glob', 'src_glob') tely = base_glob ('*.tely') -png = base_glob ('*.png') +png = src_glob ('*.png') + map (env.EPS2PNG, base_glob ('*.eps')) # We need lily and mf to build these. env.Depends ('lilypond.texi', ['#/lily', '#/mf', '#/python']) @@ -13,13 +13,16 @@ env.Depends ('music-glossary.texi', ['#/lily', '#/mf', '#/python']) env.Depends ('lilypond.texi', 'lilypond-internals.texi') -eps = map (env.PNG2EPS, png) -env.Depends ('lilypond.texi', eps) +eps = src_glob ('*.eps') + map (env.PNG2EPS, base_glob ('*.png')) +env.Depends ('lilypond.texi', eps + png) +lilypond_book_flags = '''--format=$LILYPOND_BOOK_FORMAT --process="lilypond -I$srcdir/input/test $__verbose --backend=eps --formats=ps,png --header=texidoc -dinternal-type-checking -ddump-signatures -danti-alias-factor=2 -dgs-font-load" ''' e = env.Copy ( - LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I#/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''', +# LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I#/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''', + LILYPOND_BOOK_FLAGS = lilypond_book_flags, __verbose = ' --verbose', GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation', + ## TEXI2DVI_FLAGS = ['-I#Documentation/user'], ) e.Command ('lilypond-internals.texi', ['#/lily', '#/mf', '#/python'], diff --git a/SConstruct b/SConstruct index 3f6f15007b..f2a7c302ec 100644 --- a/SConstruct +++ b/SConstruct @@ -158,7 +158,7 @@ opts.AddOptions ( BoolOption ('static', 'build static libraries', 1), BoolOption ('gui', 'build with GNOME backend (EXPERIMENTAL)', - 1), + 0), BoolOption ('verbose', 'run commands with verbose flag', 0), BoolOption ('checksums', 'use checksums instead of timestamps', @@ -270,7 +270,8 @@ def list_sort (lst): def configure (target, source, env): - vre = re.compile ('^.*[^-.0-9]([0-9][0-9]*\.[0-9]([.0-9]*[0-9])*).*$', + dre = re.compile ('\n(200[0-9]{5})') + vre = re.compile ('.*?\n[^-.0-9]*([0-9][0-9]*\.[0-9]([.0-9]*[0-9])*)', re.DOTALL) def get_version (program): command = '(pkg-config --modversion %(program)s || %(program)s --version || %(program)s -V) 2>&1' % vars () @@ -278,7 +279,10 @@ def configure (target, source, env): output = pipe.read () if pipe.close (): return None - v = re.sub (vre, '\\1', output) + splits = re.sub ('^|\s', '\n', output) + date_hack = re.sub (dre, '\n0.0.\\1', splits) + m = re.match (vre, date_hack) + v = m.group (1) if v[-1] == '\n': v = v[:-1] return string.split (v, '.') @@ -354,15 +358,15 @@ def configure (target, source, env): test_program (optional, 'bison', '1.25', 'Bison -- parser generator', 'bison') test_program (optional, 'dvips', '0.0', 'Dvips', 'tetex-bin') -# test_program (optional, 'fontforge', '0.0.20041224', 'FontForge', -# 'fontforge') + test_program (optional, 'fontforge', '0.0.20050624', 'FontForge', + 'fontforge') test_program (optional, 'flex', '0.0', 'Flex -- lexer generator', 'flex') test_program (optional, 'guile', '1.6', 'GUILE scheme', 'guile') - test_program (optional, 'gs', '8.14', + test_program (optional, 'gs', '8.15', 'Ghostscript PostScript interpreter', 'gs or gs-afpl or gs-esp or gs-gpl') - test_program (optional, 'mftrace', '1.1.0', 'Metafont tracing Type1', + test_program (optional, 'mftrace', '1.1.19', 'Metafont tracing Type1', 'mftrace') test_program (optional, 'makeinfo', '4.7', 'Makeinfo tool', 'texinfo') test_program (optional, 'perl', '4.0', @@ -384,45 +388,8 @@ def configure (target, source, env): context.Result (ret) return ret - def CheckLibkpathseaSo (context): - saveCFLAGS = [] - if context.env.has_key ('CFLAGS'): - saveCFLAGS = context.env['CFLAGS'] - CFLAGS_shared_no_debugging = filter (lambda x: x != '-g', - saveCFLAGS)\ - + ['-shared'] - # FIXME: how does this work, with scons - context.env.Replace (CFLAGS = CFLAGS_shared_no_debugging) - #context.env.Replace (CFLAGS = '') - #context.env.Append (CFLAGS = ['-shared']) - context.Message ('Checking for libkpathsea... ') - ret = conf.TryLink ('''#include - int main () - { - kpse_var_expand ("\$TEXMF"); - return 0; - } - ''', '.c') - context.env.Replace (CFLAGS = saveCFLAGS) - # FIXME: this prints 'ok' already - context.Result (ret) - if not ret: - return 0 - - sys.stdout.write ('Checking for libkpathsea.so... ') - testfile = str (context.sconf.lastTarget) - shared_size = os.path.getsize (testfile) - ret = shared_size < 40000 - if ret: - print 'ok' - else: - print 'no' - return ret - conf = Configure (env, custom_tests = { 'CheckYYCurrentBuffer' - : CheckYYCurrentBuffer, - 'CheckLibkpathseaSo' - : CheckLibkpathseaSo }) + : CheckYYCurrentBuffer }) defines = { 'DIRSEP' : "'%s'" % os.sep, @@ -441,8 +408,8 @@ def configure (target, source, env): else: env.Append (CPPPATH = [PYTHON_INCLUDE]) - headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h', 'libio.h', - 'Python.h') + headers = ('assert.h', 'grp.h', 'libio.h', 'pwd.h', + 'sys/stat.h', 'utf8/wchar.h', 'wchar.h', 'Python.h') for i in headers: if conf.CheckCHeader (i): key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i)) @@ -454,8 +421,9 @@ def configure (target, source, env): key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i)) conf.env['DEFINES'][key] = 1 - functions = ('fopencookie', 'funopen', - 'gettext', 'isinf', 'memmem', 'snprintf', 'vsnprintf') + functions = ('chroot', 'fopencookie', 'funopen', + 'gettext', 'isinf', + 'mbrtowc', 'memmem', 'snprintf', 'vsnprintf', 'wcrtomb') for i in functions: if 0 or conf.CheckFunc (i): key = re.sub ('[./]', '_', 'HAVE_' + string.upper (i)) @@ -464,21 +432,9 @@ def configure (target, source, env): if conf.CheckYYCurrentBuffer (): conf.env['DEFINES']['HAVE_FLEXLEXER_YY_CURRENT_BUFFER'] = 1 - if conf.CheckLibkpathseaSo (): - conf.env['DEFINES']['HAVE_LIBKPATHSEA_SO'] = '1' - if conf.CheckLib ('dl'): pass - if conf.CheckLib ('kpathsea'): - conf.env['DEFINES']['KPATHSEA'] = 1 - - # huh? - if conf.CheckLib ('kpathsea', 'kpse_find_file'): - conf.env['DEFINES']['HAVE_KPSE_FIND_FILE'] = '1' - if conf.CheckLib ('kpathsea', 'kpse_find_tfm'): - conf.env['DEFINES']['HAVE_KPSE_FIND_TFM'] = '1' - if env['fast']: cpppath = [] if env.has_key ('CPPPATH'): @@ -499,7 +455,6 @@ def configure (target, source, env): 'Development files for pango, with FreeType2', 'pango1.0'): conf.env['DEFINES']['HAVE_PANGO_FT2'] = '1' - conf.env['DEFINES']['HAVE_PANGO16'] = '1' if test_lib (optional, 'fontconfig', '2.2.0', 'Development files for fontconfig', 'fontconfig1'): @@ -509,12 +464,7 @@ def configure (target, source, env): if env['gui']: test_lib (required, 'gtk+-2.0', '2.4.0', 'Development files for GTK+', 'gtk2.0') - if test_lib (required, 'pango', '1.6.0', - 'Development files for pango', 'pango1.0'): - conf.env['DEFINES']['HAVE_PANGO16'] = '1' - if conf.CheckCHeader ('pango/pangofc-fontmap.h'): - conf.env['DEFINES']['HAVE_PANGO_PANGOFC_FONTMAP_H'] = '1' if env['fast']: # Using CCFLAGS = -I rather than CPPPATH = [ # ] speeds up SCons @@ -633,11 +583,7 @@ env.PrependENVPath ('PATH', LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond/', version) env.Append (ENV = { - #'LILYPONDPREFIX' : os.path.join (run_prefix, 'share/lilypond/', version), 'LILYPONDPREFIX' : LILYPONDPREFIX, - # ugh, can't use LILYPONDPREFIX here - #'TEXMF' : '{' + os.path.join (run_prefix, 'share/lilypond/', version)\ - #+ ',' \ 'TEXMF' : '{$LILYPONDPREFIX,' + os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}', }) @@ -684,7 +630,6 @@ if env['debugging']: env.Append (CCFLAGS = ['-g']) if env['optimising']: env.Append (CCFLAGS = '-O2') - env.Append (CXXFLAGS = ['-DSTRING_UTILS_INLINED']) if env['warnings']: env.Append (CCFLAGS = ['-W', '-Wall']) env.Append (CXXFLAGS = ['-Wconversion']) @@ -731,13 +676,21 @@ if 'realclean' in COMMAND_LINE_TARGETS: # Declare SConscript phonies env.Alias ('minimal', config_cache) -env.Alias ('mf-essential', config_cache) -env.Alias ('minimal', ['lily', 'mf-essential']) -env.Alias ('all', ['minimal', 'mf', '.']) +if 0: + env.Alias ('mf-essential', config_cache) + env.Alias ('minimal', ['python', 'lily', 'mf-essential']) + env.Alias ('all', ['minimal', 'mf', '.']) + +else: + env.Alias ('minimal', ['python', 'mf', 'lily']) + env.Alias ('all', ['minimal', '.']) + + # Do we want the doc/web separation? env.Alias ('doc', - ['Documentation', + ['minimal', + 'Documentation', 'Documentation/user', 'Documentation/topdocs', 'Documentation/bibliography', @@ -760,8 +713,7 @@ env.Append ( LILYPONDPREFIX = LILYPONDPREFIX, # FIXME: move to lily/SConscript? - LIBPATH = [os.path.join (absbuild, 'flower', env['out']), - os.path.join (absbuild, 'kpath-guile', env['out']),], + LIBPATH = [os.path.join (absbuild, 'flower', env['out'])], CPPPATH = [outdir, ], LILYPOND_PATH = ['.', '$srcdir/input', @@ -862,12 +814,10 @@ def symlink_tree (target, source, env): % vars ()) os.chdir (srcdir) -if 1: #env['debugging']: - stamp = os.path.join (run_prefix, 'stamp') - env.Command (stamp, ['#/SConstruct', '#/VERSION'], - [symlink_tree, 'touch $TARGET']) - env.Depends ('lily', stamp) - +env.Command (LILYPONDPREFIX, ['#/SConstruct', '#/VERSION'], symlink_tree) +env.Depends ('lily', LILYPONDPREFIX) +env.Depends ('doc', LILYPONDPREFIX) + #### dist, tar def plus (a, b): a + b @@ -920,11 +870,10 @@ if env['fast']\ and 'web' not in COMMAND_LINE_TARGETS\ and 'install' not in COMMAND_LINE_TARGETS\ and 'clean' not in COMMAND_LINE_TARGETS: - subdirs = ['lily', + subdirs = [ 'python', + 'lily', 'flower', - 'kpath-guile', 'mf', - 'python', ] if os.path.isdir ('%(srcdir)s/CVS' % vars ()): diff --git a/buildscripts/builder.py b/buildscripts/builder.py index 3caea45830..cf3493fa72 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -65,29 +65,22 @@ env.Append (BUILDERS = {'HH' : HH}) # Setup LilyPond environment. For the LilyPond build, we override # some of these commands in the ENVironment. +lilypond_book_flags = '''--format=$LILYPOND_BOOK_FORMAT --process="lilypond -I$srcdir -I$srcdir/input/test $__verbose --backend=eps --formats=ps,png --header=texidoc -dinternal-type-checking -ddump-signatures -danti-alias-factor=2 -dgs-font-load" ''' + env.Append ( - _fixme = _fixme, - ##ABC2LY = 'abc2ly', - ##LILYPOND = 'lilypond', + BSTINPUTS = '${SOURCE.dir}:${TARGET.dir}:', + BIB2HTML = '$PYTHON $srcdir/buildscripts/bib2html.py', LILYOND_BOOK = 'lilypond-book', - - #ugr - #LILYPOND_BOOK_FORMAT = 'texi', LILYPOND_BOOK_FORMAT = '', - #LILYPOND_BOOK_FLAGS = ['--format=$LILYPOND_BOOK_FORMAT'], - LILYPOND_BOOK_FLAGS = '''--format=$LILYPOND_BOOK_FORMAT --process="lilypond --backend=eps --formats=ps,png --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'" ''', - + LILYPOND_BOOK_FLAGS = lilypond_book_flags, LILYPOND_PATH = [], # The SCons way around FOO_PATH: - ##LILYPOND_INCFLAGS = '$( ${_concat(INCPREFIX, LILYPOND_PATH, INCSUFFIX, __env__, RDirs)} $)', LILYPOND_INCFLAGS = '$( ${_concat(INCPREFIX, LILYPOND_PATH, INCSUFFIX, __env__)} $)', MAKEINFO_PATH = [], MAKEINFO_FLAGS = [], MAKEINFO_INCFLAGS = '$( ${_concat(INCPREFIX, MAKEINFO_PATH, INCSUFFIX, __env__, RDirs)} $)', - # should not be necessary - # PYTHONPATH = ['$absbuild/python/$out'], - TEXI2DVI_FLAGS = [], + #TEXI2DVI_FLAGS = [], _TEXI2DVI_FLAGS = '$( ${_concat(" ", TEXI2DVI_FLAGS,)} $)', ) @@ -120,7 +113,7 @@ env.Append (BUILDERS = {'TEXI': TEXI}) TEXIDVI =\ Builder (action = 'cd ${TARGET.dir} && \ - texi2dvi --batch $_TEXI2DVI_FLAGS ${SOURCE.file}', + texi2dvi --batch -I $srcdir/Documentation/user $_TEXI2DVI_FLAGS ${SOURCE.file}', suffix = '.dvi', src_suffix = '.texi') env.Append (BUILDERS = {'TEXIDVI': TEXIDVI}) @@ -144,18 +137,10 @@ PNG2EPS =\ suffix = '.eps', src_suffix = '.png') env.Append (BUILDERS = {'PNG2EPS': PNG2EPS}) - - -# FIXME: cleanup, see above - - -env.Append ( - - #urg - BSTINPUTS = '${SOURCE.dir}:${TARGET.dir}:', - BIB2HTML = '$PYTHON $srcdir/buildscripts/bib2html.py', -) - +EPS2PNG =\ + Builder (action = 'convert $SOURCE $TARGET', + suffix = '.png', src_suffix = '.eps') +env.Append (BUILDERS = {'EPS2PNG': EPS2PNG}) def add_ps_target (target, source, env): base = os.path.splitext (str (target[0]))[0] @@ -213,13 +198,18 @@ env.Append (BUILDERS = {'GTABLE': gtable}) def add_enc_src (target, source, env): base = os.path.splitext (str (target[0]))[0] - return (target, source + [base + '.enc']) + #return (target, source + [base + '.enc']) + return (target + [base + '.pfb', base + '.svg'], source + [base + '.enc']) + +def add_svg (target, source, env): + base = os.path.splitext (str (target[0]))[0] + return (target + [base + '.svg'], source) # FIXME UGH, should fix --output option for mftrace a = 'cd ${TARGET.dir} && \ if test -e ${SOURCE.filebase}.enc; then encoding="--encoding=${SOURCE.filebase}.enc"; fi; \ MFINPUTS=$srcdir/mf:.: \ -$MFTRACE --formats=pfa --simplify --keep-trying --no-afm \ +$MFTRACE --formats=pfa,pfb,svg --simplify --keep-trying --no-afm \ $$encoding $__verbose \ --include=${TARGET.dir} \ ${SOURCE.file}' @@ -237,6 +227,7 @@ otf = Builder (action = a, suffix = '.otf', src_suffix = '.pe', # emitter = add_cff_cffps_svg + emitter = add_svg ) env.Append (BUILDERS = {'OTF': otf}) @@ -274,7 +265,6 @@ atvars = [ 'step-bindir', ] -# naming def at_copy (target, source, env): n = str (source[0]) s = open (n).read () @@ -290,7 +280,6 @@ def at_copy (target, source, env): AT_COPY = Builder (action = at_copy, src_suffix = ['.in', '.py', '.sh',]) env.Append (BUILDERS = {'AT_COPY': AT_COPY}) -# naming def at_copy_ext (target, source, env): n = str (source[0]) s = open (n).read () @@ -310,7 +299,6 @@ MO = Builder (action = 'msgfmt -o $TARGET $SOURCE', suffix = '.mo', src_suffix = '.po') env.Append (BUILDERS = {'MO': MO}) -# ' '; ? ugh = 'ln -f po/lilypond.pot ${TARGET.dir}/lilypond.po ; ' a = ugh + 'xgettext --default-domain=lilypond --join \ --output-dir=${TARGET.dir} --add-comments \ @@ -326,7 +314,6 @@ a = 'msgmerge ${SOURCE} ${SOURCE.dir}/lilypond.pot -o ${TARGET}' + ugh POMERGE = Builder (action = a, suffix = '.pom', src_suffix = '.po') env.Append (BUILDERS = {'POMERGE': POMERGE}) -#UGRr a = 'BSTINPUTS=$BSTINPUTS $BIB2HTML -o $TARGET $SOURCE' BIB2HTML = Builder (action = a, suffix = '.html', src_suffix = '.bib') env.Append (BUILDERS = {'BIB2HTML': BIB2HTML}) @@ -337,48 +324,31 @@ LYS2TELY = Builder (action = a, suffix = '.tely', src_suffix = '.ly') env.Append (BUILDERS = {'LYS2TELY': LYS2TELY}) -def mutopia (ly = None, abc = None): - - # FIXME: ugr, huh? The values from ../SConstruct get appended - # to the predefined values from this builder context: - - # abc2ly/usr/bin/python ..../abc2.py - - # Override them again to fix web build... - - - #BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py' - #BUILD_LILYPOND = '$absbuild/$out/lilypond ${__verbose}' +def mutopia (ly=None, abc=None): e = env.Copy ( - #LILYPOND = BUILD_LILYPOND, - #ABC2LY = BUILD_ABC2LY, - ) + LILYPOND_BOOK_FLAGS = lilypond_book_flags, + ) if not abc: abc = base_glob ('*.abc') if not ly: ly = base_glob ('*.ly') + map (e.ABC, abc) pdf = map (e.LilyPond, ly) - - # We need lily and mf to build these. env.Depends (pdf, ['#/lily', '#/mf']) env.Alias ('doc', pdf) Export ('mutopia') - def collate (title = 'collated files'): ly = base_glob ('*.ly') e = env.Copy ( TITLE = title, - LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'" ''', - __verbose = ' --verbose', - ) - # + LILYPOND_BOOK_FLAGS = lilypond_book_flags, + # __verbose = ' --verbose', + ) tely = e.LYS2TELY ('collated-files', ly) texi = e.TEXI (tely) - # We need lily and mf to build these. env.Depends (texi, ['#/lily', '#/mf']) dvi = e.TEXIDVI (texi) pspdf = e.DVIPDF (dvi) diff --git a/lily/SConscript b/lily/SConscript index d12e237fd1..ebd623fee9 100644 --- a/lily/SConscript +++ b/lily/SConscript @@ -14,7 +14,6 @@ e.Append ( CPPPATH = [ '#/lily/include', '#/flower/include', - '#/kpath-guile/include', outdir], LEXFLAGS = ['-Cfe', '-p', '-p'], LIBS = ['flower'], diff --git a/lily/font-config.cc b/lily/font-config.cc index b59325f55a..ad66c78708 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -30,12 +30,18 @@ init_fontconfig () font_config_global = FcInitLoadConfig (); FcChar8 *cache_file = FcConfigGetCache (font_config_global); + if (!cache_file) + { + programming_error ("global fontconfig cache_file not found"); + return; + } + /* This is a terrible kludge, but there is apparently no way for FontConfig to signal whether it needs to rescan directories. */ if (!is_file ((char*)cache_file)) - message (_f ("Rebuilding FontConfig cache %s. this may take a while...", cache_file)); + message (_f ("Rebuilding FontConfig cache %s, this may take a while...", cache_file)); vector dirs; diff --git a/mf/SConscript b/mf/SConscript index 4d3a2744ef..323a1bbdac 100644 --- a/mf/SConscript +++ b/mf/SConscript @@ -5,7 +5,7 @@ import re import string Import ('env', 'base_glob', 'install') -xfeta = reduce (lambda x, y: x + y, +feta = reduce (lambda x, y: x + y, map (lambda x: base_glob (x), ('feta[0-9]*.mf', 'feta-alphabet*[0-9].mf', @@ -16,24 +16,14 @@ feta_alphabet = base_glob ('feta-alphabet[0-9][0-9]*.mf') feta_braces = base_glob ('feta-braces-[a-z].mf') parmesan = base_glob ('parmesan[0-9][0-9]*.mf') -# .pfa rules want an encoding file; ecb10.enc -#sauter = ['ecb10'] -sauter = [] -fonts = feta + feta_alphabet + feta_braces + parmesan + sauter -#env['feta'] = string.join (feta) -#env['sauter'] = '' +fonts = feta + feta_alphabet + feta_braces + parmesan feta_sizes = map (lambda x: re.sub ('feta([0-9]+)', '\\1', x), feta) otfs = map (lambda x: 'emmentaler-' + x, feta_sizes) + ['aybabtu'] t = map (env.TFM, fonts) g = map (env.GTABLE, fonts) -# FIXME: don't know how to add prefix: PFAEmmentaler (naming is ugly anyway) -#p = map (env.PFA, fonts + map (lambda x: 'PFA' + x, otfs)) p = map (env.PFA, fonts) -#e = map (env.ENC, fonts) -#c = map (lambda x: x + '.cff', fonts) -cp = map (lambda x: x + '.cff.ps', fonts) e = map (lambda x: x + '.enc', fonts) s = map (lambda x: x + '.svg', fonts) o = map (env.OTF, otfs) @@ -50,49 +40,30 @@ env.Append (BUILDERS = {'OTF_TABLE': otf_table}) f = map (env.OTF_TABLE, feta) g = map (env.OTF_TABLE, feta_braces) +map (lambda x: env.Depends ('feta' + x + '.otf-table', + ['parmesan' + x + '.lisp', + 'feta-alphabet' + x + '.lisp']), feta_sizes) + map (lambda x: env.Depends ('emmentaler-' + x + '.otf', 'feta' + x + '.otf-table'), feta_sizes) -env.Command ('emmentaler-11.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-13.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-14.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-16.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-18.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-20.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') - -env.Command ('emmentaler-23.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') +map (lambda x: env.Depends ('emmentaler-' + x + '.otf', + ['feta' + x + '.pfa', + 'parmesan' + x + '.pfa', + 'feta-alphabet' + x + '.pfa']), feta_sizes) -env.Command ('emmentaler-26.pe', - '$srcdir/buildscripts/gen-emmentaler-scripts.py', - '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') +for i in feta_sizes: + env.Command ('emmentaler-%(i)s.pe' % locals (), + '$srcdir/buildscripts/gen-emmentaler-scripts.py', + '$PYTHON $srcdir/buildscripts/gen-emmentaler-scripts.py --dir=${TARGET.dir}') map (lambda x: env.Depends (x + '.pfa', x + '.enc'), feta) # Aybabtu -# ugh -##feta_braces = map (lambda x: 'feta-braces-%c' % (ord ('a') + x), range (9)) +feta_braces_pfa = map (lambda x: x + '.pfa', feta_braces) env.AT_COPY ('aybabtu.pe.in') env.Command ('aybabtu.fontname', '', 'echo -n aybabtu > $TARGET') @@ -108,73 +79,33 @@ env.Command ('aybabtu.otf-gtable', map (lambda x: x + '.otf-gtable', feta_braces), 'echo "(design_size . 20)" > $TARGET') -#env.Depends ('aybabtu.otf-table', -# map (lambda x: x + '.otf-table', feta_braces)) - -env.Depends ('aybabtu.otf', 'aybabtu.subfonts') -env.Depends ('aybabtu.otf', 'aybabtu.fontname') -env.Depends ('aybabtu.otf', 'aybabtu.otf-table') -env.Depends ('aybabtu.otf', 'aybabtu.otf-gtable') - -# Hmm? -#env.Depends ('aybabtu.pfa', 'aybabtu.subfonts') -#env.Depends ('aybabtu.pfa', 'aybabtu.fontname') -#env.Depends ('aybabtu.pfa', 'aybabtu.otf-table') -#env.Depends ('aybabtu.pfa', 'aybabtu.otf-gtable') - - -## FIXME +env.Depends ('aybabtu.otf', + feta_braces_pfa + + ['aybabtu.subfonts', + 'aybabtu.fontname', + 'aybabtu.otf-table', + 'aybabtu.otf-gtable']) + +env.Command ('fonts.cache-1', p + o, + 'cd ${TARGET.dir}; fc-cache .') + +## FIXME: building only a few fonts does not seem to work anymore. +## what is essential these days, aybabtu/emmentaler are needed always? mf_essential = ['feta16', 'feta20', 'parmesan16', ] -pfa_essential = map (env.PFA, mf_essential) +pfa_essential = map (env.PFA, mf_essential) + ['emmentaler-20.otf'] env.Alias ('mf-essential', pfa_essential) +env.Alias ('mf-essential', 'fonts.cache-1') env['fonts'] = string.join (fonts) env['feta_sizes'] = string.join (feta_sizes) -env['sauter'] = string.join (sauter) -env.Command ('lilypond.map', p, - ['for i in $fonts; do echo $$i $$i "<"$$i.pfa; done > $TARGET', - 'for i in $feta_sizes; do\ - echo "Emmentaler-$$i Emmentaler-$$i > $TARGET', - 'echo "Aybabtu-Regular Aybabtu-Regular > $TARGET', - 'echo "PFAAybabtu-Regular PFAAybabtu-Regular > $TARGET', - 'for i in $sauter; do echo "$$i $$i <$$i.pfa"; done >> $TARGET']) -#env.Alias ('mf', 'lilypond.map') - -env.Command ('fonts.scale', p, - 'cd ${TARGET.dir} && echo *.pfa *.pfb | $PYTHON $srcdir/buildscripts/make-font-dir.py > $TARGET.file') -env.Alias ('mf', 'fonts.scale') - -env.Command ('Fontmap', p, - ["echo '%!' > $TARGET", - "echo '% Override default GS Fontmap' >> $TARGET", - "echo '% To let gs load fonts from builddir, do:' >> $TARGET", - "echo '% export GS_LIB=$$(pwd)/mf/out:' >> $TARGET", - "echo '% See Fontmap.GS for the syntax of real Fontmap files.' >> $TARGET", - "echo '(Fontmap.GS) .runlibfile' >> $TARGET", - "echo '(Fontmap.lily) .runlibfile' >> $TARGET"]) - -env.Command ('Fontmap.lily', p + ['Fontmap'], - ['echo "%!" > $TARGET', - '''for i in $fonts; do echo "/$$i ($$i.pfa);"; done >> $TARGET''', - ''' for i in $feta_sizes; do \ - echo "/Emmentaler-$$i (emmentaler-$$i.cff.ps);" ; \ - echo "/PFAEmmentaler-$$i (PFAemmentaler-$$i.pfa);" ; \ - done >> $TARGET''', - '''echo "/Aybabtu (aybabtu.cff.ps);" >> $TARGET''', - '''echo "/PFAAybabtu (PFAaybabtu.pfa);" >> $TARGET''', - '''for i in $sauter; do echo "$$i ($$i.pfa);"; done >> $TARGET''']) -#env.Alias ('mf', 'Fontmap.lily') - -# build essential stuff first, that's friendlier + env.Alias ('mf', pfa_essential + p + map (lambda x: x[0], o)) +env.Alias ('mf', s) +env.Alias ('mf', 'fonts.cache-1') install (t, env['sharedir_package_version'] + '/fonts/tfm') install (p, env['sharedir_package_version'] + '/fonts/type1') install (o, env['sharedir_package_version'] + '/fonts/otf') install (e, env['sharedir_package_version'] + '/ps') install (s, env['sharedir_package_version'] + '/fonts/svg') -#install (c, env['sharedir_package_version'] + '/fonts/cff') -install (cp, env['sharedir_package_version'] + '/ps') diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index 13a0da1f4e..a681f2b6c3 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -71,6 +71,7 @@ TODO: consider making type into symbol ") (pitch ,ly:pitch? "the pitch of this note") (pitch-alist ,list? "list of pitches jointly forming the scale of a key signature") (pop-first ,boolean? "Do a revert before we try to do a override on some grob property.") + (prob-property ,symbol? "The symbol of the prob property to set. ") (procedure ,procedure? "The function to run with \\applycontext. It must take a single argument, being the context.") diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index b76b3bc2d5..5a664e2d9b 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -96,6 +96,7 @@ ly:output-def-scope ly:output-description ly:paper-book? + ly:prob-property ly:layout-def? ly:paper-get-font ly:paper-get-number diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 70ab6a935f..e9bb199835 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1388,10 +1388,10 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets): def my_system (cmd): status = ly.system (cmd, be_verbose=global_options.verbose, - progress_p= 1) + progress_p=1) if global_options.format in (HTML, TEXINFO): - cmd += ' --format png ' + cmd += ' --formats=png ' # UGH # the --process=CMD switch is a bad idea