From: Jan Nieuwenhuizen Date: Thu, 18 Jul 2002 01:33:56 +0000 (+0000) Subject: * scripts/mup2ly.py: Cut-n-paste include missing lilylib. X-Git-Tag: release/1.5.69~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=30c886ed7719a722a55787f955de5b28cc99517c;p=lilypond.git * scripts/mup2ly.py: Cut-n-paste include missing lilylib. misc fixes --- diff --git a/ChangeLog b/ChangeLog index 516d56e8fc..a8528d1452 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2002-07-18 Jan Nieuwenhuizen + * scripts/mup2ly.py: Cut-n-paste include missing lilylib. + * stepmake/stepmake/compile-vars.make: * stepmake/stepmake/executable-rules.make: * stepmake/stepmake/python-module-rules.make: diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 2c5a6df23f..120d24d2a5 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -120,13 +120,13 @@ ifneq ($(CROSS),yes) # however, this triggers compilation during install, which is a bad thing (tm). $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond - cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose ../$(src-depth)/ly/generate-documentation + cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-documentation -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi ## unused $(outdir)/interfaces.itexi: dummy - cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond ../$(src-depth)/ly/generate-interface-doc + cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond $(abs-srcdir)/ly/generate-interface-doc else diff --git a/GNUmakefile.in b/GNUmakefile.in index 8cb953d60e..fd8539abdb 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -121,22 +121,22 @@ $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)-force: @cd $(builddir) && mkdir -p share/lilypond @cd $(builddir)/share/lilypond && mkdir -p $(TOPLEVEL_VERSION) @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \ - ln -s ../../../$(srcdir)/ly ly && \ + ln -s $(abs-srcdir)/ly ly && \ ln -s ../../../mf/$(outconfbase) dvips && \ ln -s ../../../mf/$(outconfbase) afm && \ ln -s ../../../mf/$(outconfbase) tfm && \ - ln -s ../../../$(srcdir)/mf && \ - ln -s ../../../$(srcdir)/ps && \ - ln -s ../../../$(srcdir)/scm + ln -s $(abs-srcdir)/mf && \ + ln -s $(abs-srcdir)/ps && \ + ln -s $(abs-srcdir)/scm @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \ mkdir tex @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/tex && \ - ln -s ../../../../$(srcdir)/tex source && \ + ln -s $(abs-srcdir)/tex source && \ ln -s ../../../../mf/$(outconfbase) generate @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION) && \ mkdir fonts @cd $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)/fonts && \ - ln -s ../../../../$(srcdir)/mf source && \ + ln -s $(abs-srcdir)/mf source && \ ln -s ../../../../mf/$(outconfbase) afm && \ ln -s ../../../../mf/$(outconfbase) tfm && \ ln -s ../../../../mf/$(outconfbase) type1 diff --git a/cygwin/mknetrel b/cygwin/mknetrel index 2f4ba12b66..9c55cdd930 100644 --- a/cygwin/mknetrel +++ b/cygwin/mknetrel @@ -29,6 +29,7 @@ patch=$mknetrel_root/patch iscygwin || (uploads=$here/uploads/$base && mkdir -p $uploads) sub_packages="doc" +old_path=$PATH @@ -256,16 +257,16 @@ exit 0 EOF chmod 755 guile-config - old_path=$PATH PATH=$(pwd):$PATH - LDFLAGS="$PREFIX/bin/libpython2.2.dll" + ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll" } postconfig () { # Configure for build, for generating doc rm -f config.cache (PATH="$old_path" \ + PATH="$HOME/usr/pkg/guile-1.5.6/bin:$PATH" \ CFLAGS="-O2 -g" \ $src/configure --prefix=/usr --enable-config=for-build) } @@ -282,11 +283,13 @@ prebuild () { for i in $(find . -path "out-for-build/*.1"); do cp -pv $i $(dirname $(dirname $i))/$(basename $i) done + + addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" } postinstall () { mkdir -p $inst-doc/$prefix - cd $src || exit 1 + cd $build || exit 1 make conf=for-build prefix=$inst-doc/$prefix install-html-doc diff --git a/make/stepmake.make b/make/stepmake.make index e860f1fb83..5377d10533 100644 --- a/make/stepmake.make +++ b/make/stepmake.make @@ -1,15 +1,7 @@ # make/Stepmake.make - -all: foe - -foe: - @echo one=.$(shell cd $(builddir); pwd). - @echo two=.$(shell cd $(depth); pwd). - include $(depth)/make/toplevel-version.make - # Use alternate configurations alongside eachother: # # ./configure --enable-config=debug diff --git a/scripts/mup2ly.py b/scripts/mup2ly.py index 81279de3f8..e24f38ac18 100644 --- a/scripts/mup2ly.py +++ b/scripts/mup2ly.py @@ -80,8 +80,254 @@ option_definitions = [ ] -from lilylib import * +################################################################ +# lilylib.py -- options and stuff +# +# source file of the GNU LilyPond music typesetter + +# Handle bug in Python 1.6-2.1 +# +# there are recursion limits for some patterns in Python 1.6 til 2.1. +# fix this by importing pre instead. Fix by Mats. + +# todo: should check Python version first. +try: + import pre + re = pre + del pre +except ImportError: + import re + +# Attempt to fix problems with limited stack size set by Python! +# Sets unlimited stack size. Note that the resource module only +# is available on UNIX. +try: + import resource + resource.setrlimit (resource.RLIMIT_STACK, (-1, -1)) +except: + pass + +try: + import gettext + gettext.bindtextdomain ('lilypond', localedir) + gettext.textdomain ('lilypond') + _ = gettext.gettext +except: + def _ (s): + return s + +program_version = '@TOPLEVEL_VERSION@' +if program_version == '@' + 'TOPLEVEL_VERSION' + '@': + program_version = '1.5.54' + +def identify (): + sys.stdout.write ('%s (GNU LilyPond) %s\n' % (program_name, program_version)) + +def warranty (): + identify () + sys.stdout.write ('\n') + sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002')) + sys.stdout.write ('\n') + sys.stdout.write (' Han-Wen Nienhuys') + sys.stdout.write (' Jan Nieuwenhuizen') + sys.stdout.write ('\n') + sys.stdout.write (_ (r''' +Distributed under terms of the GNU General Public License. It comes with +NO WARRANTY.''')) + sys.stdout.write ('\n') + +def progress (s): + errorport.write (s + '\n') + +def warning (s): + progress (_ ("warning: ") + s) + +def user_error (s, e=1): + errorport.write (program_name + ":" + _ ("error: ") + s + '\n') + sys.exit (e) + +def error (s): + '''Report the error S. Exit by raising an exception. Please + do not abuse by trying to catch this error. If you do not want + a stack trace, write to the output directly. + + RETURN VALUE + + None + + ''' + + progress (_ ("error: ") + s) + raise _ ("Exiting ... ") + +def getopt_args (opts): + '''Construct arguments (LONG, SHORT) for getopt from list of options.''' + short = '' + long = [] + for o in opts: + if o[1]: + short = short + o[1] + if o[0]: + short = short + ':' + if o[2]: + l = o[2] + if o[0]: + l = l + '=' + long.append (l) + return (short, long) + +def option_help_str (o): + '''Transform one option description (4-tuple ) into neatly formatted string''' + sh = ' ' + if o[1]: + sh = '-%s' % o[1] + + sep = ' ' + if o[1] and o[2]: + sep = ',' + + long = '' + if o[2]: + long= '--%s' % o[2] + + arg = '' + if o[0]: + if o[2]: + arg = '=' + arg = arg + o[0] + return ' ' + sh + sep + long + arg + + +def options_help_str (opts): + '''Convert a list of options into a neatly formatted string''' + w = 0 + strs =[] + helps = [] + + for o in opts: + s = option_help_str (o) + strs.append ((s, o[3])) + if len (s) > w: + w = len (s) + + str = '' + for s in strs: + str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1]) + return str + +def help (): + ls = [(_ ("Usage: %s [OPTION]... FILE") % program_name), + ('\n\n'), + (help_summary), + ('\n\n'), + (_ ("Options:")), + ('\n'), + (options_help_str (option_definitions)), + ('\n\n'), + (_ ("Report bugs to %s") % 'bug-lilypond@gnu.org'), + ('\n')] + map (sys.stdout.write, ls) + +def setup_temp (): + """ + Create a temporary directory, and return its name. + """ + global temp_dir + if not keep_temp_dir_p: + temp_dir = tempfile.mktemp (program_name) + try: + os.mkdir (temp_dir, 0777) + except OSError: + pass + + return temp_dir + + +def system (cmd, ignore_error = 0, quiet =0): + """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero. + + RETURN VALUE + + Exit status of CMD + """ + + if verbose_p: + progress (_ ("Invoking `%s\'") % cmd) + + st = os.system (cmd) + if st: + name = re.match ('[ \t]*([^ \t]*)', cmd).group (1) + msg = name + ': ' + _ ("command exited with value %d") % st + if ignore_error: + if not quiet: + warning (msg + ' ' + _ ("(ignored)") + ' ') + else: + error (msg) + + return st + + +def cleanup_temp (): + if not keep_temp_dir_p: + if verbose_p: + progress (_ ("Cleaning %s...") % temp_dir) + shutil.rmtree (temp_dir) + + +def strip_extension (f, ext): + (p, e) = os.path.splitext (f) + if e == ext: + e = '' + return p + e + + +def cp_to_dir (pattern, dir): + "Copy files matching re PATTERN from cwd to DIR" + # Duh. Python style portable: cp *.EXT OUTDIR + # system ('cp *.%s %s' % (ext, outdir), 1) + files = filter (lambda x, p=pattern: re.match (p, x), os.listdir ('.')) + map (lambda x, d=dir: shutil.copy2 (x, os.path.join (d, x)), files) + + +# Python < 1.5.2 compatibility +# +# On most platforms, this is equivalent to +#`normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2* +if os.path.__dict__.has_key ('abspath'): + abspath = os.path.abspath +else: + def abspath (path): + return os.path.normpath (os.path.join (os.getcwd (), path)) + +if os.__dict__.has_key ('makedirs'): + makedirs = os.makedirs +else: + def makedirs (dir, mode=0777): + system ('mkdir -p %s' % dir) + + +def mkdir_p (dir, mode=0777): + if not os.path.isdir (dir): + makedirs (dir, mode) + + +# if set, LILYPONDPREFIX must take prevalence +# if datadir is not set, we're doing a build and LILYPONDPREFIX +datadir = '@datadir@' + +if os.environ.has_key ('LILYPONDPREFIX') : + datadir = os.environ['LILYPONDPREFIX'] +else: + datadir = '@datadir@' + + +while datadir[-1] == os.sep: + datadir= datadir[:-1] + +sys.path.insert (0, os.path.join (datadir, 'python')) +################################################################ +# END Library output = 0 diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make index c47a444f33..5a0302d9a0 100644 --- a/stepmake/stepmake/generic-vars.make +++ b/stepmake/stepmake/generic-vars.make @@ -4,11 +4,11 @@ # internal, not normally used DEPTH = $(depth)/$(package-depth) -ifeq ($(topdir),) -abs-srcdir := $(shell cd $(depth); pwd) -#deprecated -topdir := $(abs-srcdir) -endif +#ifeq ($(topdir),) +#abs-srcdir := $(shell cd $(depth); pwd) +##deprecated +#topdir := $(abs-srcdir) +#endif pwd := $(shell pwd) ifeq ($(srcdir),.) @@ -17,6 +17,11 @@ else src-depth = $(srcdir) endif +ifeq ($(topdir),) +abs-srcdir := $(shell cd $(src-depth); pwd) +topdir := $(abs-srcdir) +endif + # derived names ifeq ($(distdir),) distdir = $(topdir)/$(outdir)/$(DIST_NAME)