From: Jan Nieuwenhuizen Date: Mon, 12 Jul 2004 19:35:49 +0000 (+0000) Subject: Updates. Add targets: tar, dist, release. X-Git-Tag: release/2.3.7~65 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0568120713137e8d51f39f2a95f57c8e8cb5587d;p=lilypond.git Updates. Add targets: tar, dist, release. --- diff --git a/ChangeLog b/ChangeLog index c3d55e2216..c403bcb875 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2004-07-12 Jan Nieuwenhuizen - * SConstruct: Updates. + * SConstruct: Updates. Add targets: tar, dist, release. 2004-07-11 Jan Nieuwenhuizen diff --git a/Documentation/SConscript b/Documentation/SConscript index 1fe44ad51c..56b9039c03 100644 --- a/Documentation/SConscript +++ b/Documentation/SConscript @@ -11,15 +11,3 @@ sources = ['index.html.in', 'texinfo.css'] os.chdir (here) outdir = os.path.join (env['build'], reldir, env['out']) -all_sources = ['SConscript',] + sources - -# ballprefix = env['ballprefix'] + '/Documentation' -# ball = Builder (prefix = ballprefix + '/', action = 'ln $SOURCE $TARGET') -# et = env.Copy (BUILDERS = {'BALL': ball}) -# ballize = map (et.BALL, all_sources) -# tar = env.Tar (env['tarball'], -# map (lambda x: os.path.join (ballprefix, x), all_sources)) - -tar = env['baller'] ('Documentation', all_sources, env) -#env.Alias ('tar', tar) - diff --git a/Documentation/user/SConscript b/Documentation/user/SConscript index 4b444a508d..2798c17df6 100644 --- a/Documentation/user/SConscript +++ b/Documentation/user/SConscript @@ -99,12 +99,3 @@ env.Alias ('doc', pdfs) env.Alias ('doc', 'lilypond-internals/lilypond.html') env.Alias ('doc', 'lilypond-internals/lilypond-internals.html') - -all_sources = ['SConscript',] + sources + pngs - -ballprefix = env['ballprefix'] + '/Documentation/user' -ball = Builder (prefix = ballprefix + '/', action = 'ln $SOURCE $TARGET') -et = env.Copy (BUILDERS = {'BALL': ball}) -ballize = map (et.BALL, all_sources) -tar = env.Tar (env['tarball'], - map (lambda x: os.path.join (ballprefix, x), all_sources)) diff --git a/SConstruct b/SConstruct index c2ffacbab4..95c2253ccd 100644 --- a/SConstruct +++ b/SConstruct @@ -37,8 +37,8 @@ prefix=os.path.join (os.environ['HOME'], 'usr', 'pkg', 'lilypond') # TODO: -# * TARBALL # * add missing dirs +# * cleanup # * separate environments? # - compile environment checks headers and libraries @@ -78,8 +78,7 @@ env.Alias ('all', ['lily', 'mf', 'input', 'Documentation']) ## FIXME: opts in function # Put your favourite stuff in custom.py -opts = Options ('custom.py', ARGUMENTS) -#opts = Options (['config.cache', 'custom.py'], ARGUMENTS) +opts = Options (['config.cache', 'custom.py'], ARGUMENTS) opts.Add ('prefix', 'Install prefix', '/usr/') opts.Add ('out', 'Output directory', 'out-scons') opts.Add ('build', 'Build directory', '.') @@ -105,7 +104,7 @@ Help (usage + opts.GenerateHelpText (env)) env = Environment (options = opts) opts.Update (env) -#opts.Save ('config.cache', env) +opts.Save ('config.cache', env) env.CacheDir (os.path.join (env['build'], '=build-cache')) @@ -332,6 +331,7 @@ def configure (env): # Hmm. Must configure when building lily, to get compiler and linker # flags set-up. +# FIXME if not os.path.exists (config_h) or 'config' in COMMAND_LINE_TARGETS\ or 'lily' in BUILD_TARGETS or 'all' in BUILD_TARGETS: env = configure (env) @@ -378,41 +378,8 @@ env['MAKEINFO_PATH'] = ['.', '#/Documentation/user', ## TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper) env['TEXINFO_PAPERSIZE_OPTION'] = '-t @afourpaper' -tarbase = package.name + '-' + env['version'] -tarname = tarbase + '.tar.gz' - -if 0: # broken :-( - ballprefix = os.path.join (outdir, tarbase) - tarball = os.path.join (outdir, tarname) -else: - ballprefix = os.path.join (os.getcwd (), tarbase) - tarball = os.path.join (os.getcwd (), tarname) -env['tarball'] = tarball -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'] - -#testing -env.Append (TARFLAGS = '-z --owner=0 --group=0') -env.Append (GZIPFLAGS = '-9') -#all_sources = ['SConstruct', 'VERSION', '.cvsignore']\ -# + readme_files #+ patch_files # + readme_txt -all_sources = ['SConstruct', 'VERSION']\ - + readme_files -# + readme_files + readme_txt -# + readme_files + patch_files + readme_txt - -env['sources'] = all_sources - -map (lambda x: env.Texi2txt (x, os.path.join ('Documentation/topdocs', - os.path.splitext (x)[0])), - readme_txt) - for d in subdirs: b = os.path.join (build, d, out) # Support clean sourctree build (srcdir build) @@ -436,7 +403,6 @@ def symlink_tree (prefix): os.mkdir (dir) os.chdir (dir) map (mkdir, string.split (dir, os.sep)) - #srcdir = os.getcwd () def symlink (src, dst): os.chdir (absbuild) dir = os.path.dirname (dst) @@ -468,21 +434,44 @@ if env['debugging']: if not os.path.exists (prefix): symlink_tree (prefix) -#ball = Builder (prefix = ballprefix + '/', action = 'ln $SOURCE $TARGET') -#et = env.Copy (BUILDERS = {'BALL': ball}) -#ballize = map (et.BALL, all_sources) -#tar = env.Tar (tarball, map (lambda x: os.path.join (env['ballprefix'], x), -# all_sources)) -tar = env['baller'] ('', all_sources, env) +#### dist, tar +src_files = ['ChangeLog', '.cvsignore', 'Documentation/index.html.in', + 'lily/beam.cc'] + +def cvs_files (dir): + entries = open (os.path.join (dir, 'CVS/Entries')).readlines () + files = filter (lambda x: x[0] != 'D', entries) + return map (lambda x: os.path.join (dir, x[1:x[1:].index ('/')+1]), + files) + +readme_files = ['AUTHORS', 'README', 'INSTALL', 'NEWS'] +foo = map (lambda x: env.Texi2txt (x + '.txt', + os.path.join ('Documentation/topdocs', + x)), + readme_files) +txt_files = map (lambda x: x + '.txt', readme_files) +src_files = reduce (lambda x, y: x + y, map (cvs_files, subdirs)) +tar_base = package.name + '-' + env['version'] +tar_name = tar_base + '.tar.gz' +ball_prefix = os.path.join (outdir, tar_base) +tar_ball = os.path.join (outdir, tar_name) + +dist_files = src_files + txt_files +ball_files = map (lambda x: os.path.join (ball_prefix, x), dist_files) +map (lambda x: env.Depends (tar_ball, x), ball_files) +map (lambda x: env.Command (os.path.join (ball_prefix, x), x, + 'ln $SOURCE $TARGET'), dist_files) +tar = env.Command (tar_ball, src_files, + 'tar czf $TARGET -C $TARGET.dir %s' % tar_base) env.Alias ('tar', tar) -distball = os.path.join (package.release_dir, tarname) -env.Command (distball, tarball, +dist_ball = os.path.join (package.release_dir, tar_name) +env.Command (dist_ball, tar_ball, '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.Depends ('dist', dist_ball) +patch_name = os.path.join (outdir, tar_base + '.diff.gz') +patch = env.PATCH (patch_name, tar_ball) +env.Depends (patch_name, dist_ball) env.Alias ('release', patch) diff --git a/buildscripts/builder.py b/buildscripts/builder.py index cee43ad396..889c347e02 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -200,23 +200,3 @@ a = ('%(PYTHON)s %(DIFF_PY)s%(verbose)s'\ patch = Builder (action = a, suffix = '.diff', src_suffix = '.tar.gz') env.Append (BUILDERS = {'PATCH': patch}) -# ughr -def ln (target, source, env): - base = os.path.splitext (source[0].name)[0] - suf = os.path.splitext (str (source[0]))[1] - if suf: - target = [target[0].path + suf,] - source = [re.sub ('/' + env['out'] + '/', '/', base + suf)] - return (target, source) - -def baller (dir_name, sources, env): - ballprefix = os.path.join (env['ballprefix'], dir_name) - ball = Builder (prefix = ballprefix + '/', - action = 'ln $SOURCE $TARGET', - emitter = ln) - et = env.Copy (BUILDERS = {'BALL': ball}) - ballize = map (et.BALL, sources) - return env.Tar (env['tarball'], - map (lambda x: os.path.join (ballprefix, x), sources)) - -env['baller'] = baller diff --git a/flower/SConscript b/flower/SConscript index 56dd850762..ee17272806 100644 --- a/flower/SConscript +++ b/flower/SConscript @@ -8,7 +8,6 @@ here = os.getcwd () reldir = str (Dir ('.').srcnode ()) os.chdir (reldir) sources = glob.glob ('*.cc') -includes = glob.glob ('include/*.hh') os.chdir (here) outdir = os.path.join (env['build'], reldir, env['out']) @@ -19,13 +18,3 @@ if env['static']: e.Library (name, sources) if not env['static'] or env['shared']: e.SharedLibrary (name, sources) - -all_sources = ['SConscript',] + sources + includes -all_sources = ['SConscript', 'GNUmakefile'] -ballprefix = env['ballprefix'] + '/flower' -ball = Builder (prefix = ballprefix + '/', action = 'ln $SOURCE $TARGET') -et = env.Copy (BUILDERS = {'BALL': ball}) -#et = env.Copy () -ballize = map (et.BALL, all_sources) -tar = env.Tar (env['tarball'], - map (lambda x: os.path.join (ballprefix, x), all_sources)) diff --git a/input/SConscript b/input/SConscript index dbfffa230f..1e3c40092f 100644 --- a/input/SConscript +++ b/input/SConscript @@ -24,7 +24,3 @@ mfbuild = os.path.join (env['absbuild'], 'mf', env['out']) #e.Depends ('doc', 'fonts') env.Depends ('doc', mfbuild) env.Depends ('doc', LILYPOND_BIN) - -#testing -all_sources = ['SConscript',] + sources + abc_sources -x = env.Tar (env['tarball'], all_sources) diff --git a/lily/SConscript b/lily/SConscript index 5e29d15bc0..69769b51dd 100644 --- a/lily/SConscript +++ b/lily/SConscript @@ -41,14 +41,3 @@ env.Install (env['bindir'], lily) env.Alias ('install', env['bindir']) env.Alias ('lily', lily) - -all_sources = ['SConscript',] + sources + includes -# ballprefix = env['ballprefix'] + '/lily' -# ball = Builder (prefix = ballprefix + '/', action = 'ln $SOURCE $TARGET') -# et = env.Copy (BUILDERS = {'BALL': ball}) -# ballize = map (et.BALL, all_sources) -# tar = env.Tar (env['tarball'], -# map (lambda x: os.path.join (ballprefix, x), all_sources)) - -tar = env['baller'] ('lily', all_sources, env) -#env.Alias ('tar', tar) diff --git a/ly/SConscript b/ly/SConscript index 871ab3207b..c5f1d69bd2 100644 --- a/ly/SConscript +++ b/ly/SConscript @@ -14,7 +14,3 @@ outdir = os.path.join (env['build'], reldir, env['out']) lydir = os.path.join (env['sharedir_package_version'], 'ly') env.Install (lydir, sources) env.Alias ('install', lydir) - -#testing -all_sources = ['SConscript',] + sources -x = env.Tar (env['tarball'], all_sources) diff --git a/mf/SConscript b/mf/SConscript index f3deeb151f..8f7b6017b2 100644 --- a/mf/SConscript +++ b/mf/SConscript @@ -47,7 +47,3 @@ env.Alias ('install', pfadir) map (lambda x: env.Alias ('fonts', x), t + a + p) env.Command ('cmr.enc', 'cmr.enc.in', 'cp $SOURCE $TARGET') env.Alias ('fonts', 'cmr.enc') - -#testing -all_sources = ['SConscript',] + sources -x = env.Tar (env['tarball'], all_sources) diff --git a/scm/SConscript b/scm/SConscript index 3cb4dd0a09..adbeac354f 100644 --- a/scm/SConscript +++ b/scm/SConscript @@ -14,7 +14,3 @@ outdir = os.path.join (env['build'], reldir, env['out']) scmdir = os.path.join (env['sharedir_package_version'], 'scm') env.Install (scmdir, sources) env.Alias ('install', scmdir) - -#testing -all_sources = ['SConscript',] + sources -x = env.Tar (env['tarball'], all_sources)