X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=SConstruct;h=6ec14e2274343aaa9aea12cab07c8a56fa1947be;hb=543171165412bc915d8ea1f308d070c74924b2f1;hp=40949dc51106b23e698931ebb09d0a95a78af76b;hpb=13a8e28de140702edbb0629002073972008e17ad;p=lilypond.git diff --git a/SConstruct b/SConstruct index 40949dc511..6ec14e2274 100644 --- a/SConstruct +++ b/SConstruct @@ -22,7 +22,7 @@ Run from build tree PATH=$run/bin:$PATH #optionally, if you do not use custom.py below - #export LILYPONDPREFIX=$run/share/lilypond/ + #export LILYPOND_DATADIR=$run/share/lilypond/ lilypond input/simple @@ -134,7 +134,6 @@ config_vars = [ 'LIBS', 'LINKFLAGS', 'MF', - 'MFTRACE', 'PERL', 'PYTHON', 'SH', @@ -171,16 +170,26 @@ srcdir = Dir ('.').srcnode ().abspath #ugh sys.path.append (os.path.join (srcdir, 'stepmake', 'bin')) -import packagepython - -package = packagepython.Package (srcdir) -version = packagepython.version_tuple_to_str (package.version) - -ENV = { 'PATH' : os.environ['PATH'] } -for key in ['LD_LIBRARY_PATH', 'GUILE_LOAD_PATH', 'PKG_CONFIG_PATH', 'TEXMF']: +try: + import packagepython + packagepython.Package (srcdir) + packagepython.version_tuple_to_str (package.version) +except: + print '*** FIXME: no packagepython. setting version to 1.0' + class Package: + name = 'lilypond' + release_dir = '.' + package = Package + version = '1.0' + +ENV = { 'PYTHONPATH': '' } +for key in ['GUILE_LOAD_PATH', 'LD_LIBRARY_PATH', 'PATH', 'PKG_CONFIG_PATH', + 'PYTHONPATH', 'TEXMF']: if os.environ.has_key (key): ENV[key] = os.environ[key] +ENV['PYTHONPATH'] = os.path.join (srcdir, 'python') + ':' + ENV['PYTHONPATH'] + env = Environment ( ENV = ENV, BYTEORDER = sys.byteorder.upper (), @@ -242,7 +251,7 @@ if not os.path.exists (cachedir): CacheDir (cachedir) -# No need to set $LILYPONDPREFIX to run lily, but cannot install... +# No need to set $LILYPOND_DATADIR to run lily, but cannot install... if env['debugging'] and not 'install' in COMMAND_LINE_TARGETS: env['prefix'] = run_prefix @@ -313,7 +322,6 @@ def symlink_tree (target, source, env): ('scripts/', 'bin/lilypond-book'), ('scripts/', 'bin/ps2png'), ('mf', 'share/lilypond/%(ver)s/dvips/mf-out'), - ('#ps', 'share/lilypond/%(ver)s/dvips/ps'), ('#ps/music-drawing-routines.ps', 'share/lilypond/%(ver)s/tex/music-drawing-routines.ps'), ('mf', 'share/lilypond/%(ver)s/otf'), @@ -420,14 +428,11 @@ def configure (target, source, env): 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, 'guile-config', '1.6', 'GUILE development', + test_program (required, 'gcc', '4.0', 'GNU C compiler', 'gcc') + test_program (required, 'g++', '4.0.5', 'GNU C++ compiler', 'g++') + test_program (required, 'guile-config', '1.8', 'GUILE development', 'libguile-dev or guile-devel') test_program (required, 'mf', '0.0', 'Metafont', 'tetex-bin') - test_program (required, 'mftrace', '1.1.9', - 'mftrace (http://xs4all.nl/~hanwen/mftrace)', 'mftrace') - test_program (required, 'potrace', '0.0', 'Potrace', 'potrace') test_program (required, 'python', '2.1', 'Python (www.python.org)', 'python') # Silly, and breaks with /bin/sh == dash @@ -438,21 +443,17 @@ def configure (target, source, env): #test_program (optional, 'foo', '2.0', 'Foomatic tester', 'bar') 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.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, 'guile', '1.8', 'GUILE scheme', 'guile') 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.19', 'Metafont tracing Type1', - 'mftrace') - test_program (optional, 'makeinfo', '4.7', 'Makeinfo tool', 'texinfo') + test_program (optional, 'makeinfo', '4.8', 'Makeinfo tool', 'texinfo') test_program (optional, 'perl', '4.0', 'Perl practical efficient readonly language', 'perl') - #test_program (optional, 'ps2pdf', '0.0', 'Ps2pdf', 'gs') def CheckYYCurrentBuffer (context): context.Message ('Checking for yy_current_buffer... ') @@ -661,17 +662,17 @@ SConscript ('buildscripts/builder.py') env.PrependENVPath ('PATH', os.path.join (env['absbuild'], env['out'], 'usr/bin')) -LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond/', version) +LILYPOND_DATADIR = os.path.join (run_prefix, 'share/lilypond/', version) -if not os.path.exists (LILYPONDPREFIX): - os.makedirs (LILYPONDPREFIX) +if not os.path.exists (LILYPOND_DATADIR): + os.makedirs (LILYPOND_DATADIR) -env.Command (LILYPONDPREFIX, ['#/SConstruct', '#/VERSION'], symlink_tree) -env.Depends ('lily', LILYPONDPREFIX) +env.Command (LILYPOND_DATADIR, ['#/SConstruct', '#/VERSION'], symlink_tree) +env.Depends ('lily', LILYPOND_DATADIR) env.Append (ENV = { - 'LILYPONDPREFIX' : LILYPONDPREFIX, - 'TEXMF' : '{$LILYPONDPREFIX,' + 'LILYPOND_DATADIR' : LILYPOND_DATADIR, + 'TEXMF' : '{$LILYPOND_DATADIR,' + os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}', }) @@ -679,6 +680,9 @@ BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py' BUILD_LILYPOND = '$absbuild/lily/$out/lilypond ${__verbose}' BUILD_LILYPOND_BOOK = '$PYTHON $srcdir/scripts/lilypond-book.py ${__verbose}' +if env['verbose'] and env['verbose'] != '0': + env['__verbose'] = ' --verbose' + env['set__x'] = 'set -x;' # post-option environment-update env.Append ( @@ -694,22 +698,11 @@ env.Append ( libdir_package = libdir_package, libdir_package_version = libdir_package_version, - # global build verbosity switch - __verbose = ' --verbose', - LILYPOND = BUILD_LILYPOND, ABC2LY = BUILD_ABC2LY, LILYPOND_BOOK = BUILD_LILYPOND_BOOK, LILYPOND_BOOK_FORMAT = 'texi-html', MAKEINFO_FLAGS = '--css-include=$srcdir/Documentation/texinfo.css', - # PYTHONPATH = ['$absbuild/python/$out'], - TEXI2DVI_PAPERSIZE = '@afourpaper', - TEXI2DVI_FLAGS = [ '-t$TEXI2DVI_PAPERSIZE'], - DVIPS_PAPERSIZE = 'a4', - DVIPS_FLAGS = ['-t$DVIPS_PAPERSIZE', - '-u+lilypond.map', - '-u+ec-mftrace.map'], - PSPDF_FLAGS = ['-sPAPERSIZE=$DVIPS_PAPERSIZE'], ) env.Append (CCFLAGS = ['-pipe', '-Wno-pmf-conversions']) @@ -726,11 +719,6 @@ env.Append (LINKFLAGS = ['-Wl,--export-dynamic']) # FIXME: ParseConfig ignores -L flag? env.Append (LINKFLAGS = ['-L/usr/X11R6/lib']) -if env['verbose']: - env['__verbose'] = ' --verbose' - env['set__x'] = 'set -x;' - - ## Explicit target and dependencies if 'clean' in COMMAND_LINE_TARGETS: @@ -761,10 +749,6 @@ if 'realclean' in COMMAND_LINE_TARGETS: os.unlink (config_cache) Exit (s) -def symlink_tree (): - print "BOE" - raise urg - # Declare SConscript phonies env.Alias ('minimal', config_cache) @@ -801,7 +785,7 @@ env.Command (version_hh, '#/VERSION', # post-config environment update env.Append ( run_prefix = run_prefix, - LILYPONDPREFIX = LILYPONDPREFIX, + LILYPOND_DATADIR = LILYPOND_DATADIR, # FIXME: move to lily/SConscript? LIBPATH = [os.path.join (absbuild, 'flower', env['out'])], @@ -980,3 +964,4 @@ for d in subdirs: env.BuildDir (b, d, duplicate = 0) SConscript (os.path.join (b, 'SConscript')) +env.Command ('tree', ['#/VERSION', '#/SConstruct'], symlink_tree)