]> git.donarmstrong.com Git - lilypond.git/commitdiff
Scons stuff
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 18 Apr 2005 13:35:14 +0000 (13:35 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 18 Apr 2005 13:35:14 +0000 (13:35 +0000)
12 files changed:
ChangeLog
Documentation/user/SConscript
SConstruct
buildscripts/builder.py
lily/SConscript
lily/line-interface.cc
lily/paper-book.cc
lily/parser.yy
make/lilypond-vars.make
mf/SConscript
python/SConscript
ttftool/SConscript

index 244e69943c7a0a167c28d1b5bed03305f2e25964..1359e3c6d2eeb4a3c9d5f87e864b328e96c13603 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-04-17  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * SCons updates.
+
 2005-04-18  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * scm/backend-library.scm (postscript->png): newline after
 
 2005-04-18  Mathieu Giraud  <magiraud@free.fr>
 
-       * input/test/chord-names-german.ly: update for italian/french chords
+       * input/test/chord-names-german.ly: update for italian/french
+       chords.
        
-       * Documentation/user/instrument-notation.itely (Printing chord names): update
+       * Documentation/user/instrument-notation.itely (Printing chord
+       names): update.
 
 2005-04-18  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * lily/include/paper-score.hh (class Paper_score): remove unused prototypes.
+       * lily/include/paper-score.hh (class Paper_score): remove unused
+       prototypes.
 
        * lily/book.cc (process): add -COUNT to midi output.
 
 
        * lily/global-context-scheme.cc (LY_DEFINE): remove outname argument.
 
-       * lily/book.cc (process): loop over Music_outputs returned from Score::book_rendering().
+       * lily/book.cc (process): loop over Music_outputs returned from
+       Score::book_rendering().
 
        * lily/*.cc (width_callback): remove spurious "unused" warnings
        for assert (axis==[XY]_AXIS); 
 
        * lily/include/music-output.hh (class Music_output): smobify class.
 
-       * lily/include/paper-score.hh (class Paper_score): make members private.
+       * lily/include/paper-score.hh (class Paper_score): make members
+       private.
 
        * lily/performance.cc (process): return #f iso. #<undefined>. This
        prevents #<undefined> leaking into GUILE-userspace.
 
 2005-04-17  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * config.hh.in: remove HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
+       * config.hh.in: remove HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC.
 
 2005-04-17  Mathieu Giraud  <magiraud@free.fr>
 
index b67452500de23c33f7b1e3e961eeb5454c042d00..bbdf7aec771157c230d3a1d79bc4ad11bc647223 100644 (file)
@@ -8,8 +8,8 @@ tely = base_glob ('*.tely')
 png = base_glob ('*.png')
 
 # We need lily and mf to build these.
-env.Depends ('lilypond.texi', ['#/lily', '#/mf'])
-env.Depends ('music-glossary.texi', ['#/lily', '#/mf'])
+env.Depends ('lilypond.texi', ['#/lily', '#/mf', '#/python'])
+env.Depends ('music-glossary.texi', ['#/lily', '#/mf', '#/python'])
 
 env.Depends ('lilypond.texi', 'lilypond-internals.texi')
 
@@ -17,13 +17,13 @@ eps = map (env.PNG2EPS, png)
 env.Depends ('lilypond.texi', eps)
 
 e = env.Copy (
-       LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin -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)'"''',
        __verbose = ' --verbose',
        GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation',
        )
 
-e.Command ('lilypond-internals.texi', ['#/lily', '#/mf'],
-          'cd ${TARGET.dir} && $LILYPOND_BIN $GENERATE_DOCUMENTATION')
+e.Command ('lilypond-internals.texi', ['#/lily', '#/mf', '#/python'],
+          'cd ${TARGET.dir} && $LILYPOND $GENERATE_DOCUMENTATION')
 
 ## FIXME: implicit steps from [TE]LY -> PDF
 texi = map (env.TEXI, tely)
@@ -46,24 +46,24 @@ def file_subst (file_name, find, subst):
 
 e['usersrc'] = Dir ('.').srcnode ().abspath
 e['userout'] = Dir ('.').abspath
-def url_fixup (target, source, env):
-       file_subst (str (target[0]),
-                   '../lilypond-internals', 'lilypond-internals/')
 
-# fixme: see builder.py
 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
      --output=${TARGET.dir} $SOURCE',
-     '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
+     'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
+
+e.Command ('lilypond/index.html', 'lilypond.texi', a)
+e.Command ('lilypond-internals/index.html', 'lilypond-internals.texi', a)
+e.Command ('music-glossary/index.html', 'music-glossary.texi', a)
+
+a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
      --no-split --no-headers \
      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
-     --output=$TARGET $SOURCE',
-     url_fixup,
-     'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
+     --output=$TARGET $SOURCE']
 
-e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
-e.Command ('lilypond-internals/lilypond-internals.html',
-          'lilypond-internals.texi', a)
+e.Command ('lilypond.html', 'lilypond.texi', a)
+e.Command ('lilypond-internals.html', 'lilypond-internals.texi', a)
+e.Command ('music-glossary.html', 'music-glossary.texi', a)
 
 #Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
 env.Alias ('doc', texi)
@@ -71,8 +71,10 @@ env.Alias ('doc', dvi)
 env.Alias ('doc', ps)
 env.Alias ('doc', pdf)
 
-env.Alias ('doc', 'lilypond/lilypond.html')
-env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
+env.Alias ('doc', 'lilypond/index.html')
+env.Alias ('doc', 'lilypond-internals/index.html')
+env.Alias ('doc', 'lilypond.html')
+env.Alias ('doc', 'lilypond-internals.html')
 
 # install ('lilypond/*', env['sharedir_doc_package'] + '/html')
 # install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')
index 20796d4095120b7d5c7eeb5a7ac3995ec4d7517f..e0ae663bd52c6542b076e068b196898b821c8fe8 100644 (file)
@@ -22,9 +22,9 @@ Run from build tree
     PATH=$run/bin:$PATH
 
     #optionally, if you do not use custom.py below
-    #export LILYPONDPREFIX=$run/share/lilypond
+    #export LILYPONDPREFIX=$run/share/lilypond/<VERSION>
 
-    lilypond-bin input/simple
+    lilypond input/simple
 
 Other targets
     scons mf-essential         # build minimal mf stuff
@@ -60,9 +60,20 @@ prefix=os.path.join (os.environ['HOME'], 'usr', 'pkg', 'lilypond')
 
 
 # TODO:
-#  * usability
 
-#  * more program configure tests (mfont, ...?)
+#  * reality check:
+#     - too many stages in Environments setup
+#       (see also buildscripts/builders.py)
+#     - Home-brew scons.cach configuration caching
+#     - Home-brew source tarball generating -- [why] isn't that in SCons?
+
+#  * usability and documentation for "./configure; make" users
+
+#  * too much cruft in toplevel SConstruct
+
+#  * (optional) operation without CVS directories, from tarball
+
+#  * more program configure tests, actually use full executable name
 
 #  * install doc
 
@@ -70,6 +81,7 @@ prefix=os.path.join (os.environ['HOME'], 'usr', 'pkg', 'lilypond')
 
 #  * grep FIXME $(find . -name 'S*t')
 
+#  * drop "fast"
 
 import re
 import glob
@@ -93,18 +105,26 @@ TARGETS: clean, config, doc, dist, install, mf-essential, po-update,
 
 config_cache = 'scons.cache'
 
+# append test_program variables automagically?
 config_vars = [
        'BASH',
+       'BYTEORDER',
+       'CC',
        'CCFLAGS',
        'CPPPATH',
        'CPPDEFINES',
+       'CXX',
        'CXXFLAGS',
        'DEFINES',
+       'FONTFORGE',
+       'GCC',
+       'GXX',
        'LIBS',
        'LINKFLAGS',
        'METAFONT',
        'PERL',
        'PYTHON',
+       'SH',
        ]
 
 # Put your favourite stuff in custom.py
@@ -131,7 +151,7 @@ opts.AddOptions (
        BoolOption ('checksums', 'use checksums instead of timestamps',
                    0),
        BoolOption ('fast', 'use timestamps, implicit cache, prune CPPPATH',
-                   1),
+                   0),
        )
 
 srcdir = Dir ('.').srcnode ().abspath
@@ -146,14 +166,19 @@ for key in ['LD_LIBRARY_PATH', 'GUILE_LOAD_PATH', 'PKG_CONFIG_PATH']:
        if os.environ.has_key (key):
                ENV[key] = os.environ[key]
 
+for key in config_vars:
+       if os.environ.has_key (key):
+               ENV[key] = os.environ[key]
+
 env = Environment (
        ENV = ENV,
 
-       BASH = '/bin/bash',
+       #BASH = '/bin/bash',
+       BYTEORDER = sys.byteorder.upper (),
        CPPDEFINES = '-DHAVE_CONFIG_H',
-       PERL = '/usr/bin/perl',
-       PYTHON = '/usr/bin/python',
-       SH = '/bin/sh',
+       #PERL = '/usr/bin/perl',
+       #PYTHON = '/usr/bin/python',
+       #SH = '/bin/sh',
 
        MAKEINFO = 'LANG= makeinfo',
        MF_TO_TABLE_PY = srcdir + '/buildscripts/mf-to-table.py',
@@ -248,18 +273,8 @@ def configure (target, source, env):
                        v = v[:-1]
                return string.split (v, '.')
 
-       def get_fullname (program):
-               command = 'type -p "%s" 2>/dev/null' % program
-               pipe = os.popen (command)
-               output = pipe.readlines ()
-               if pipe.close ():
-                       return None
-               o = output[-1]
-               if o[-1] == '\n':
-                       o = o[:-1]
-               return string.split (o)[-1]
-
-       def test_version (lst, program, minimal, description, package):
+       def test_version (lst, full_name, minimal, description, package):
+               program = os.path.basename (full_name)
                sys.stdout.write ('Checking %s version... ' % program)
                actual = get_version (program)
                if not actual:
@@ -277,13 +292,18 @@ def configure (target, source, env):
 
        def test_program (lst, program, minimal, description, package):
                sys.stdout.write ('Checking for %s ... ' % program)
-               f = get_fullname (program)
+               f = WhereIs (program)
                if not f:
                        print 'not found'
                        lst.append ((description, package, minimal, program,
                                     'not installed'))
                        return 0
                print f
+               key = program.upper ()
+               if key.find ('+-'):
+                       key = re.sub ('\+', 'X', key)
+                       key = re.sub ('-', '_', key)
+               env[key] = f
                return test_version (lst, program, minimal, description, package)
 
        def test_lib (lst, program, minimal, description):
@@ -300,7 +320,7 @@ def configure (target, source, env):
                        return 1
                return 0
 
-       for i in ['bash', 'perl', 'python', 'sh']:
+       for i in []: #['bash', 'perl', 'python', 'sh']:
                sys.stdout.write ('Checking for %s... ' % i)
                c = WhereIs (i)
                key = string.upper (i)
@@ -314,26 +334,28 @@ def configure (target, source, env):
                sys.stdout.write ('\n')
 
        required = []
+       test_program (required, 'bash', '2.0', 'Bash', 'bash')
        test_program (required, 'gcc', '2.8', 'GNU C compiler', 'gcc')
        test_program (required, 'g++', '3.0.5', 'GNU C++ compiler', 'g++')
-       test_program (required, 'python', '2.1', 'Python (www.python.org)', 'python')
        test_program (required, 'guile-config', '1.6', 'GUILE development',
                        'libguile-dev or guile-devel')
-       # Do not use bison 1.50 and 1.75.
-       test_program (required, 'bison', '1.25', 'Bison -- parser generator',
-                       'bison')
-       test_program (required, 'flex', '0.0', 'Flex -- lexer generator', 'flex')
+       test_program (required, 'python', '2.1', 'Python (www.python.org)', 'python')
+       test_program (required, 'sh', '0.0', 'Bourne shell', 'sh')
 
        optional = []
-       test_program (optional, 'makeinfo', '4.7', 'Makeinfo tool', 'texinfo')
+       # Do not use bison 1.50 and 1.75.
+       test_program (optional, 'bison', '1.25', 'Bison -- parser generator',
+                       'bison')
+       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', 'Ghostscript PostScript interpreter', 'gs or gs-afpl or gs-esp or gs-gpl')
        test_program (optional, 'mftrace', '1.1.0', 'Metafont tracing Type1',
                        'mftrace')
+       test_program (optional, 'makeinfo', '4.7', 'Makeinfo tool', 'texinfo')
        test_program (optional, 'perl', '4.0',
                        'Perl practical efficient readonly language', 'perl')
        #test_program (optional, 'foo', '2.0', 'Foomatic tester', 'bar')
-       test_program (optional, 'fontforge', '20041224.0', 'FontForge', 'fontforge')
+       test_program (optional, 'fontforge', '0.0.20041224', 'FontForge', 'fontforge')
 
        def CheckYYCurrentBuffer (context):
                context.Message ('Checking for yy_current_buffer... ')
@@ -364,11 +386,11 @@ def configure (target, source, env):
        conf.env.Append (DEFINES = defines)
 
        command = r"""python -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'""" #"
-       PYTHON_INCLUDE = os.popen (command).read ()
+       PYTHON_INCLUDE = os.popen (command).read ()#[:-1]
        if env['fast']:
-               env.Append (CCFLAGS = ['-I%s ' % PYTHON_INCLUDE])
+               env.Append (CCFLAGS = ['-I%s' % PYTHON_INCLUDE])
        else:
-               env.Append (CPPPATH = PYTHON_INCLUDE)
+               env.Append (CPPPATH = [PYTHON_INCLUDE])
 
        headers = ('sys/stat.h', 'assert.h', 'kpathsea/kpathsea.h', 'libio.h',
                   'Python.h')
@@ -442,11 +464,6 @@ def configure (target, source, env):
                        
                if conf.CheckCHeader ('pango/pangofc-fontmap.h'):
                        conf.env['DEFINES']['HAVE_PANGO_PANGOFC_FONTMAP_H'] = '1'
-               if conf.CheckLib ('pango-1.0',
-                                 'pango_fc_font_map_add_decoder_find_func'):
-                       conf.env['DEFINES']['HAVE_PANGO16'] = '1'
-                       conf.env['DEFINES']['HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC'] = '1'
-
        if env['fast']:
                # Using CCFLAGS = -I<system-dir> rather than CPPPATH = [
                # <system-dir>] speeds up SCons
@@ -558,12 +575,11 @@ if os.environ.has_key ('TEXMF'):
 env.Append (ENV = {
        'TEXMF' : '{$LILYPONDPREFIX,' \
        + os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}',
-       'LILYPONDPREFIX' : os.path.join (run_prefix, 'share/lilypond'),
+       'LILYPONDPREFIX' : os.path.join (run_prefix, 'share/lilypond/', version),
        })
 
 BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py'
-BUILD_LILYPOND = '${set__x}$PYTHON $srcdir/scripts/lilypond.py${__verbose}'
-BUILD_LILYPOND_BIN = '$absbuild/$out/lilypond-bin ${__verbose}'
+BUILD_LILYPOND = '$absbuild/lily/$out/lilypond ${__verbose}'
 BUILD_LILYPOND_BOOK = '$PYTHON $srcdir/scripts/lilypond-book.py --verbose'
 
 
@@ -584,7 +600,8 @@ env.Append (
        LILYPOND_BOOK = BUILD_LILYPOND_BOOK,
        LILYPOND_BOOK_FORMAT = 'texi-html',
        MAKEINFO_FLAGS = '--css-include=$srcdir/Documentation/texinfo.css',
-
+       # should not be necessary
+       # PYTHONPATH = ['$absbuild/python/$out'],
        TEXI2DVI_PAPERSIZE = '@afourpaper',
        TEXI2DVI_FLAGS = [ '-t $TEXI2DVI_PAPERSIZE'],
        DVIPS_PAPERSIZE = 'a4',
@@ -669,7 +686,7 @@ env.Command (version_hh, '#/VERSION',
 # post-config environment update
 env.Append (
        run_prefix = run_prefix,
-       LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond'),
+       LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond/', version),
 
        # FIXME: move to lily/SConscript?
        LIBPATH = [os.path.join (absbuild, 'flower', env['out']),
@@ -731,6 +748,8 @@ def symlink_tree (target, source, env):
             # @  := out
             # /$ := add dst file_name
             (('python',     'lib/lilypond/python'),
+             # ugh
+             ('python',     'share/lilypond/%(ver)s/python'),
              ('lily/',      'bin/lilypond'),
              ('scripts/',   'bin/convert-ly'),
              ('scripts/',   'bin/lilypond-book'),
@@ -773,7 +792,8 @@ def symlink_tree (target, source, env):
 
 if env['debugging']:
        stamp = os.path.join (run_prefix, 'stamp')
-       env.Command (stamp, 'SConstruct', [symlink_tree, 'touch $TARGET'])
+       env.Command (stamp, ['#/SConstruct', '#/VERSION'],
+                    [symlink_tree, 'touch $TARGET'])
        env.Depends ('lily', stamp)
        
 #### dist, tar
@@ -812,6 +832,14 @@ def flatten (tree, lst):
                                lst.append (i)
        return lst
 
+if os.path.isdir ('$srcdir/CVS'):
+       subdirs = flatten (cvs_dirs ('.'), [])
+else:
+       # ugh
+       command = 'cd %(srcdir)s \
+       && find . -name SConscript | sed s@/SConscript@@' % vars ()
+       subdirs = string.split (os.popen (command).read ())
+
 if env['fast']\
    and 'all' not in COMMAND_LINE_TARGETS\
    and 'doc' not in COMMAND_LINE_TARGETS\
@@ -824,10 +852,12 @@ if env['fast']\
                   'ttftool',
                   'mf',
                   ]
+
+if os.path.isdir ('$srcdir/CVS'):
+       src_files = reduce (lambda x, y: x + y, map (cvs_files, subdirs))
 else:
-       subdirs = flatten (cvs_dirs ('.'), [])
+       src_files = ['foobar']
 
-src_files = reduce (lambda x, y: x + y, map (cvs_files, subdirs))
 readme_files = ['AUTHORS', 'README', 'INSTALL', 'NEWS']
 txt_files = map (lambda x: x + '.txt', readme_files)
 
index f4516812675518acbe54bfda16703571838a0b92..02fd51f927886193f4034306174358b438aff813 100644 (file)
@@ -68,14 +68,14 @@ env.Append (BUILDERS = {'HH' : HH})
 env.Append (
        _fixme = _fixme,
        ABC2LY = 'abc2ly',
-       LILYPOND = 'lilypond',
-       LILYPOND_BIN = 'lilypond-bin',
+       ##LILYPOND = 'lilypond',
        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'],
+       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_PATH = [],
        # The SCons way around FOO_PATH:
@@ -85,7 +85,8 @@ env.Append (
        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 = '$( ${_concat(" ", TEXI2DVI_FLAGS,)} $)',
        )
@@ -111,7 +112,7 @@ TEXI =\
      Builder (action =
              '$LILYPOND_BOOK --output=${TARGET.dir} \
              --include=${TARGET.dir} $LILYPOND_INCFLAGS \
-             --process="$LILYPOND_BIN $LILYPOND_INCFLAGS" \
+             --process="$LILYPOND $LILYPOND_INCFLAGS" \
              $LILYPOND_BOOK_FLAGS \
              $SOURCE',
              suffix = '.texi', src_suffix = '.tely')
@@ -160,8 +161,6 @@ def add_ps_target (target, source, env):
        base = os.path.splitext (str (target[0]))[0]
        return (target + [base + '.ps'], source)
 
-# TODO: 
-# FIXME: INCLUDES, FLAGS, use LILYPOND_BIN for building ? 
 lilypond =\
         Builder (action = '$LILYPOND --output=${TARGET.base} --include=${TARGET.dir} $SOURCE',
                  suffix = '.pdf', src_suffix = '.ly')
@@ -176,6 +175,10 @@ def add_log_target (target, source, env):
        base = os.path.splitext (str (target[0]))[0]
        return (target + [base + '.log'], source)
 
+def add_tfm_target (target, source, env):
+       base = os.path.splitext (str (target[0]))[0]
+       return (target + [base + '.tfm'], source)
+
 def add_lisp_enc_tex_ly_target (target, source, env):
        base = os.path.splitext (str (target[0]))[0]
        return (target + [base + '.lisp', base + '.enc', base + '.tex',
@@ -229,7 +232,7 @@ pfa = Builder (action = a,
 env.Append (BUILDERS = {'PFA': pfa})
 
 a = ['(cd ${TARGET.dir} && fontforge -script ${SOURCE.file})',
-     '$PYTHON $srcdir/buildscripts/ps-embed-cff.py ${SOURCE.filebase}.cff $(${SOURCE.filebase}).fontname) ${SOURCE.filebase}.cff.ps',
+     '$PYTHON $srcdir/buildscripts/ps-embed-cff.py ${SOURCE.base}.cff $$(cat ${SOURCE.base}.fontname) ${SOURCE.base}.cff.ps',
      'rm -f ${TARGET.dir}/*.scale.pfa']
 otf = Builder (action = a,
               suffix = '.otf',
@@ -273,7 +276,8 @@ atvars = [
 
 # naming
 def at_copy (target, source, env):
-    s = open (str (source[0])).read ()
+    n = str (source[0])
+    s = open (n).read ()
     for i in atvars:
            if env.has_key (i):
                    s = string.replace (s, '@%s@'% i, env[i])
@@ -286,6 +290,22 @@ 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 ()
+    for i in atvars:
+           if env.has_key (i):
+                   s = string.replace (s, '@%s@'% i, env[i])
+    # whugh
+    e = os.path.splitext (n)[1]
+    t = str (target[0]) + e
+    open (t, 'w').write (s)
+
+AT_COPY_EXT = Builder (action = at_copy_ext, src_suffix = ['.py', '.sh',])
+env.Append (BUILDERS = {'AT_COPY_EXT': AT_COPY_EXT})
+
+
 MO = Builder (action = 'msgfmt -o $TARGET $SOURCE',
              suffix = '.mo', src_suffix = '.po')
 env.Append (BUILDERS = {'MO': MO})
@@ -327,11 +347,11 @@ def mutopia (ly = None, abc = None):
        # Override them again to fix web build...
 
        
-       BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py'
-       BUILD_LILYPOND = '${set__x}$PYTHON $srcdir/scripts/lilypond.py${__verbose}'
+       #BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py'
+       #BUILD_LILYPOND = '$absbuild/$out/lilypond ${__verbose}'
        e = env.Copy (
-               LILYPOND = BUILD_LILYPOND,
-               ABC2LY = BUILD_ABC2LY,
+               #LILYPOND = BUILD_LILYPOND,
+               #ABC2LY = BUILD_ABC2LY,
        )
        
        if not abc:
@@ -352,10 +372,10 @@ def collate (title = 'collated files'):
        
        e = env.Copy (
                TITLE = title,
-               LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'"''',
-                                                                                                           __verbose = ' --verbose',
-                                                                                                           )
-       #               
+               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',
+                                                                                                                                      )
+       #
        tely = e.LYS2TELY ('collated-files', ly)
        texi = e.TEXI (tely)
        # We need lily and mf to build these.
index 3e994a29dde980b24391e0b42260aaf58a7ade22..5f81126764262081fdd4b507a9430b70dbfd26a3 100644 (file)
@@ -23,8 +23,9 @@ e.Append (
 
 e.HH ('parser.hh', 'parser.yy')
 e.ParseConfig ('guile-config link')
-lily = e.Program ('lilypond-bin', sources)
+lily = e.Program ('lilypond', sources)
 install (lily, env['bindir'])
 
-po = env.Command ('lilypond.po', cc_sources + includes, env['pocommand'])
-env.Alias ('po-update', po)
+# let's not, for now
+#po = env.Command ('lilypond.po', cc_sources + includes, env['pocommand'])
+#env.Alias ('po-update', po)
index 8262a014f900e6f47d33c9fda7e34ede6fd1a054..163f685190f516e6514509612b6478f7dd4c2164 100644 (file)
@@ -17,7 +17,7 @@ Line_interface::make_arrow (Offset begin, Offset end,
                            Real thick,
                            Real length, Real width)
 {
-  Real angle = (end - begin).arg();
+  Real angle = (end - begin).arg ();
   Array<Offset> points;
   
   points.push (Offset (0, 0));
@@ -113,7 +113,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
 
   SCM type = me->get_property ("style");
 
-  Stencil l;
+  Stencil stil;
   
   SCM dash_fraction = me->get_property ("dash-fraction");
   if (scm_is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
@@ -131,14 +131,12 @@ Line_interface::line (Grob *me, Offset from, Offset to)
       if (period < 0)
        return Stencil ();
 
-      l =  make_dashed_line (thick, from, to, period, fraction);
+      stil =  make_dashed_line (thick, from, to, period, fraction);
     }
   else
-    {
-      l =  make_line (thick, from, to);
-    }
+    stil =  make_line (thick, from, to);
 
-  return l;
+  return stil;
 }
 
 ADD_INTERFACE (Line_interface, "line-interface",
index 152444b0c374c88f4905b14a7cda83a020d9f0b4..a424b66cf4602ab960155d1981cf9a992173774a 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "paper-book.hh"
-#include "paper-score.hh"
+
 #include "main.hh"
 #include "output-def.hh"
 #include "paper-score.hh"
index f55a4c76e4be9edb7915265a51b7abf1568ea5d1..1ff26ea6e5785ded4ff4a1f6cd2b081151ab5ecb 100644 (file)
@@ -225,13 +225,13 @@ of the parse stack onto the heap. */
 %{
 
 int
-yylex (YYSTYPE *s, YYLTYPE *l, void *v)
+yylex (YYSTYPE *s, YYLTYPE *loc, void *v)
 {
        Lily_parser *pars = (Lily_parser*) v;
        Lily_lexer *lex = pars->lexer_;
 
        lex->lexval = (void*) s;
-       lex->lexloc = l;
+       lex->lexloc = loc;
        lex->prepare_for_next_token ();
        return lex->yylex ();
 }
@@ -2671,16 +2671,14 @@ Lily_parser::do_yyparse ()
 }
 
 
-/*
-Should make this optional?    It will also complain when you do
+/* FIXME: Should make this optional?  It will also complain at
 
        [s4]
 
 which is entirely legitimate.
 
-Or we can scrap it. Barchecks should detect wrong durations, and
-skipTypesetting speeds it up a lot.
-*/
+Or we can scrap it.  Barchecks should detect wrong durations, and
+skipTypesetting speeds it up a lot.  */
 
 void
 Lily_parser::beam_check (SCM dur)
index 0e83fc4cdcac61c9914cd479fffbb259fba6dce8..13aad7f6e4b2a8c5f4e9b9b090aa7e8fca1add5d 100644 (file)
@@ -18,7 +18,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/  -I $(builddir)/mf/out/
-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)'"
+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)'"
 
 
 #texi-html for www only:
index 082a9ac2350caf863d7617266bd32cee2e58c8ac..8849d0d9d973df3c0cdad0aee7d5f88ef4daf108 100644 (file)
@@ -1,44 +1,92 @@
 # -*-python-*-
 
 import os
+import re
 import string
 
 Import ('env', 'base_glob', 'install')
-feta = reduce (lambda x, y: x + y,
+xfeta = reduce (lambda x, y: x + y,
               map (lambda x: base_glob (x),
                    ('feta[0-9]*.mf',
                     'feta-alphabet*[0-9].mf',
-                    #'parmesan[0-9]*.mf',
-                    )))
+                    'feta-braces-[a-z]*.mf',
+                    'parmesan[0-9]*.mf',)))
+feta = base_glob ('feta[0-9][0-9]*.mf')
+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 + sauter
-env['feta'] = string.join (feta)
-env['sauter'] = ''
+fonts = feta + feta_alphabet + feta_braces + parmesan + sauter
+#env['feta'] = string.join (feta)
+#env['sauter'] = ''
 
-#BARF
-feta_sizes = ['11']
+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)
-a = map (env.GTABLE, feta)
+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.PE, otfs)
+#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)
 
+# Emmentaler
+a = '''cat ${SOURCE} \
+$$(echo ${SOURCE} | grep -v brace | sed s/feta/parmesan/) \
+$$(echo ${SOURCE} | grep -v brace | sed s/feta/feta-alphabet/) \
+> ${TARGET}'''
+otf_table = Builder (action = a, suffix = '.otf-table',
+                    # barf
+                    src_suffix = '.lisp')
+env.Append (BUILDERS = {'OTF_TABLE': otf_table})
+f = map (env.OTF_TABLE, feta)
+
+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}')
 
 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))
+
+env.AT_COPY ('aybabtu.pe.in')
+env.Command ('aybabtu.fontname', '', 'echo -n aybabtu > $TARGET')
+env.Command ('aybabtu.subfonts',
+            map (lambda x: x + '.mf', feta_braces),
+            'echo ${SOURCES.filebase} > $TARGET')
+
+env.Command ('aybabtu.otf-table',
+            map (lambda x: x + '.otf-table', feta_braces),
+            'cd ${TARGET.dir} && cat ${SOURCES.file} > ${TARGET.file}')
+
+env.Command ('aybabtu.otf-gtable',
+            map (lambda x: x + '.otf-gtable', feta_braces),
+            'echo "(design_size . 20)" > $TARGET')
+
+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')
+
+
 ## FIXME
-##mf_essential = ['feta16', 'feta20', 'parmesan16', ]
-mf_essential = ['feta16', 'feta20',] #'parmesan16', ]
+mf_essential = ['feta16', 'feta20', 'parmesan16', ]
 pfa_essential = map (env.PFA, mf_essential)
 env.Alias ('mf-essential', pfa_essential)
 
@@ -46,7 +94,7 @@ env.Command ('cmr.enc', 'cmr.enc.in', 'cp $SOURCE $TARGET')
 env.Alias ('mf', 'cmr.enc')
 
 env.Command ('lilypond.map', p,
-            ['for i in $feta; do echo $$i $$i "<"$$i.pfa; done > $TARGET',
+            ['for i in $fonts; do echo $$i $$i "<"$$i.pfa; done > $TARGET',
              'for i in $feta_sizes; do\
              echo "Emmentaler-$$i Emmentaler-$$i <emmentaler-$$i.cff.ps";\
              echo "PFAEmmentaler-$$i PFAEmmentaler-$$i <PFAemmentaler-$$i.pfa";\
@@ -71,7 +119,7 @@ env.Command ('Fontmap', p,
 
 env.Command ('Fontmap.lily', p + ['Fontmap'],
             ['echo "%!" > $TARGET',
-             '''for i in $feta; do echo "/$$i ($$i.pfa);"; done >> $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);" ; \
@@ -85,6 +133,10 @@ env.Alias ('mf', 'Fontmap.lily')
 env.Alias ('mf', pfa_essential + p + map (lambda x: x[0], o))
 
 install (t, env['sharedir_package_version'] + '/fonts/tfm')
-install (a, env['sharedir_package_version'] + '/afm')
 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')
+
index 065d2032f0be9889fc3e0e0a9b2d48dee2ecc3a6..a621d146d0ad5844cd27ddeec3d43c253a0bb40c 100644 (file)
@@ -4,10 +4,10 @@ Import ('env', 'install', 'src_glob')
 py = src_glob ('*.py')
 c = src_glob ('*.c')
 
-pym = env.AT_COPY (py)
-cm = env.SharedObject (c)
+pym = map (env.AT_COPY_EXT, py)
+cm = map (env.SharedObject, c)
 
 pym
 cm
 
-install ([cm, pym], env['sharedir_package_version'] + '/python')
+install (cm + pym, env['sharedir_package_version'] + '/python')
index 5f24fbe26faf6922199908fe1300dcba30e4dce4..b3a1beab328023f4a7582062c73c3130ee52bb6a 100644 (file)
@@ -7,7 +7,9 @@ outdir = Dir ('.').path
 
 name = 'ttftool'
 e = env.Copy ()
-e.Append (CPPPATH = ['#/flower/include', '#/ttftool/include', outdir,])
+e.Append (CPPPATH = ['#/flower/include', '#/ttftool/include', outdir],
+         # sigh
+         CPPDEFINES = ['-D${BYTEORDER}ENDIAN', '-DSMALLENDIAN=LITTLEENDIAN'],)
 if env['static']:
        e.Library (name, sources) 
 if not env['static'] or env['shared']: