From d564eb0334ae9cb5017f67491bd1a7319d88e109 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 20:08:31 +0000 Subject: [PATCH] lilypond-0.1.49 --- Documentation/Makefile | 80 --- bin/Makefile | 43 -- bin/add-URLs.sh | 5 - bin/clean-diaper.sh | 18 - bin/clean-embeds.sh | 10 - bin/clean-fonts.sh | 25 - bin/conflily.sh | 36 - bin/convert-mudela.pl | 363 ---------- bin/convert-mudela.py | 318 --------- bin/cvm.py | 318 --------- bin/find-typenames.pl | 20 - bin/foo.sh | 1 - bin/genheader.py | 135 ---- bin/ly2dvi.sh | 594 ---------------- bin/make-docxx.sh | 8 - bin/make-examples.sh | 9 - bin/make-patch.py | 136 ---- bin/make-version.sh | 13 - bin/make-website.py | 312 -------- bin/makepatch.py | 145 ---- bin/mf-deps.py | 88 --- bin/mf-to-table.py | 222 ------ bin/mudela-book.pl | 208 ------ bin/ps-to-gifs.sh | 24 - bin/release.py | 56 -- bin/show-latest.pl | 53 -- debian/Makefile | 19 - flower/Flower-flags.make.in | 3 - flower/Makefile | 81 --- flower/include/Makefile | 19 - flower/test/Makefile | 69 -- init/Makefile | 44 -- input/Makefile | 25 - lib/Makefile | 79 --- lib/include/Makefile | 17 - lily/Makefile | 80 --- lily/include/Makefile | 12 - lily/lexer.l | 430 ----------- lily/parser.y | 1337 ----------------------------------- make/Makefile | 61 -- mf/Makefile | 77 -- mi2mu/Makefile | 86 --- mi2mu/include/Makefile | 17 - mutopia/J.S.Bach/Makefile | 29 - mutopia/Makefile | 25 - tex/Makefile | 23 - 46 files changed, 5773 deletions(-) delete mode 100644 Documentation/Makefile delete mode 100644 bin/Makefile delete mode 100644 bin/add-URLs.sh delete mode 100644 bin/clean-diaper.sh delete mode 100644 bin/clean-embeds.sh delete mode 100644 bin/clean-fonts.sh delete mode 100644 bin/conflily.sh delete mode 100644 bin/convert-mudela.pl delete mode 100644 bin/convert-mudela.py delete mode 100644 bin/cvm.py delete mode 100644 bin/find-typenames.pl delete mode 100755 bin/foo.sh delete mode 100644 bin/genheader.py delete mode 100644 bin/ly2dvi.sh delete mode 100644 bin/make-docxx.sh delete mode 100644 bin/make-examples.sh delete mode 100644 bin/make-patch.py delete mode 100644 bin/make-version.sh delete mode 100644 bin/make-website.py delete mode 100644 bin/makepatch.py delete mode 100644 bin/mf-deps.py delete mode 100644 bin/mf-to-table.py delete mode 100644 bin/mudela-book.pl delete mode 100644 bin/ps-to-gifs.sh delete mode 100644 bin/release.py delete mode 100644 bin/show-latest.pl delete mode 100644 debian/Makefile delete mode 100644 flower/Flower-flags.make.in delete mode 100644 flower/Makefile delete mode 100644 flower/include/Makefile delete mode 100644 flower/test/Makefile delete mode 100644 init/Makefile delete mode 100644 input/Makefile delete mode 100644 lib/Makefile delete mode 100644 lib/include/Makefile delete mode 100644 lily/Makefile delete mode 100644 lily/include/Makefile delete mode 100644 lily/lexer.l delete mode 100644 lily/parser.y delete mode 100644 make/Makefile delete mode 100644 mf/Makefile delete mode 100644 mi2mu/Makefile delete mode 100644 mi2mu/include/Makefile delete mode 100644 mutopia/J.S.Bach/Makefile delete mode 100644 mutopia/Makefile delete mode 100644 tex/Makefile diff --git a/Documentation/Makefile b/Documentation/Makefile deleted file mode 100644 index 412f90fac7..0000000000 --- a/Documentation/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# Documentation/Makefile - -# subdir level: -# -depth = .. -# - -# identify module: -# -NAME = Documentation - -# - -# generic variables: -# -include ./$(depth)/make/Variables.make -include ./$(depth)/make/Version.make -include ./$(depth)/make/Files.make -include ./Rules.make -# - - -# -DOCFILES = $(wildcard *.doc) -OUTPODFILES = $(addprefix $(outdir)/,$(PODFILES)) -TEXTFILES = $(OUTPODFILES:.pod=.txt) -GROFFFILES = $(OUTPODFILES:.pod=.1) -HTMLFILES = $(OUTPODFILES:.pod=.html) -DVIFILES = $(addprefix $(outdir)/, $(DOCFILES:.doc=.dvi)) - - -default: do-doc -# -# list of distribution files: -# -XPMS=$(wildcard *.xpm) -giffiles=$(XPMS:.xpm=.gif) -outgiffiles=$(addprefix $(outdir)/, $(giffiles)) - - -EXTRA_DISTFILES = $(XPMS) $(DOCFILES) vocabulary-data vocabulary-forms.el - - -# don't do DVI files. They can only be made if lily is installed -do-doc: $(TEXTFILES) - -gifs: $(outgiffiles) - - -html: $(HTMLFILES) - -htmldist: html - $(lily_bindir)/make_website - -dvi: $(DVIFILES) - -# generic targets and rules: -# -include $(depth)/make/Targets.make -include $(depth)/make/Rules.make -# - -localclean: - rm -f `find $(outdir) -type f` - - - -MAN1FILES = lilypond convert-mudela mi2mu mudela-book ly2dvi -MAN1GROFF = $(addprefix $(outdir)/, $(addsuffix .1,$(MAN1FILES))) - -localinstall: $(outdir)/lilypond.1 - $(INSTALL) -d $(mandir)/man1 - $(INSTALL) -m 644 $(MAN1GROFF) $(mandir)/man1 - - -localuninstall: - (cd $(mandir)/man1/; rm -f $(MAN1GROFF)) - - - diff --git a/bin/Makefile b/bin/Makefile deleted file mode 100644 index c328fef380..0000000000 --- a/bin/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# bin/Makefile - -depth = .. -include $(depth)/make/Include.make - -# list of distribution files: -PERL_SCRIPTS_IN = $(wildcard *.pl) -PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.pl=)) -SH_SCRIPTS_IN = $(wildcard *.sh) -SH_SCRIPTS = $(addprefix $(outdir)/, $(SH_SCRIPTS_IN:.sh=)) -PYTHON_SCRIPTS_IN = $(wildcard *.py) -PYTHON_SCRIPTS = $(addprefix $(outdir)/, $(PYTHON_SCRIPTS_IN:.py=)) -EXTRA_DISTFILES = $(SH_SCRIPTS_IN) $(PERL_SCRIPTS_IN) $(PYTHON_SCRIPTS_IN) - - -all: $(PERL_SCRIPTS) $(PYTHON_SCRIPTS) $(SH_SCRIPTS) - -$(outdir)/%: %.pl - sed 's!@PERL@!$(PERL)!' < $< > $@ - chmod 755 $@ - -#FIXME. Check for bash? -$(outdir)/%: %.sh - sed 's!@SH@!$(SHELL)!' < $< > $@ - chmod 755 $@ - -$(outdir)/%: %.py - sed 's!@PYTHON@!$(PYTHON)!' < $< > $@ - chmod 755 $@ - -EXECUTABLES=convert-mudela mudela-book ly2dvi - -localinstall: all - $(INSTALL) -d $(bindir) - cd $(outdir); \ - for a in $(EXECUTABLES); \ - do $(INSTALL) -m 755 $$a $(bindir); \ - done - -localuninstall: - for a in $(EXECUTABLES); \ - do rm -f $(bindir)/convert-mudela $(bindir)/mudela-book; \ - done diff --git a/bin/add-URLs.sh b/bin/add-URLs.sh deleted file mode 100644 index a32e6f964b..0000000000 --- a/bin/add-URLs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# add URLs for broken perl 5.004 - -perl -i~ -pe 's! ([a-z]+://[^ \t]+)! $1!g' $* diff --git a/bin/clean-diaper.sh b/bin/clean-diaper.sh deleted file mode 100644 index 06be9040ae..0000000000 --- a/bin/clean-diaper.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# unclobber current dir. -rm -vf *.aux *.log *.orig *~ -rm -vf `grep -li "^% Creator: GNU LilyPond" *.out *.tex` -rm -vf `grep -li "Creator: mi2mu" *.midi.ly` -rm -vf `grep -li "%Creator: dvipsk" *.ps` -rm -vf `grep -li "Creator: GNU LilyPond" *.midi` -rm -vf `grep -li "Creator: ly2dvi" *.tex` -rm -vf `find -name 'core'` -rm -vf `find -name '*.orig'` -rm -vf `find -name '*.rej'` - - -# docxx mess -rm -vf *dvi -rm -vf *.class HIER*.html dxxgifs.tex gifs.db icon?.gif logo.gif down.gif \ - aindex.html index.html diff --git a/bin/clean-embeds.sh b/bin/clean-embeds.sh deleted file mode 100644 index 1b53f85ecb..0000000000 --- a/bin/clean-embeds.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -rm -f feta-sleur-[0-9x\-]*.mf -rm -f feta-sleur-[0-9x\-]*.log -rm -f feta-beum-[0-9x\-]*.mf -rm -f feta-beum-[0-9x\-]*.log -rm -f feta-embed.aux -rm -f missfont.log -clean-fonts sleur -clean-fonts beum diff --git a/bin/clean-fonts.sh b/bin/clean-fonts.sh deleted file mode 100644 index 202a873584..0000000000 --- a/bin/clean-fonts.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -case $# in -0) - WHAT="" ;; -1) - WHAT=$1;; -esac - -# should use kpsepath - -if [ -d /var/lib/texmf ]; then - TEXDIR=/var/lib/texmf -elif [ -d /var/texfonts ]; then - TEXDIR=/var/texfonts -else - TEXDIR=/var/ -fi - -# remove possibly stale .pk/.tfm files -echo> /tmp/cleaning-font-dummy -FILES=`find $TEXDIR -name "feta*$WHAT*tfm" -or -name "feta*$WHAT*pk"` - -echo removing $FILES -rm $FILES /tmp/cleaning-font-dummy diff --git a/bin/conflily.sh b/bin/conflily.sh deleted file mode 100644 index a89f9e7711..0000000000 --- a/bin/conflily.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# conflily -# ugh: must be executed from lilypond-x.x.x (bin/conflily) - -# the lilypond root dir looks like this: -# current -> ./lilypond-x.x.x symlink to current source -# lilypond-x.x.x the lilypond source -# patches gzipped patches -# releases gzipped releases - -# the lily root dir -# -lelie=$HOME/music/lily -# - -if [ ! -e $HOME/lelie ]; then - ln -s $lelie $HOME/lelie -fi - -rm $lelie/current 2>&1 > /dev/null -current=`basename \`pwd\`` -echo ln -s $lelie/$current $lelie/current -ln -s $lelie/$current $lelie/current - -ln -sf $lelie/current/lily/out/lilypond bin/out/lilypond -ln -sf $lelie/current/mi2mu/out/mi2mu bin/out/mi2mu - -if [ "x$LILYINCLUDE" = "x" ]; then - echo you should make add the following to your login script - echo "export LILYINCLUDE=$lelie/current/init:$lelie/current/input:$lelie/current/mutopia:$lelie/current/mutopia/out:$lelie/current/input:$lelie/current/mutopia/J.S.Bach:$lelie/current/mutopia/J.S.Bach/out" - echo "export PATH=$PATH:$lelie/current/bin/out/" - echo "export MFINPUTS=$MFINPUTS:$lelie/current/mf" -fi - -configure --prefix=/usr --enable-debugging --enable-printing --enable-checking - diff --git a/bin/convert-mudela.pl b/bin/convert-mudela.pl deleted file mode 100644 index 3be80d97da..0000000000 --- a/bin/convert-mudela.pl +++ /dev/null @@ -1,363 +0,0 @@ -#!@PERL@ -w -# -*-perl-*- - -=head1 TODO - - detect \lyrics and \melodic, and do substitution accordingly. - count <> and {} ? - -Ugh . Perl sux. Anybody for Python? - -=cut - - - -# -# version of "supporting" engine, not mudela conversions. -# - - - - -$convert_mudela_version = "0.1.2"; - -use Getopt::Long; - - -sub version_compare -{ - local ($a,$b)=@_; - return &cmpver; -} - - -sub cmpver -{ - my(@a)= split /\./,$a; - my(@b)= split /\./,$b; - - for $i (0,1,2) { - return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]); - } - return $a cmp $b; -} - -sub version_string_conv -{ - my ($from_version, $to_version) = @_; - s/\version \"$from_version\"/\version \"$to_version\"/g; -} - -################################################################ - -sub no_conv -{ -} - -sub convert_0_0_52_to_0_0_53 -{ - - s/include \"/$1\\include \"/g; -} - - -sub convert_0_0_54_to_0_0_55 -{ - s/%{/% {/g; -} - - -sub convert_0_0_53_to_0_0_54 -{ - print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ; -} - -# we-re not at 58 yet, but this is at least one of the rules -sub convert_0_0_55_to_0_0_56 -{ - s/\"\|\|\"/\"|.\"/g; -} - -sub convert_0_0_56_to_0_0_57 -{ - s/\(([ \]\[|\t-\.>]|\\[a-z]+)*\)/\~ $1/g; -} - -sub convert_0_0_57_to_0_0_58 -{ - s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g; -} - -sub convert_0_0_58_to_0_0_59 -{ - die "Not smart enough to convert 0.0.58 to 0.0.59\n"; -} - -sub convert_0_0_59_to_0_0_60 -{ - s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g; - s/(\\output \"[^\"]+\")/$1;/; - s/(\\tempo [0-9: ]+)/$1;/; -} - -sub convert_0_0_60_to_0_0_61 -{ - s/(\\unitspace|\\geometric|\\width)/$1=/g; - -} - -sub convert_0_1_0_to_0_1_1 -{ - s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g -} - -sub convert_0_1_2_to_0_1_3 -{ - s/\\stem *(\\up|1) *;/\\stemup/g; - s/\\stem *(\\down|-1) *;/\\stemdown/g; - s/\\stem *0 *;/\\stemboth/g; - s/\\hshift ([^;]+) *;/\\property Voice.hshift = $1/g; -} - -my $header_b = 0; - -sub generic_conversion_scan -{ - if (/\\header *\{/) - { - $header_b = 1; - } - if ($header_b && /^ *\}/) - { - $header_b = 0; - } -} -sub convert_0_1_4_to_0_1_5 -{ - s/([<{]) *\\id "Piano" (.+);/\\type Grandstaff = $3 $1/; - s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/; -} - - -sub convert_0_1_5_to_0_1_6 -{ - s/< *\\multi (.*);/\\multi $1 \&no_conv, - "0.0.52" => \&convert_0_0_50_to_0_0_52, - "0.0.53" => \&convert_0_0_52_to_0_0_53, - "0.0.54" => \&convert_0_0_53_to_0_0_54, - "0.0.55" => \&convert_0_0_54_to_0_0_55, - "0.0.56" => \&convert_0_0_55_to_0_0_56, - "0.0.57" => \&convert_0_0_56_to_0_0_57, - "0.0.58" => \&convert_0_0_57_to_0_0_58, - "0.0.59" => \&convert_0_0_58_to_0_0_59, - "0.0.60" => \&convert_0_0_59_to_0_0_60, - "0.0.61" => \&convert_0_0_60_to_0_0_61, - "0.1.1" => \&convert_0_1_0_to_0_1_1, - "0.1.2" => \&no_conv, - "0.1.3" => \&convert_0_1_2_to_0_1_3, - "0.1.4" => \&no_conv, - "0.1.5" => \&convert_0_1_4_to_0_1_5, - "0.1.6" => \&convert_0_1_5_to_0_1_6 - ,"0.1.7" => \&convert_0_1_6_to_0_1_7 - ,"0.1.8" => \&convert_0_1_7_to_0_1_8 - ,"0.1.9" => \&convert_0_1_8_to_0_1_9 - ); - - - -sub versions -{ - return (sort { cmpver; } (keys %minor_conversions)); -} - - -sub show_rules -{ - my (@v) = versions; - - print "Rules: ", join(", ", @v), "\n"; - -} - -sub do_conversion -{ - my ($from,$to) = @_; - - my @applicable_conversion; - my @mudela_levels; - - my @v = versions; - foreach $ver (@v) { - if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ - push @applicable_conversion, $minor_conversions{$ver}; - push @mudela_levels, $ver; - } - } - - print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n"; - - while () { - generic_conversion_scan; - foreach $subroutine (@applicable_conversion) { - - &$subroutine; - - } - version_string_conv $from, $to; - print OUTLY; - } -} - -sub get_auto_from -{ - my ($fn)=@_; - my ($ver); - open INLY, $fn || die "Can't open"; - - while () { - s/^.*\\version \"([^\"]*)\".*$//; - if (defined ($1)) { - print STDERR "Guessing version: ", $1, ".. "; - $ver = $1; - last; - } - } - if (!defined($ver)){ - print STDERR "can't determine mudela version in $fn.\n"; - my $u; - return $u; - } - close INLY; - return $ver; -} - -sub set_files -{ - $infile = "-"; - $outfile = "-"; - $outfile = $opt_output if (defined($opt_output)); - - if ($ARGV [0]) { - $infile = $ARGV[0]; - } - if (!(-f $infile) && !($infile =~ /\.ly$/s)) { - $infile .= ".ly"; - } - if ($opt_edit && $infile ne "-") { - $opt_edit = 1; - $outfile = "$infile.NEW"; - $infile = "$infile"; - } - print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. "; - -} - -sub do_one_arg -{ - set_files; - - local ($from_version, $to_version); - $from_version = $opt_from; - $to_version = $opt_to; - - ($from_version = get_auto_from $infile) unless defined($opt_from); - return if (!defined($from_version)); - - ($to_version = last_conversion) unless (defined($opt_to)); - - die "can't open \`$infile\'" unless open INLY,$infile ; - die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; - - do_conversion $from_version, $to_version; - close INLY; - close OUTLY; - - if ($opt_edit) { - rename $infile, "$infile~"; - rename $outfile, "$infile"; - } -} - -## "main" - -identify; - - -GetOptions ("help", "output=s", "from=s", "to=s", "minor=i", "edit", "show-rules"); - -if ($opt_help) { - usage(); - $opt_help = 0; # to extinguish typo check. - exit 0; -} - -if ($opt_show_rules) { - show_rules ; - $opt_show_rules = 0; # to extinguish typo check. - exit 0; -} - -local ( $infile,$outfile); -my $processed_one=0; - -while (defined($ARGV[0])) { - do_one_arg; - shift @ARGV; - $processed_one = 1; -} -do_one_arg unless ($processed_one); - - diff --git a/bin/convert-mudela.py b/bin/convert-mudela.py deleted file mode 100644 index 9654db9377..0000000000 --- a/bin/convert-mudela.py +++ /dev/null @@ -1,318 +0,0 @@ -#!@PYTHON@ -w -# -*-perl-*- - -version = "0.2"; - -################################################################ - -sub no_conv -{ -} - -sub convert_0_0_52_to_0_0_53 -{ - - s/include \"/$1\\include \"/g; -} - - -sub convert_0_0_54_to_0_0_55 -{ - s/%{/% {/g; -} - - -sub convert_0_0_53_to_0_0_54 -{ - print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ; -} - -# we-re not at 58 yet, but this is at least one of the rules -sub convert_0_0_55_to_0_0_56 -{ - s/\"\|\|\"/\"|.\"/g; -} - -sub convert_0_0_56_to_0_0_57 -{ - s/\(([ \]\[|\t-\.>]|\\[a-z]+)*\)/\~ $1/g; -} - -sub convert_0_0_57_to_0_0_58 -{ - s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g; -} - -sub convert_0_0_58_to_0_0_59 -{ - die "Not smart enough to convert 0.0.58 to 0.0.59\n"; -} - -sub convert_0_0_59_to_0_0_60 -{ - s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g; - s/(\\output \"[^\"]+\")/$1;/; - s/(\\tempo [0-9: ]+)/$1;/; -} - -sub convert_0_0_60_to_0_0_61 -{ - s/(\\unitspace|\\geometric|\\width)/$1=/g; - -} - -sub convert_0_1_0_to_0_1_1 -{ - s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g -} - -sub convert_0_1_2_to_0_1_3 -{ - s/\\stem *(\\up|1) *;/\\stemup/g; - s/\\stem *(\\down|-1) *;/\\stemdown/g; - s/\\stem *0 *;/\\stemboth/g; - s/\\hshift ([^;]+) *;/\\property Voice.hshift = $1/g; -} - -my $header_b = 0; - -sub generic_conversion_scan -{ - if (/\\header *\{/) - { - $header_b = 1; - } - if ($header_b && /^ *\}/) - { - $header_b = 0; - } -} -sub convert_0_1_4_to_0_1_5 -{ - s/([<{]) *\\id "Piano" (.+);/\\type Grandstaff = $3 $1/; - s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/; -} - - -sub convert_0_1_5_to_0_1_6 -{ - s/< *\\multi (.*);/\\multi $1 \&no_conv, - "0.0.52" => \&convert_0_0_50_to_0_0_52, - "0.0.53" => \&convert_0_0_52_to_0_0_53, - "0.0.54" => \&convert_0_0_53_to_0_0_54, - "0.0.55" => \&convert_0_0_54_to_0_0_55, - "0.0.56" => \&convert_0_0_55_to_0_0_56, - "0.0.57" => \&convert_0_0_56_to_0_0_57, - "0.0.58" => \&convert_0_0_57_to_0_0_58, - "0.0.59" => \&convert_0_0_58_to_0_0_59, - "0.0.60" => \&convert_0_0_59_to_0_0_60, - "0.0.61" => \&convert_0_0_60_to_0_0_61, - "0.1.1" => \&convert_0_1_0_to_0_1_1, - "0.1.2" => \&no_conv, - "0.1.3" => \&convert_0_1_2_to_0_1_3, - "0.1.4" => \&no_conv, - "0.1.5" => \&convert_0_1_4_to_0_1_5, - "0.1.6" => \&convert_0_1_5_to_0_1_6 - ,"0.1.7" => \&convert_0_1_6_to_0_1_7 - ,"0.1.8" => \&convert_0_1_7_to_0_1_8 - ,"0.1.9" => \&convert_0_1_8_to_0_1_9 - ); - - - -sub versions -{ - return (sort { cmpver; } (keys %minor_conversions)); -} - - -sub show_rules -{ - my (@v) = versions; - - print "Rules: ", join(", ", @v), "\n"; - -} - -sub do_conversion -{ - my ($from,$to) = @_; - - my @applicable_conversion; - my @mudela_levels; - - my @v = versions; - foreach $ver (@v) { - if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ - push @applicable_conversion, $minor_conversions{$ver}; - push @mudela_levels, $ver; - } - } - - print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n"; - - while () { - generic_conversion_scan; - foreach $subroutine (@applicable_conversion) { - - &$subroutine; - - } - version_string_conv $from, $to; - print OUTLY; - } -} - -sub get_auto_from -{ - my ($fn)=@_; - my ($ver); - open INLY, $fn || die "Can't open"; - - while () { - s/^.*\\version \"([^\"]*)\".*$//; - if (defined ($1)) { - print STDERR "Guessing version: ", $1, ".. "; - $ver = $1; - last; - } - } - if (!defined($ver)){ - print STDERR "can't determine mudela version in $fn.\n"; - my $u; - return $u; - } - close INLY; - return $ver; -} - -sub set_files -{ - $infile = "-"; - $outfile = "-"; - $outfile = $opt_output if (defined($opt_output)); - - if ($ARGV [0]) { - $infile = $ARGV[0]; - } - if (!(-f $infile) && !($infile =~ /\.ly$/s)) { - $infile .= ".ly"; - } - if ($opt_edit && $infile ne "-") { - $opt_edit = 1; - $outfile = "$infile.NEW"; - $infile = "$infile"; - } - print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. "; - -} - -sub do_one_arg -{ - set_files; - - local ($from_version, $to_version); - $from_version = $opt_from; - $to_version = $opt_to; - - ($from_version = get_auto_from $infile) unless defined($opt_from); - return if (!defined($from_version)); - - ($to_version = last_conversion) unless (defined($opt_to)); - - die "can't open \`$infile\'" unless open INLY,$infile ; - die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; - - do_conversion $from_version, $to_version; - close INLY; - close OUTLY; - - if ($opt_edit) { - rename $infile, "$infile~"; - rename $outfile, "$infile"; - } -} - -## "main" - -identify; - - -GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules"); - -if ($opt_help) { - usage(); - $opt_help = 0; # to extinguish typo check. - exit 0; -} - -if ($opt_show_rules) { - show_rules ; - $opt_show_rules = 0; # to extinguish typo check. - exit 0; -} - -local ( $infile,$outfile); -my $processed_one=0; - -while (defined($ARGV[0])) { - do_one_arg; - shift @ARGV; - $processed_one = 1; -} -do_one_arg unless ($processed_one); - - diff --git a/bin/cvm.py b/bin/cvm.py deleted file mode 100644 index 9654db9377..0000000000 --- a/bin/cvm.py +++ /dev/null @@ -1,318 +0,0 @@ -#!@PYTHON@ -w -# -*-perl-*- - -version = "0.2"; - -################################################################ - -sub no_conv -{ -} - -sub convert_0_0_52_to_0_0_53 -{ - - s/include \"/$1\\include \"/g; -} - - -sub convert_0_0_54_to_0_0_55 -{ - s/%{/% {/g; -} - - -sub convert_0_0_53_to_0_0_54 -{ - print STDERR "Not smart enough to convert \\transpose\n" if (/\\transpose/) ; -} - -# we-re not at 58 yet, but this is at least one of the rules -sub convert_0_0_55_to_0_0_56 -{ - s/\"\|\|\"/\"|.\"/g; -} - -sub convert_0_0_56_to_0_0_57 -{ - s/\(([ \]\[|\t-\.>]|\\[a-z]+)*\)/\~ $1/g; -} - -sub convert_0_0_57_to_0_0_58 -{ - s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g; -} - -sub convert_0_0_58_to_0_0_59 -{ - die "Not smart enough to convert 0.0.58 to 0.0.59\n"; -} - -sub convert_0_0_59_to_0_0_60 -{ - s/(\\unitspace [0-9.mcptin\\ ]+|\\geometric [0-9.]+|\\width [0-9.mcp\\tin]+)/$1;/g; - s/(\\output \"[^\"]+\")/$1;/; - s/(\\tempo [0-9: ]+)/$1;/; -} - -sub convert_0_0_60_to_0_0_61 -{ - s/(\\unitspace|\\geometric|\\width)/$1=/g; - -} - -sub convert_0_1_0_to_0_1_1 -{ - s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g -} - -sub convert_0_1_2_to_0_1_3 -{ - s/\\stem *(\\up|1) *;/\\stemup/g; - s/\\stem *(\\down|-1) *;/\\stemdown/g; - s/\\stem *0 *;/\\stemboth/g; - s/\\hshift ([^;]+) *;/\\property Voice.hshift = $1/g; -} - -my $header_b = 0; - -sub generic_conversion_scan -{ - if (/\\header *\{/) - { - $header_b = 1; - } - if ($header_b && /^ *\}/) - { - $header_b = 0; - } -} -sub convert_0_1_4_to_0_1_5 -{ - s/([<{]) *\\id "Piano" (.+);/\\type Grandstaff = $3 $1/; - s/([<{]) *\\id (.+) (.+);/\\type $2 = $3 $1/; -} - - -sub convert_0_1_5_to_0_1_6 -{ - s/< *\\multi (.*);/\\multi $1 \&no_conv, - "0.0.52" => \&convert_0_0_50_to_0_0_52, - "0.0.53" => \&convert_0_0_52_to_0_0_53, - "0.0.54" => \&convert_0_0_53_to_0_0_54, - "0.0.55" => \&convert_0_0_54_to_0_0_55, - "0.0.56" => \&convert_0_0_55_to_0_0_56, - "0.0.57" => \&convert_0_0_56_to_0_0_57, - "0.0.58" => \&convert_0_0_57_to_0_0_58, - "0.0.59" => \&convert_0_0_58_to_0_0_59, - "0.0.60" => \&convert_0_0_59_to_0_0_60, - "0.0.61" => \&convert_0_0_60_to_0_0_61, - "0.1.1" => \&convert_0_1_0_to_0_1_1, - "0.1.2" => \&no_conv, - "0.1.3" => \&convert_0_1_2_to_0_1_3, - "0.1.4" => \&no_conv, - "0.1.5" => \&convert_0_1_4_to_0_1_5, - "0.1.6" => \&convert_0_1_5_to_0_1_6 - ,"0.1.7" => \&convert_0_1_6_to_0_1_7 - ,"0.1.8" => \&convert_0_1_7_to_0_1_8 - ,"0.1.9" => \&convert_0_1_8_to_0_1_9 - ); - - - -sub versions -{ - return (sort { cmpver; } (keys %minor_conversions)); -} - - -sub show_rules -{ - my (@v) = versions; - - print "Rules: ", join(", ", @v), "\n"; - -} - -sub do_conversion -{ - my ($from,$to) = @_; - - my @applicable_conversion; - my @mudela_levels; - - my @v = versions; - foreach $ver (@v) { - if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ - push @applicable_conversion, $minor_conversions{$ver}; - push @mudela_levels, $ver; - } - } - - print STDERR "Applying following rules: ", join(", ", @mudela_levels) , "\n"; - - while () { - generic_conversion_scan; - foreach $subroutine (@applicable_conversion) { - - &$subroutine; - - } - version_string_conv $from, $to; - print OUTLY; - } -} - -sub get_auto_from -{ - my ($fn)=@_; - my ($ver); - open INLY, $fn || die "Can't open"; - - while () { - s/^.*\\version \"([^\"]*)\".*$//; - if (defined ($1)) { - print STDERR "Guessing version: ", $1, ".. "; - $ver = $1; - last; - } - } - if (!defined($ver)){ - print STDERR "can't determine mudela version in $fn.\n"; - my $u; - return $u; - } - close INLY; - return $ver; -} - -sub set_files -{ - $infile = "-"; - $outfile = "-"; - $outfile = $opt_output if (defined($opt_output)); - - if ($ARGV [0]) { - $infile = $ARGV[0]; - } - if (!(-f $infile) && !($infile =~ /\.ly$/s)) { - $infile .= ".ly"; - } - if ($opt_edit && $infile ne "-") { - $opt_edit = 1; - $outfile = "$infile.NEW"; - $infile = "$infile"; - } - print STDERR "Input ", (($infile eq "-") ?"STDIN" : $infile), " .. "; - -} - -sub do_one_arg -{ - set_files; - - local ($from_version, $to_version); - $from_version = $opt_from; - $to_version = $opt_to; - - ($from_version = get_auto_from $infile) unless defined($opt_from); - return if (!defined($from_version)); - - ($to_version = last_conversion) unless (defined($opt_to)); - - die "can't open \`$infile\'" unless open INLY,$infile ; - die "can't open \`$outfile\'" unless open OUTLY, ">$outfile"; - - do_conversion $from_version, $to_version; - close INLY; - close OUTLY; - - if ($opt_edit) { - rename $infile, "$infile~"; - rename $outfile, "$infile"; - } -} - -## "main" - -identify; - - -GetOptions ("help", "output=s", "from=i", "to=i", "minor=i", "edit", "show-rules"); - -if ($opt_help) { - usage(); - $opt_help = 0; # to extinguish typo check. - exit 0; -} - -if ($opt_show_rules) { - show_rules ; - $opt_show_rules = 0; # to extinguish typo check. - exit 0; -} - -local ( $infile,$outfile); -my $processed_one=0; - -while (defined($ARGV[0])) { - do_one_arg; - shift @ARGV; - $processed_one = 1; -} -do_one_arg unless ($processed_one); - - diff --git a/bin/find-typenames.pl b/bin/find-typenames.pl deleted file mode 100644 index 890f9cabd0..0000000000 --- a/bin/find-typenames.pl +++ /dev/null @@ -1,20 +0,0 @@ -#!@PERL@ - -open GREP, "egrep -h '^struct|^class' *.hh *.cc|"; -open OUT, "|sort | uniq"; -while () { - - s/^struct/class/; - if (! /; *$/) { - s/:[^{]+{.*$//; - s/ *{.*$/;/; - } - if (! /; *$/) { - chop; - $_ .= ";\n"; - - } - print OUT; -} -close OUT; -close GREP; diff --git a/bin/foo.sh b/bin/foo.sh deleted file mode 100755 index 36ac3689b1..0000000000 --- a/bin/foo.sh +++ /dev/null @@ -1 +0,0 @@ -#! /bin/bash diff --git a/bin/genheader.py b/bin/genheader.py deleted file mode 100644 index 57f0e9fb8f..0000000000 --- a/bin/genheader.py +++ /dev/null @@ -1,135 +0,0 @@ -#!@PYTHON@ - -# -# genheader.py -- do headers (like these) -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997 Han-Wen Nienhuys -# - - - -import posix -import pwd -import regex -import regsub -import string -import sys -import os -import getopt - -class My_options: - def __init__(self): - self.commentify = None - self.add_hdr_def = 0 - self.classname = '' - -my_options = My_options() - -def mail(): - return os.environ['MAILADDRESS'] - -def name(): - return pwd.getpwuid(posix.getuid())[4] - -def c_commentify(str): - return '/* ' + regsub.gsub('^',' ', str) + '\n */'; - -def sh_commentify(str): - return regsub.gsub('^', '# ', str) - -def tex_commentify(str): - return regsub.gsub('^', '% ', str) - -def project_str(): - cwd = posix.getcwd() - if regex.search('flower', cwd) <> -1: - PROJECT = "the Flower Library" - elif regex.search('mf$', cwd) <> -1: - PROJECT = "the Feta (defintively not an abbreviation for Font-En-Tja) music font" - else: - PROJECT = "the GNU LilyPond music typesetter" - return PROJECT - -def head_str(filename): - if my_options.add_hdr_def: - what = "declare " - else: - what=" implement " - - - headstr = '\n%s -- %s\n\nsource file of %s\n\n(c) 1997 %s <%s>\n' \ - %(filename, what, project_str(), name(), mail()) - return headstr - - -def c_include(filename): - startdef= filename; - trans = string.maketrans( string.lowercase + '-.', string.uppercase + '__') - startdef = string.translate(filename, trans) - - - headstr = "\n\n#ifndef %s\n#define %s\n" % (startdef, startdef) - terminatestr = "#endif /* %s */\n" % (startdef); - - return headstr+ '\n\n'+ terminatestr; - - - - - -(options, files) = getopt.getopt(sys.argv[1:], 'tcsh', ['class']) - -for opt in options: - o = opt[0] - a = opt[1] - if o == '-c': - my_options.commentify = c_commentify - elif o == '-t': - my_options.commentify = tex_commentify - elif o == '-s': - my_options.commentify = sh_commentify - elif o == '-h': - my_options.add_hdr_def = 1 - elif o == '--class': - my_options.classname = a - - - -# -# FIXME: should create xxx.cc and include/xxx.hh, with implement/declare Xxx -# in one run -if my_options.classname: - pass - -def do_file(nm): - s = my_options.commentify(head_str(nm)) - if my_options.add_hdr_def: - s = s + c_include(nm) - return s - - -def extension(ext,nm): - ext = '\\.' + ext - return regex.search(ext, nm) <> -1 - -def c_extension(nm): - return extension('hh',nm) or extension('cc',nm) \ - or extension('icc', nm) or extension('tcc',nm) -def select_commentification(nm): - if c_extension (nm): - return c_commentify - elif extension('py',nm) or extension('pl',nm) or extension('sh',nm): - return sh_commentify - elif extension('mf',nm) or extension('tex',nm) or extension('ly',nm): - return tex_commentify - else: - raise 'help' - -for nm in files: - if extension('hh', nm) or extension('icc', nm) or extension('tcc', nm): - my_options.add_hdr_def = 1 - if my_options.commentify == None: - my_options.commentify = select_commentification(nm) - print do_file(nm) diff --git a/bin/ly2dvi.sh b/bin/ly2dvi.sh deleted file mode 100644 index e20f85aa11..0000000000 --- a/bin/ly2dvi.sh +++ /dev/null @@ -1,594 +0,0 @@ -#!/bin/sh -# -# Script to make a LaTeX file for Lilypond -# -# Written by Jan Arne Fagertun -# Sat Nov 22 22:26:43 CET 1997 -# -# Original LaTeX file made by Mats Bengtsson, 17/8 1997 -# - -VERSION="0.7" -NAME=ly2dvi.sh -IDENTIFICATION="$NAME $VERSION" -NOW=`date` -echo "$IDENTIFICATION" 1>&2 - -# TODO - -# 0.7 -# - Improved Lilypond error checking -# - Output orientation (landscape...). Overrides mudela file -# variable orientation="landscape"; -# - Paper width and heigth put into variables (only A4!) -# - Adjusted top margin to default..... -# -#TODO -# - Include more papersizes. -# - Manual page....... -# - should detect crashing lilypond - - -# NEWS - -# 0.6.hwn1.jaf -# - LILYINCLUDE update -# -# 0.6.hwn1 -# - handle LILYINCLUDE -# - --output -# -# 0.6 -# - Source rc-files, if present. Files are: -# /usr/local/share/lilyrc /etc/lilyrc $HOME/.lilyrc ./.lilyrc -# - tee output from Lilypond -# - Handles margins for A4 paper (equal on both sides) -# - new option -s (--separate) for one LaTeX run per file, -# else all files are run together - -# 0.5 -# - More useful ("two-level") debug. -# - The Q&D hack to find file names and not handling \include -# is replaced by grabbing output file names from Lilypond. -# = Detects multiple output files - adds them when running -# LaTeX. -# - Works with multiple input files - no matter if they are -# (a mix of) input to or output from Lilypond. -# -#TODO -# - Still no margins handling. -# - We have to discuss how to handle multiple output files -# from Lilypond - 'ly2dvi standchen' gives a rather odd -# result.... - -# 0.4.1 -# - Always exit after printing help info -# 0.4 -# - Changes to ensure for more strict grep'ing of parameters -# Thanks to from G.B.Stott@bolton.ac.uk -# - More efficient use of sed -e 's///' -e 's///' -# Thanks to Johan Vromans and GBS -# - Ask tex for location of titledefs.tex (Thanks to JV) -# - Accept only exact match of "\def\mudelacomposer{" -# (or whatever mudela* defined in titledefs.tex) -# - Even more efficient use of sed (Thanks to JV) -# - Default file name for single output file implemented. -# - Moved help into function - finally included from 0.1.jcn1 -# -#TODO -# - Still doesn't handle \include -# - The Q&D for finding output file name from the sequence of -# \paper \output \midi \output really needs to be looked at. -# I have improved it a lot, but it's only capable of finding -# one (the last) file name. -# Well, I have to rewrite this entirely to handle \include, -# then I can fix it. -# - Still no margins handling. -# -#WARNING -# - Some lines of output from lilypond do NOT start -# at first character position, therefore I have removed "^" -# in sed'ing and grep'ing. - -# 0.3.hwn1 -# - add "Creator: " line to output -# -# 0.3 -# - multiple input files to make score from several files -# (extra files assumed to be Lilypond output) -# - cp dvi-file instead of mv, to allow for xdvi reload -# - check for illegal long options -# - put in pt in text width, if not given -# - put in \nonstopmode in LaTeX file -# - restored LaTeX exit value check - -# 0.2.1 -# - temporarily omit LaTeX exit value check -# - remove ALL temporary files - -# 0.2 -# - fix for solaris - included from 0.1.jcn1 -# - long option hack - included from 0.1.jcn1 - modified -# - moved help into function - NOT included from 0.1.jcn1 yet -# - various improvements - included from 0.1.jcn1 -# - find mudela definitions from titledefs.tex -# - find papersize from lilypond output file (mudelapapersize), -# overridden by option '-p size' or '--papersize=size' -# - option -l lang or --language=lang overrides -# lilypond output file definition (mudelalanguage) -# - textwidth from lilypond output file (mudelapaperlinewidth) - -# 0.1.jcn1 -# - fix for solaris -# - long option hack -# - moved help into function - -# -# print usage -# -help() { - cat << EOF -Generate dvi file from mudela or lilypond output -Usage: $0 [options] file[s] - -Options: - -D, --debug set debug mode - -O, --orientation= set orientation (landscape or portrait (default)) - -o, --output= set output directory - -h, --help this help text - -k, --keep keep LaTeX file - -l, --language= give LaTeX language (babel) - -p, --papersize= give LaTeX papersize (eg. a4paper) - -s, --separate run all files separately through LaTeX - - files may be (a mix of) input to or output from lilypond(1) -EOF -} - -PWIDTH=600; # Width of A4 paper! -PHEIGTH=830; # Heigth of A4 paper! -# -# RC-files ? -# -for D in /usr/local/share/ /etc/ $HOME/. ./. -do - RCfile=$D"lilyrc" - [ -f $RCfile ] && . $RCfile -done - -# -# Keywords defined in titledefs.tex -# -TF=`kpsewhich -n tex tex titledefs.tex` -if [ -n $TF ] -then - TF=/usr/lib/texmf/tex/lilypond/titledefs.tex -fi -MU_DEF="" -if [ -f $TF ] -then - MU_DEF=`egrep "^.newcommand...mudela" $TF | \\ - sed -e 's/^.newcommand...//' -e 's/\\}.*$//'` -fi - -if [ -z "$MU_DEF" ] -then - MU_DEF="mudelatitle mudelasubtitle mudelacomposer \ - mudelaarranger mudelainstrument" -fi - -# -# debugging -# -debug_echo=true -# -# All files in one LaTeX run -# -SEPFILE=N -# -# Find command line options and switches -# -# "x:" x takes argument -# -switches="DO:hkl:o:p:s\?" -options="" -# -# ugh, "\-" is a hack to support long options -# while getopts \-:$options$switches O -# must be in double quotes for bash-2.0 -while getopts "\-:$options$switches" O -do - $debug_echo "O: \`$O'" - $debug_echo "arg: \`$OPTARG'" - case $O in - D ) - if [ $debug_echo = echo ] - then - set -x - fi - debug_echo=echo - ;; - O ) - ORI=$OPTARG - ;; - h ) - help; - exit 0 - ;; - k ) - KEEP=Y - ;; - l ) - LNG=$OPTARG - ;; - o ) - OUTPUTDIR=$OPTARG - ;; - p ) - PSZ=$OPTARG - ;; - s ) - SEPFILE=Y - ;; - \? ) - help; - exit -1 - ;; - # a long option! - -) - $debug_echo "long option: \`$OPTARG'" - case "$OPTARG" in - D*|-D*) - if [ $debug_echo = echo ] - then - set -x - fi - debug_echo=echo - ;; - h*|-h*) - help; - exit 0 - ;; - k*|-k*) - KEEP=Y - ;; - l*|-l*) - LNG=`echo $OPTARG | sed -e s/"^.*="//` - ;; - p*|-p*) - PSZ=`echo $OPTARG | sed -e s/"^.*="//` - ;; - or*|-or*) - ORI=`echo $OPTARG | sed -e s/"^.*="//` - ;; - ou*|-ou*) - OUTPUTDIR=`echo $OPTARG | sed -e s/"^.*="//` - ;; - s*|-s*) - SEPFILE=Y - ;; - *|-*) - echo $0": illegal option -- "$OPTARG; - help; - exit -1 - ;; - esac - esac -done -shift `expr $OPTIND - 1` -# -# Input file name -# -if [ "$1" = "" ] -then - help - $debug_echo $IDENTIFICATION": No input file name given" - exit 1 -fi -# -startFile(){ -# -# LaTeX file name -# -if [ "$KEEP" != "Y" ] -then - if [ "$TMP" = "" ] - then - TMP=/tmp - fi - if [ ! -d $TMP ] - then - $debug_echo $IDENTIFICATION": temporary directory "$TMP" not found, set to /tmp" - TMP=/tmp - fi -# - BN=`basename $File .tex` - FN=$BN.$$ - LF=$TMP/$FN.tex -else - BN=`basename $File .tex` - FN=$BN.$$ - LF=$FN.tex -fi -# -# Find: -# paper size (PSZ, overridden by command line option -p) -# paper orientation (ORI, overridden by command line option -o) -# language (LNG, overridden by command line option -l) -# textwidth -# -eval `sed -n \\ - -e 's/\\\\def\\\\mudelapapersize{\([^}]*\).*$/fPSZ=\1;/p' \\ - -e 's/\\\\def\\\\mudelaorientation{\([^}]*\).*$/fORI=\1;/p' \\ - -e 's/\\\\def\\\\mudelalanguage{\([^}]*\).*$/fLNG=\1;/p' \\ - -e 's/\\\\def\\\\mudelapaperlinewidth{\([^}]*\).*$/TWN=\1;/p' \\ - $File` -if [ -z "$PSZ" ] -then - PSZ=$fPSZ -fi -if [ ! -z "$PSZ" ] -then - PAPEROPT=$PSZ -fi -# -if [ -z "$ORI" ] -then - ORI=$fORI -fi -if [ ! -z "$ORI" ] -then - if [ -z "$PAPEROPT" ] - then - PAPEROPT=$ORI - else - PAPEROPT=$PAPEROPT,$ORI - fi -fi -# -if [ ! -z "$PAPEROPT" ] -then - PAPER="["$PAPEROPT"]" -fi -# -if [ -z "$LNG" ] -then - LNG=$fLNG -fi -if [ ! -z "$LNG" ] -then - LLNG="\usepackage["$LNG"]{babel}" -else - LLNG="%" -fi - -# -# Find textwidth -# -if [ ! -z "$TWN" ] -then - TW=$TWN - case $TW in - *mm) - ;; - *cm) - ;; - *pt) - ;; - *) - TW=$TW"pt" - ;; - esac - $debug_echo "Text width = "$TW -fi -TWp=`echo $TW | sed -e 's/\..*$//'` -PWp=$PWIDTH -if [ "$ORI" = "landscape" ] -then - PWp=$PHEIGTH -fi -MARG=`expr $PWp - $TWp` -MARG=`expr $MARG / 2`"pt" -# -# Geometry: /var/lib/texmf/latex/geometry/geometry.dvi -# -# -# Write LaTeX file -# -cat << EOF > $LF -% Creator: $IDENTIFICATION -% Automatically generated from $IF, $NOW - -\documentclass$PAPER{article} -\nonstopmode -$LLNG -\usepackage{geometry} -\usepackage[T1]{fontenc} -%\addtolength{\oddsidemargin}{-1cm} -%\addtolength{\topmargin}{-1cm} -\setlength{\textwidth}{$TW} -%\geometry{width=$TW, left=$MARG, top=1cm} -\geometry{width=$TW, left=$MARG} -\input lilyponddefs -\input titledefs -\begin{document} -EOF -# -# Include \def\mudela-definitions -# -for L in $MU_DEF -do - LL=`egrep '^\\\\def.'$L'{' $OF` - if [ "$LL" != "" ] - then - LLL=`echo $LL | sed -e 's/}.*$//' -e 's/.*{//'` - if [ "$LLL" != "" ] - then - echo '\'$L'{'$LLL'}%' >> $LF - fi - fi -done -# -cat << EOF >> $LF -\makelilytitle -EOF -} -# -# Conclusion -# -endFile(){ -cat << EOF >> $LF -\vfill\hfill{(\LilyIdString)} -\end{document} -EOF -# -# Run LaTeX -# -latex $LF || exit 5 -# -# Rename dvi file -# -if [ -f $FN.dvi ] -then - RESULT=$BN.dvi - if [ x$OUTPUTDIR != x ]; then - RESULT="$OUTPUTDIR/$RESULT" - fi - cp $FN.dvi $RESULT -fi -# -# Clean up -# -if [ "$KEEP" != "Y" ] -then - rm $LF $FN.* -fi -# -# Output some info -# -cat << EOF - -$IDENTIFICATION: dvi file name is $RESULT - -EOF -} - -# ugh. GF is side-effect. -findInput() { -# should check for LILYINCLUDE - for lypath in "." `echo $LILYINCLUDE| sed 's/:/ /g'` - do - if [ -f "$lypath/$1" ] - then - GF="$lypath/$1" - return - fi - - if [ -f "$lypath/$1.ly" ] - then - GF="$lypath/$1.ly" - return - fi - done - $debug_echo $IDENTIFICATION": Input file "$GF" not found" - echo $NAME": Input file "$GF" not found" 1>&2 - exit 2 -} -# -# Loop through all files -# -for GF in $* -do - findInput $GF - - # - # Check whether the file is input to or output from lilypond - # - L1=`head -1 $GF` - OP=`echo $L1 | grep "^% Creator: GNU LilyPond"` - if [ -n "$OP" ] - then - # - # OK - it's the output from lilypond. - # - # Get lilypond source file name - # - OF=$GF - IFL=`grep mudelafilename $OF` - if [ "$IFL" != "" ] - then - IF=`echo $IFL | sed -e 's/.*{//' -e 's/}*.$//'` - # - # Check if source file exists - # - if [ ! -f $IF ] - then - $debug_echo $IDENTIFICATION": Mudela file not found." - TW=15.5cm - fi - else - $debug_echo $IDENTIFICATION": Mudela file name not found." - TW=15.5cm - fi - else - # - # I have to assume this is the lilypond input file - # Find output file name, if defined - # - IF=$GF - # - # Run lilypond - # Grab output file names - # - $debug_echo "lilypond "$IF - - lilypond $IF 2>&1 | tee /tmp/lilylog.$$ - OF=`egrep '^TeX output to ' /tmp/lilylog.$$ | \\ - sed -e 's/TeX output to//' -e 's/\.\.\.//'` - $debug_echo "==> "$OF - STATUS=`grep -i error /tmp/lilylog.$$` - rm /tmp/lilylog.$$ - if [ ! -z "$STATUS" ] - then - exit 10 - fi - fi - # - # "Spin through" all the files - # - for File in $OF - do - $debug_echo "--- "$File - # - # Check if output file is generated - # - if [ ! -f $File ] - then - $debug_echo $IDENTIFICATION": hmm, I could not find the output file "$File - exit 4 - fi - # - # Is this the first file? - # - if [ -z "$FFile" ] - then - FFile=$File - startFile - fi - cat << EOF >> $LF -\input{$File} -EOF - if [ $SEPFILE = Y ] - then - FFile="" - endFile - fi - done -done -if [ $SEPFILE = N ] -then - endFile -fi -# -# OK - finished -# diff --git a/bin/make-docxx.sh b/bin/make-docxx.sh deleted file mode 100644 index b274731309..0000000000 --- a/bin/make-docxx.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -if [ x$LILYTOP = x ]; -then - LILYTOP = . -fi -p1=`find $LILYTOP -name '*.hh' |egrep -v out/` -p2=`find $LILYTOP -name '*.cc' |egrep -v out/` -doc++ -f -d docxx/ -S -k -p $BANNEROPT $p1 $p2 diff --git a/bin/make-examples.sh b/bin/make-examples.sh deleted file mode 100644 index 620a28a7dd..0000000000 --- a/bin/make-examples.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# make-examples - -examples="twinkle-pop wtk1-fugue2 standchen-16 standchen-20 wtk1-prelude1 toccata-fuga-E scsii-menuetto cadenza gallina twinkle collisions font font20 scales rhythm multi spacing beams stem" -pss=$(echo $examples | sed "s/[^ ][^ ]*/out\\/&.ps/g") - -# cd ~/lelie/current/Documentation/out -cd ~/lelie/current/input -make -C ../Documentation $pss diff --git a/bin/make-patch.py b/bin/make-patch.py deleted file mode 100644 index 0f5ee3057d..0000000000 --- a/bin/make-patch.py +++ /dev/null @@ -1,136 +0,0 @@ -#!@PYTHON@ - -import sys -import os - -lilypath ='' -try: - lilypath = os.environ['LILYPOND_SOURCEDIR'] + '/' -except KeyError: - print 'Please set LILYPOND_SOURCEDIR to the toplevel source, eg LILYPOND_SOURCEDIR=/home/foobar/lilypond-1.2.3/' - sys.exit(1) - -lilypath = lilypath + '/bin/' -sys.path.append(lilypath) - - -from lilypython import * -import getopt -import pipes - - -mp_version = '0.3' - -class Options: - def __init__(self): - self.to_version = lilydirs.version_tuple() - self.from_version = prev_version(self.to_version) - -options = Options() - - -def help(): - sys.stdout.write( - 'Generate a patch to go to this version.\n' - ' --from=FROM, -f FROM old is FROM\n' - ' --to=TO, -t TO to version TO\n' - - ) - - - -def untar(fn): - # os.system('pwd'); - sys.stderr.write('untarring ' + fn + '\n') -# can't seem to fix errors: -# gzip: stdout: Broken pipe -# tar: Child returned status 1 -# os.system ('tar xzf ' + fn) -# sys.stderr.write('\n') -# ugh, even this does not work, but one error message less :-) - os.system ('gzip --quiet -dc ' + fn + '| tar xf - ') -# so print soothing message: -# sys.stderr.write('make-patch:ugh: Please ignore error: gzip: stdout: Broken pipe\n'); - sys.stderr.flush() - - -header = 'Generated by make-patch, old = %s, new = %s\n\ -\n\ -usage \n\ -\n\ - cd lilypond-source-dir; patch -E -p0 < %s\n\ -\n\ -Patches do not contain automatically generated files, \n\ -i.e. you should rerun configure\n\n' - -pats = ['*.lsm', 'configure', '*.txt', 'lilypond.spec'] -def remove_automatic(dirnames): - files = [] - files = files + multiple_find(pats, dirnames) - - for f in files: - os.remove(f) - -def makepatch(fv, tv, patfile_nm): - import tempfile - prev_cwd = os.getcwd(); - try: - os.mkdir ('/tmp/make-patch'); - except: - pass - - os.chdir ('/tmp/make-patch'); - untar(released_tarball(fv)) - untar(released_tarball(tv)) - remove_automatic([dirname(fv), dirname(tv)]) - - os.chdir(dirname(tv)) - - if not patfile_nm: - patfile_nm = '../patch-%s' % version_tuple_to_str(tv) - - f = open(patfile_nm, 'w') - f.write(header %\ - (version_tuple_to_str(fv), version_tuple_to_str(tv), \ - os.path.basename(patfile_nm))) - f.close() - - sys.stderr.write('diffing to %s... ' % patfile_nm) - os.system('diff -urN ../%s . >> %s' % (dirname(fv), patfile_nm)) - #os.system('gzip -9f %s' % patfile_nm) - os.chdir('/tmp/make-patch') - - sys.stderr.write('cleaning ... ') - os.system('rm -fr %s %s' % (dirname(tv), dirname(fv))) - sys.stderr.write('\n') - os.chdir(prev_cwd) - -def main(): - os.environ['GZIP'] = '-q' - sys.stderr.write('This is make-patch version %s\n' % mp_version) - (cl_options, files) = getopt.getopt(sys.argv[1:], - 'hf:o:t:', ['output=', 'help', 'from=', 'to=']) - outfn = '' - for opt in cl_options: - o = opt[0] - a = opt[1] - if o == '--from' or o == '-f': - options.from_version = version_str_to_tuple(a) - elif o == '--to' or o == '-t': - options.to_version = version_str_to_tuple(a) - elif o== '--help' or o == '-h': - help() - return 0; - elif o == '--output' or o == '-o': - outfn = os.path.join(os.getcwd(), a) - else: - raise getopt.error - - if not outfn: - pn = 'patch-%s' % version_tuple_to_str(options.to_version) - outfn = os.path.join(os.getcwd(), pn) - - makepatch(options.from_version, options.to_version, outfn) - -if __name__ == '__main__': - main() diff --git a/bin/make-version.sh b/bin/make-version.sh deleted file mode 100644 index 3be14353cb..0000000000 --- a/bin/make-version.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -#shift; -if test "x$1" = x; -then - versionfile="VERSION" -else - versionfile=$1; -fi - -cat $versionfile| sed 's/#.*$//g'|sed 's/\([^ ]*\)[\t ]*=[ \t]*\([^ ]*\)$/#define \1 \"\2\"/g' -echo - diff --git a/bin/make-website.py b/bin/make-website.py deleted file mode 100644 index a2243a78f9..0000000000 --- a/bin/make-website.py +++ /dev/null @@ -1,312 +0,0 @@ -#!@PYTHON@ -# -# make-website.py -- implement The lilypond WWW site -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997, 1998 Han-Wen Nienhuys -# - -""" - stupid script to generate WWW site. - - The WWW site is my test-suite for LilyPond, I usually don't - distribute versions that fail to complete this script - -You should set the following environment vars: - -LILYPOND_SOURCEDIR -TEXINPUTS -MAILADDRESS - - - """ - -import sys -import os - -lilypath ='' -try: - lilypath = os.environ['LILYPOND_SOURCEDIR'] + '/' -except KeyError: - print 'Please set LILYPOND_SOURCEDIR to the toplevel source, eg LILYPOND_SOURCEDIR=/home/foobar/lilypond-1.2.3/' - sys.exit(1) - -lilypath = lilypath + '/bin/' -sys.path.append(lilypath) - -from lilypython import * -import __main__ -import glob - -depth = '' -makewebsite_id = ""; -id_str = "make-website 0.8"; -tar = "tar"; -make = "make"; -mailaddress = "unknown" -fullname = "unknown" -footstr = "" -lilyversion= '' - -include_path=[ 'input', 'mutopia' , 'mutopia/J.S.Bach', - 'mutopia/J.S.Bach/out' ] - -def set_vars(): - __main__.lilyversion = version_tuple_to_str(lilydirs.version_tuple()) - os.environ["TEXINPUTS"] = os.environ["TEXINPUTS"] + ":%s/input/:" % depth; - - os.environ["LILYINCLUDE"] = join (':', __main__.include_path) - os.environ["LILYTOP"] = depth; - __main__.mailaddress= os.environ['MAILADDRESS'] - pw = pwd.getpwuid (os.getuid()); - - __main__.fullname= pw[4]; - -backstr = '\n
Please take me back to the index\n\ -of LilyPond -- The GNU Project Music typesetter\n\ -
\n\ -This page was built using %s from lilypond-%s by

\n\ -


%s <%s>
\n\ -

' - - -def footstr(index): - return backstr % (index, id_str, lilyversion, fullname, mailaddress, mailaddress) - - - -# do something, check return status -def my_system(cmds): - for cmd in cmds: - ignoreret=0; - if cmd[0] == '-': - ignoreret = 1 - cmd = cmd[1:] - - ret = os.system (cmd) - if ret: - if ignoreret: - sys.stderr.write( "ignoring failed command \`%s\' (status %d)\n" % (cmd, ret)) - else: - sys.stderr.write( 'make-website: failed on command %s (status %d)\n' % (cmd, ret)) - sys.exit (2) - -base="lilypond/"; - -examples=["twinkle-pop", - "praeludium-fuga-E", - "cadenza", - "twinkle", - "collisions", - "font16", - "font20", - #"scales", - "rhythm", - "multi"] - -mutopia_examples = [ "wtk1-fugue2", - "standje", - "preludes-1", - "preludes-2", - "wtk1-prelude1", - "gallina", - "scsii-menuetto"] - - -def gen_html(): - print 'generating HTML' - my_system (["make -kC .. html"]); - - -def gen_examples(inputs): - print 'generating examples:\n' - outputs = [] - for i in inputs: - try: - located = multiple_find ([i + '.ly'], include_path) [0] - except IndexError: - print 'continuing dazed & confused (%s) ' % i - continue - outputs.append (located) - if not file_exist_b(i + '.dvi'): - my_system (['ly2dvi %s' % located]) - if not file_exist_b(i + '.ly.txt'): - os.link (located, i + ".ly.txt") - list = map(lambda x: 'out/%s.ps.gz out/%s.gif' % (x,x), inputs) - my_system (['make -C .. ' + join(' ', list)]) - - return outputs - -def gen_list(inputs, filename): - print "generating HTML list %s\n" % filename; - list = open(filename, 'w') - list.write ('Rendered Examples\n' - 'These example files are taken from the LilyPond distribution.\n' - 'LilyPond currently only outputs TeX and MIDI. The pictures and\n' - 'PostScript files were generated using TeX, Ghostscript and some\n' - 'graphics tools. The papersize used for these examples is A4. The GIF\n' - 'files have been scaled to eliminate aliasing.\n'); - - for ex in inputs: - print '%s, ' % ex - header = read_mudela_header(ex + '.ly.txt') - - def read_dict(s, default, h =header): - try: - ret = h[s] - except KeyError: - ret = default - return ret - head = read_dict('title', ex) - composer = read_dict('composer', '') - desc = read_dict('description', '') - list.write('


') - list.write('

example file: %s

' % head); - if composer <> '': - list.write('

%s

\n' % composer) - if desc <> '': - list.write('%s

' % desc) - list.write ('

    ') - def list_item(filename, desc, l = list): - if file_exist_b(filename): - l.write ('
  • %s\n' % (filename, desc)) - - list_item(ex + '.ly.txt', 'The input') - for pageno in range(1,10): - f = ex + '-page%d.gif' % pageno - if not file_exist_b (f): - break - list_item(f, 'The output (picture, page %d)' % pageno) - list_item(ex + '.ps.gz', 'The output (gzipped PostScript)') - list_item(ex + '.midi', 'The output (MIDI)') - list.write ("
"); - - list.write( ""); - list.close() - -texstuff = ["mudela-man", "mudela-course"] - -def gen_manuals(): - print 'generating TeX doco manuals' - list = open('tex_manuals.html', 'w') - list.write( "PostScript Manuals\n" - "

LilyPond manuals (in PostScript)

" - "
    \n") - todo='' - for stuff in texstuff: - todo = todo + ' out/' + stuff + '.ps.gz' - list.write("
  • %s.ps.gz" % (stuff, stuff)) - list.write('
') - list.close () - - my_system (['make -C .. ' + todo]) - -def file_exist_b(name): - try: - f = open(name) - except IOError: - return 0 - f.close () - return 1 -def copy_files(): - print "copying files\n" - -# my_system ("ln -s depth/out ./docxx" ) - my_system([ "cp %s/TODO ./TODO.txt" % depth, - "cp %s/ANNOUNCE-0.1 ./ANNOUNCE.txt" % depth, - "cp %s/NEWS ./NEWS.txt" % depth, - "cp %s/DEDICATION ./DEDICATION.txt" % depth]); - my_system([ "make -C .. gifs"]); - -def docxx_update(): - print 'docxx.. \n' - banner= open('/tmp/lilybanner.html', 'w'); - banner.write (footstr('../index.html')) - banner.close () - my_system(['BANNEROPT=\"-B /tmp/lilybanner.html\" %s/bin/out/make-docxx' % depth]); -# os.unlink( "/tmp/lilybanner.html"); - -def get_glob(exts): - result = [] - for a in exts: - result = result + glob.glob1('./', '*.' + a) - - return result - -def join(inter, list): - return reduce (lambda x,y, i=inter: x + i + y, list) - -def do_tar(): - print "tarring.\n"; - list = get_glob( ['html', 'gif', 'ps.gz' , 'txt', 'midi']) - files = join (' ', list) - print files - my_system( ['-tar zvhcf website.tar.gz ' + files + ' docxx/*']) - - -def identify(): - print 'This is %s\n' % id_str - -def clean_tmp(): - my_system(['rm -f /tmp/gs*']) - -def get_top_of_NEWS(): - i = open('NEWS.txt') - lines = i.readlines() - i.close () - s = '' - for l in lines: - if regex.search('^\*\*\*\*\*\*', l) <> -1: - return s; - s = s + l - return s - -def edit_index(): - s = gulp_file('index.html') - s = regsub.sub ('top_of_NEWS', '\n' + get_top_of_NEWS () + '\n', s) - dump_file ('index.html', s) - -def edit_html(): - files = get_glob(['html']) - for f in files: - - s = gulp_file(f) - if regex.search(makewebsite_id, s) <> -1: - continue; - - s = regsub.sub ('', footstr('index.html') + makewebsite_id + '', s) - s = regsub.sub('\(.*\)$', - 'LilyPond WWW: \\1', s) - - dump_file (f,s) - - -def do_examples (examples, filename): - located_files = gen_examples (examples) - gen_list (examples, filename) -def main(): - identify(); - - os.chdir (lilydirs.topdir + 'Documentation/out') - __main__.depth = "../../"; - __main__.include_path = map(lambda p: __main__.depth + '/' + - p, __main__.include_path) - - set_vars(); - gen_html(); - copy_files(); - do_examples (examples, 'examples_output.html'); - do_examples (mutopia_examples, 'mutopiaexamples_output.html'); - gen_manuals(); - #set_images(); - edit_html(); - edit_index(); - docxx_update() - do_tar() - clean_tmp(); - - -main() - - diff --git a/bin/makepatch.py b/bin/makepatch.py deleted file mode 100644 index 0d7ecfc082..0000000000 --- a/bin/makepatch.py +++ /dev/null @@ -1,145 +0,0 @@ -#!@PYTHON@ -from lilypython import * -import getopt -import pipes - - -mp_version = '2' - -class Options: - def __init__(self): - self.to_version = lilydirs.version_tuple() - self.from_version = prev_version(self.to_version) - -options = Options() - - -def help(): - sys.stdout.write( - 'Generate a patch to go to this version.\n' - ' --from=FROM, -f FROM old is FROM\n' - ' --to=TO, -t TO to version TO\n' - - ) - sys.exit(); - - - -def untar(fn): - sys.stderr.write('untarring ' + fn) - os.system ('tar xzf ' + fn) - sys.stderr.write('\n') - sys.stderr.flush() - - -header = 'Generated by make-patch, old = %s, new = %s\n\ -\n\ -usage \n\ -\n\ - cd lilypond-source-dir; patch -E -p0 < %s\n\ -\n\ -Patches do not contain automatically generated files, \n\ -i.e. you should rerun configure\n\n' - -import fnmatch -import os - -_debug = 0 - -_prune = ['(*)'] - - -def my_find(patterns, dir = os.curdir): - list = [] - names = os.listdir(dir) - names.sort() - for name in names: - if name in (os.curdir, os.pardir): - continue - fullname = os.path.join(dir, name) - for pat in patterns: - if fnmatch.fnmatch(name, pat): - list.append(fullname) - if os.path.isdir(fullname) and not os.path.islink(fullname): - for p in _prune: - if fnmatch.fnmatch(name, p): - if _debug: print "skip", `fullname` - break - else: - if _debug: print "descend into", `fullname` - found = my_find(patterns, fullname) - if found: - list = list + found - return list - -def multiple_find(pats, dirnames): - from find import find - l = [] - for d in dirnames: - l = l + my_find(pats, d) - return l - -pats = ['*.lsm', 'configure', '*.text', 'lilypond.spec'] -def remove_automatic(dirnames): - files = [] - files = files + multiple_find(pats, dirnames) - - for f in files: - os.remove(f) - -def makepatch(fv, tv, patfile_nm): - import tempfile - prev_cwd = os.getcwd(); - os.chdir ('/tmp') - untar(released_tarball(fv)) - untar(released_tarball(tv)) - remove_automatic([dirname(fv), dirname(tv)]) - - os.chdir(dirname(tv)) - - if not patfile_nm: - patfile_nm = '../patch-%s' % version_tuple_to_str(tv) - - f = open(patfile_nm, 'w') - f.write(header %\ - (version_tuple_to_str(fv), version_tuple_to_str(tv), \ - os.path.basename(patfile_nm))) - f.close() - - sys.stderr.write('diffing to %s... ' % patfile_nm) - os.system('diff -urN ../%s . >> %s' % (dirname(fv), patfile_nm)) - #os.system('gzip -9f %s' % patfile_nm) - os.chdir('/tmp') - - sys.stderr.write('cleaning ... ') - os.system('rm -fr %s %s' % (dirname(tv), dirname(fv))) - sys.stderr.write('\n') - os.chdir(prev_cwd) - -def main(): - sys.stderr.write('This is make-patch version %s\n' % mp_version) - (cl_options, files) = getopt.getopt(sys.argv[1:], - 'hf:o:t:', ['output=', 'help', 'from=', 'to=']) - outfn = '' - for opt in cl_options: - o = opt[0] - a = opt[1] - if o == '--from' or o == '-f': - options.from_version = version_str_to_tuple(a) - elif o == '--to' or o == '-t': - options.to_version = version_str_to_tuple(a) - elif o== '--help' or o == '-h': - help() - elif o == '--output' or o == '-o': - outfn = os.path.join(os.getcwd(), a) - else: - raise getopt.error - - if not outfn: - pn = 'patch-%s' % version_tuple_to_str(options.to_version) - outfn = os.path.join(os.getcwd(), pn) - - makepatch(options.from_version, options.to_version, outfn) - -if __name__ == '__main__': - main() diff --git a/bin/mf-deps.py b/bin/mf-deps.py deleted file mode 100644 index 6d022fff45..0000000000 --- a/bin/mf-deps.py +++ /dev/null @@ -1,88 +0,0 @@ -#!@PYTHON@ - -# -# mf-deps.py -- dependencies for metafont -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997 Han-Wen Nienhuys -# - - -"""look into metafont source for dependencies. - - fixme: python path - fixme: error reporting - fixem: python sucks slightly: why doesn't it have closures? - -""" - -from regex import * ; -from regsub import * ; -import sys; -import os; - - -version = "0.2" -input_re = compile('^[ \t]*input *\([^;]+\);') -postfixes = ['log', 'dvi', '2602gf', 'tfm'] - -def identify (): - return "mf-deps.py %s" % version - - - -def print_one(x): - print x - -def line_concat(x,y): - return x + '\n' + y - -class Targetdeps: - """Dependencies for one toplevel sourcefile - - """ - - def __init__(self,nm): - split = os.path.splitext(nm) - self.basename=split[0]; - self.depfiles = [] - self.checkdep(nm) - - def checkdep(self, name): - split = os.path.splitext(name) - name = split[0] + '.mf'; - - if name not in self.depfiles: - self.get_filedeps(name) - - def get_filedeps(self,filename): -# print sys.stderr.write( 'checking ' + filename + '\n'); - try: - file = open(filename) - except IOError: -# print sys.stderr.write( 'can\'t open ' + filename + '\n') - return - - self.depfiles.append(filename) - lines = file.readlines() - file.close() - for line in lines: - if input_re.search (line) <> -1: - self.checkdep( input_re.group(1)) - - def target_string(self): - # ugh. Closures, anyone? - targets = map (lambda x,y = self.basename: 'out/' + y + '.' + x, postfixes) - depstring = reduce(lambda x,y: x + ' ' + y, self.depfiles) - dependencies = map (lambda x, y=depstring: x + ': ' + y, targets) - - return reduce(line_concat, dependencies) - -print "# Automatically generated by %s\n" % identify () - -for file in sys.argv[1:]: # skip programname - t = Targetdeps(file) - print t.target_string() - - diff --git a/bin/mf-to-table.py b/bin/mf-to-table.py deleted file mode 100644 index 58c96c384b..0000000000 --- a/bin/mf-to-table.py +++ /dev/null @@ -1,222 +0,0 @@ -#!@PYTHON@ - -# -# mf-to-table.py -- convert spacing info in MF logs .ly and .tex -# -# source file of the GNU LilyPond music typesetter -# -# (c) 1997 Han-Wen Nienhuys -# - -import getopt -from string import * -import regex -import regsub -import os -import sys -import time -from flower import * - -begin_autometric_re = regex.compile('@{') -end_autometric_re = regex.compile('@}') -autometric_re = regex.compile('@{\(.*\)@}') -version = '0.5' - -class Feta_file(File): - """Read Feta metrics from a metafont log-file.""" - def read_autometricline(self): - line = '' - while end_autometric_re.search(line) == -1 and not self.eof(): - suf = File.readline(self) - if begin_autometric_re.search(line) == -1: - line = '' - line = line + regsub.sub('\n','', suf) - - if self.eof(): - return '' - - return line; - def readline(self): - """return what is enclosed in one @{ @} pair""" - line = ''; - while autometric_re.search(line) == -1 and not self.eof(): - line = self.read_autometricline() - - if self.eof(): - return ''; - - return autometric_re.group(1); - def __init__(self, nm): - File.__init__(self, nm) - def do_file(infile_nm): - infile = readline(); - -# -# FIXME: should parse output for {} to do indenting. -# -class Indentable_file(File): - """Output file with support for indentation""" - def __init__(self,nm, mode): - File.__init__(self,nm,mode) - self.current_indent_ = 0 - self.delta_indent_ = 4 - def writeline (self, str): - File.write(self, str) - def writeeol(self): - File.write(self, '\n') - File.write(self, ' '* self.current_indent_) - - def indent(self): - self.current_indent_ = self.delta_indent_ + self.current_indent_; - def dedent(self): - self.current_indent_ = self.current_indent_ - self.delta_indent_; - if self.current_indent_ < 0: - raise 'Nesting!' - - def write(self, str): - lines = split(str, '\n') - for l in lines[:-1]: - self.writeline(l) - self.writeeol() - self.writeline (lines[-1]) - -class Ly_file(Indentable_file): - """extra provisions for mozarella quirks""" - def print_lit(self, str): - self.write('\"%s\"\t' % str) - - def print_f_dimen(self, f): - dimstr = '%.2f' % f - - # try to mask rounding errors - if (dimstr == '-0.00'): - dimstr = '0.00' - self.write( dimstr +'\\pt\t'); - - def print_dimen(self, str): - self.print_f_dimen(atof(str)) - - def neg_print_dimen(self, str): - self.print_f_dimen(-atof(str)); - - def def_symbol(self, lily_id, tex_id, dims): - self.print_lit(lily_id) - self.print_lit('\\\\' + tex_id) - - self.neg_print_dimen(dims [0]) - self.print_dimen(dims [1]) - self.neg_print_dimen(dims [2]) - self.print_dimen(dims [3]) - self.write('\n') - - -class Log_reader: - """Read logs, destill info, and put into output files""" - def output_label(self, line): - - if not line: - return; - tags = split(line, '@:') - label = tags[0] - name = tags[1] - ly = self.lyfile - if tags[0] == 'font': - ly.indent() - ly.write("% name=\\symboltables {\n") - self.texfile.write("% name\n") - elif label == "group": - ly.indent() - ly.print_lit(name) - ly.write(' = \\table {\n') - self.texfile.write("% " + name + "\n") - elif label == "puorg": - ly.dedent() - ly.write("}\n") - self.texfile.write("\n") - elif label == "tnof": - ly.dedent() - ly.write("% } % $name\n") - elif label == "char": - code = tags[2] - id = tags [7] - texstr = tags [8] - - ly.def_symbol(id, texstr, tags[3:7]) - - self.texfile.write("\\fetdef\\%s{%s}\n" % (texstr, code)) - else: - raise 'unknown label: ' + label - - - def do_file(self,filenm): - self.lyfile.write('\n% input from ' + filenm + '\n') - self.texfile.write('\n% input from ' + filenm + '\n') - feta = Feta_file(filenm) - while not feta.eof(): - line = feta.readline() - self.output_label(line) - feta.close() - - def __init__(self, lyfile_nm, texfile_nm): - self.lyfile = Ly_file(lyfile_nm, 'w') - self.texfile = Indentable_file(texfile_nm, 'w') - - - headerstr = '%% Creator: %s\n%% Automatically generated on\n%% Do not edit' % \ - (program_id() ) - - self.lyfile.write(headerstr) - self.texfile.write(headerstr) - - def close(self): - self.lyfile.close() - self.texfile.close() - - def __del__(self): - self.close() - -def today_str(): - return time.asctime(time.localtime(time.time())) - -def program_id(): - return 'mf-to-table.py version ' + version; - -def identify(): - sys.stdout.write(program_id() + '\n') - -def help(): - sys.stdout.write("Usage: mf-to-table [options] LOGFILEs\n" - + "Generate mozarella metrics table from preparated feta log\n\n" - + "Options:\n" - + " -h, --help print this help\n" - + " -l, --ly=FILE name output table\n" - + " -t, --tex=FILE name output tex chardefs\n") - - -def main(): - identify() - (options, files) = getopt.getopt( - sys.argv[1:], 'hl:t:', ['ly=', 'tex=', 'debug', 'help']) - - lyfile_nm = texfile_nm = ''; - for opt in options: - o = opt[0] - a = opt[1] - if o == '--ly' or o == '-l': - lyfile_nm = a - elif o == '--tex' or o == '-t': - texfile_nm = a - elif o== '--help' or o == '-h': - help() - elif o == '--debug': - debug_b = 1 - else: - raise getopt.error - - log_reader = Log_reader(lyfile_nm, texfile_nm) - for filenm in files: - log_reader.do_file(filenm) - log_reader.close() - - -main() diff --git a/bin/mudela-book.pl b/bin/mudela-book.pl deleted file mode 100644 index f23b428b52..0000000000 --- a/bin/mudela-book.pl +++ /dev/null @@ -1,208 +0,0 @@ -#!@PERL@ -w -# -*-Perl-*- -my $mudcount = 0; -my $mudela_b = 0; -my $outname = "-"; -my $outdir; -use Getopt::Long; - - -# do something, check return status -sub my_system -{ - my (@cmds) = @_; - foreach $cmd (@cmds) { - my ($ignoreret)=0; - if ( $cmd =~ /^-/ ) { - $ignoreret = 1; - $cmd = substr ($cmd, 1); - } - - my $ret = ( system ($cmd)); - if ($ret) { - if ($ignoreret) { - print STDERR "ignoring failed command \`$cmd\' (status $ret)\n"; - }else { - print STDERR "\nmudela-book: failed on command \`$cmd\' (status $ret)\n"; - exit 2; - } - } - } -} -sub gen_mufile -{ - return "$outdir/$outname$mudcount.ly"; -} - -sub gen_texbase -{ - return "$outname$mudcount.tex"; -} -sub gen_texfile -{ - return "$outdir/" . gen_texbase; -} - -sub close_mudela -{ - $mudela_b = 0; - if ($fragment_b) { - print MUDELA "}\n \\paper { linewidth = -1.0\\cm;"; - print MUDELA "castingalgorithm = \\Wordwrap; } }\n"; - $fragment_b =0; - } - if ($verbatim_b) { - print BOOK "\\end{verbatim}"; - } - if ($center_b) { - print BOOK "\\end{minipage}"; - } - if ($verbatim_b) { - print BOOK "\\interexample"; - $verbatim_b = 0; - } - close MUDELA; - my $status =0; - if ( -f gen_mufile ) { - $status = system "diff -q $outdir/book-mudela.ly " . gen_mufile; - } else { - $status = 1; - } - if ( $status ) { - rename "$outdir/book-mudela.ly", gen_mufile; - unlink gen_texfile; - } - - if ( ! -f gen_texfile) { - my_system "lilypond ". gen_mufile; - rename gen_texbase, gen_texfile; - } - - if ($center_b) { - print BOOK "\\begin{minipage}[c]{.5\\textwidth}\n"; - } - print BOOK "\\input " . gen_texfile . "%\n"; - if ($center_b) { - print BOOK "\\end{minipage}"; - $center_b = 0; - } - print BOOK "\\postexample%\n"; -} - -sub open_mudela -{ - $mudcount++; - $mudela_b = 1 ; - open MUDELA, ">$outdir/book-mudela.ly"; - print BOOK "\\preexample%\n"; - if ($center_b) { - print BOOK "\\begin{minipage}[c]{.5\\textwidth}\n"; - } - if ($verbatim_b) { - print BOOK "\\begin{verbatim}\n"; - } - if ($fragment_b) { - print MUDELA "\\score { \\melodic {\\octave c';"; - } else { - print MUDELA "default_paper = \\paper { \\paper_sixteen "; - print MUDELA "linewidth = 7.\\cm;}"; - } - -} - -sub begin_b -{ - my ($s) = @_; - return (/^\\begin{$s}/) ; -} - -sub end_b -{ - my ($s) = @_; - return (/^\\end{$s}/) ; -} -sub parse_mudela_opts -{ - my ($s) = @_; - $s =~ s/[\[\]]//g; - - $verbatim_b =1 if ($s =~ /verbatim/ ); - $fragment_b = 1 if ($s =~ /fragment/ ); - $center_b = 1 if ($s =~ /center/ ); -} - -sub help -{ - print "usage: convert-mudela [options] [file] -options: ---help ---outdir=DIRECTORY write all files in directory DIRECTORY ---outname=NAME use NAME as base for the output -"; - exit; -} - -sub main -{ - GetOptions( 'outdir=s', 'outname=s', 'help'); - if ( $opt_help ) { - help(); - $opt_help = 0; # to extinguish typo check. brr, what a language - } - - if (defined ($opt_outdir)) { - $outdir = $opt_outdir . "/"; - } else { - $outdir = "."; - } - - if (defined ($ARGV[0])) { - $infile = $ARGV[0] ; - } else { - $infile = "-"; - } - if (defined ($opt_outname)) { - $outname = $opt_outname ; - } else { - die "Need to have an output name, use --outname" if ( $infile eq "-"); - $outname = "$infile.tex"; - } - - my $openout ="$outdir$outname"; - if ( $infile eq $openout ) { - die "The input can't be the output\n"; - } - - open INFILE, "<$infile"; - open BOOK, ">$openout"; - while () { - if ($mudela_b) { - if (end_b "mudela") { - close_mudela; - next; - } - print MUDELA; - if ( $verbatim_b ) { - my $s = $_; - $s =~ s/\t/ /g; #shit - print BOOK $s; - } - - } else { - if (/^\\begin(\[.*\])?{mudela}/ ) { - my $opts =""; - $opts = $1 if ( defined ($1)); - - parse_mudela_opts($opts); - open_mudela; - next; - } - print BOOK; - } - } - close INFILE; - close BOOK; -} - - -main; diff --git a/bin/ps-to-gifs.sh b/bin/ps-to-gifs.sh deleted file mode 100644 index dc51988675..0000000000 --- a/bin/ps-to-gifs.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -usage() -{ - echo 'ps-to-gifs.sh FILE.ps' - exit 2; -} - -case $# in -1) - FILE=`basename $1 .ps` - ;; -*) - usage - ;; -esac - -# generate the pixmap at twice the size, then rescale (for antialiasing) -cat $1 | gs -q -sDEVICE=ppmraw \ - -sOutputFile="|pnmscale 0.5|ppmtogif > $FILE-page%d.gif" \ - -r200 -dNOPAUSE - -c quit - - - diff --git a/bin/release.py b/bin/release.py deleted file mode 100644 index 1ba3c6c87c..0000000000 --- a/bin/release.py +++ /dev/null @@ -1,56 +0,0 @@ -#!@PYTHON@ - -import sys -import os - -lilypath ='' -try: - lilypath = os.environ['LILYPOND_SOURCEDIR'] + '/' -except KeyError: - print 'Please set LILYPOND_SOURCEDIR to the toplevel source, eg LILYPOND_SOURCEDIR=/home/foobar/lilypond-1.2.3/' - sys.exit(1) - -lilypath = lilypath + '/bin/' -sys.path.append(lilypath) - -from lilypython import * - -os.chdir(lilydirs.topdir) -os.system('make dist') -cur_ver = lilydirs.version_tuple() -print tarball(cur_ver) -try: - os.rename('out/' + tarball(cur_ver), released_tarball(cur_ver)) -except posix.error: - os.system('cp out/' + tarball(cur_ver) + ' ' + released_tarball(cur_ver)) - os.unlink('out/' + tarball (cur_ver)) - -os.chdir(lilydirs.groupdir + '/test') -os.system('pwd') -os.system('rm ../test/*gz') - -#huh? -#os.symlink(released_tarball(cur_ver), tarball(cur_ver)) - -try: - os.link(released_tarball(cur_ver), tarball(cur_ver)) -except posix.error: - os.system('cp ' + released_tarball(cur_ver) + ' '+ tarball(cur_ver)) - -# not a module, but a script (JCN) -# makepatch.main() - -# Module wherefore aren't thou Script -# A Rose by any other name would be as blonde. --HWN - -os.system('python ' + lilydirs.topdir + '/bin/make-patch.py'); - -pn = 'patch-%s' % version_tuple_to_str(cur_ver) -os.system('gzip -9 ' + pn) -pn = pn + '.gz' -rel_pn = lilydirs.release_dir + '../patches/' + pn; - -os.rename(pn, rel_pn); -os.link(rel_pn, pn); - -os.system('tar cf updeet *gz') diff --git a/bin/show-latest.pl b/bin/show-latest.pl deleted file mode 100644 index 1c3d14dd0e..0000000000 --- a/bin/show-latest.pl +++ /dev/null @@ -1,53 +0,0 @@ -#!@PERL@ -# -*-Perl-*- - - -$reldir="/home/hanwen/musix/releases"; - -use FileHandle; -use Getopt::Long; - -sub cmpver -{ - my(@a)= split( /\./, $a); - my(@b)= split( /\./, $b); - - for $i (0,1,2) { - return $a[$i] <=> $b[$i] if ($a[$i] != $b[$i]); - } - return $a cmp $b; -} - -my @versions; -open LS, "ls -1 $reldir|"; - -GetOptions( 'print', 'news', 'latest'); - - -while () { - $_ =~ /lilypond-([^.]+\.[^.]+\.[^.]+).tar.gz/; - push @versions, $1; -} - - -@versions = sort cmpver @versions; -my $last= (pop @versions); - - -if ( $opt_print ) { - print $last; -} - -if ( $opt_latest) { - system "rm $reldir/zZ*"; - system "> $reldir/zZ_LATEST_IS_$last"; -} -if ( $opt_news ) { - open NEWS, "tar --to-stdout -zxf $reldir/lilypond-$last.tar.gz lilypond-$last/NEWS |"; - input_record_separator NEWS "****"; - $desc = ; - chop ($desc); - close NEWS; - - print $desc; -} diff --git a/debian/Makefile b/debian/Makefile deleted file mode 100644 index 531f1330c4..0000000000 --- a/debian/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -depth = .. - -NAME= debian - -# generic variables: -# -include ./$(depth)/make/Variables.make -include ./$(depth)/make/Files.make -# - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make -# - - -EXTRA_DISTFILES = README.Debian TODO changelog control copyright \ - postinst postinst.old.sh postrm preinst rules watch diff --git a/flower/Flower-flags.make.in b/flower/Flower-flags.make.in deleted file mode 100644 index adf1536750..0000000000 --- a/flower/Flower-flags.make.in +++ /dev/null @@ -1,3 +0,0 @@ -MODULE_CXXFLAGS = @MODULE_CXXFLAGS@ -MODULE_LDFLAGS = @MODULE_LDFLAGS@ -LIB_SUFFIX = @LIB_SUFFIX@ diff --git a/flower/Makefile b/flower/Makefile deleted file mode 100644 index c46fed65eb..0000000000 --- a/flower/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -# -# project FlowerSoft C++ library -# title top level makefile for FlowerLib -# file flower/Makefile -# -# Copyright (c) 1997 by -# Jan Nieuwenhuizen -# Han-Wen Nienhuys -# ...your sort order here, or how to comment-out a comment - -# subdir level: -# -depth = .. -# - -# identify module: -# -NAME = flower -MODULE_NAME = flower -# -# edit VERSION only -include ./$(depth)/VERSION -include ./$(depth)/flower/VERSION - -# generic variables: -# -include ./$(depth)/make/Variables.make -include ./$(depth)/make/Files.make - -include $(flowerout)/Flower-flags.make - - -# -# descent order into subdirectories: -# -SUBDIRS = include test -# - -# list of distribution files: -# -SCRIPTS = -README_FILES = ONEWS NEWS README TODO -EXTRA_DISTFILES= aclocal.m4 configure config.hh.in configure.in VERSION $(README_FILES) $(SCRIPTS) Flower-flags.make.in -# - - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make -# - -default: the-lib - -THE_LIB=$(outdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX) -the-lib: $(THE_LIB) - -# version: -# - -localdist: configure - --include /dev/null $(DEPFILES) -# - -localdistclean: - rm -f config.cache config.status config.log - -localinstall: $(LIBFLOWER) -ifeq ($(LIB_SUFFIX),.so) - $(INSTALL) -d $(libdir) - $(INSTALL) $(LIBFLOWER).$(VERSION) $(libdir) - ln -sf $(LIB_PREFIX)flower$(LIB_SUFFIX).$(VERSION) $(libdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX).$(MAJOR_VERSION) - ln -sf $(LIB_PREFIX)flower$(LIB_SUFFIX).$(VERSION) $(libdir)/$(LIB_PREFIX)flower$(LIB_SUFFIX) -endif - -localuninstall: - rm -f $(libdir)/libflower.{so*,a} - - -$(outdir)/flower-version.o: $(outdir)/version.hh diff --git a/flower/include/Makefile b/flower/include/Makefile deleted file mode 100644 index b7716f2676..0000000000 --- a/flower/include/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# flower/lib/include/Makefile - -# subdir level: -# -depth = ../.. -# - -# generic stuff/Makefile -# -include ./$(depth)/make/Include.make -include ./$(depth)/flower/VERSION - -# identify module: -# -MODULE_NAME = flower - - -# - diff --git a/flower/test/Makefile b/flower/test/Makefile deleted file mode 100644 index eccb972ad3..0000000000 --- a/flower/test/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# -# project LilyPond -- the musical typesetter -# title makefile for flowertest -# file test/Makefile -# -# Copyright (c) 1997 by -# Jan Nieuwenhuizen -# Han-Wen Nienhuys -# - -# subdir level: -# -depth = ../.. -# - -# identify module: -# -NAME =flower-test -# include ./$(depth)/$(NAME)/VERSION -MODULE_NAME = flower -include ./$(depth)/flower/VERSION - -# - -# generic variables: -# -include ./$(depth)/make/Variables.make -include ./$(depth)/make/Files.make -# - -# list of distribution files: -# -EXTRA_DISTFILES = result - -# list of custom libraries: -# - -MODULE_LIBDEPS=check-flower-deps -MODULE_LIBES = -lflower -# - - -# main target of this module: -# -BUILDSTRINGTEST=$(MAINTARGET) -EXECSTRINGTEST=$(EXECUTABLE) - -# don't do the exec, as this might fail if flowerlib isn't installed yet. -default: $(BUILDSTRINGTEST) - -test: $(EXECUTABLE) - $(EXECSTRINGTEST) > $(outdir)/result - cmp $(outdir)/result result - -dummy: - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make - - -# auto dependencies: -# -ifdef DEPFILES -include $(DEPFILES) -endif -# - diff --git a/init/Makefile b/init/Makefile deleted file mode 100644 index a04eed6775..0000000000 --- a/init/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# init/Makefile - - -# subdir level: -# -depth = .. -# - -build = ./$(depth)/lily/$(outdir)/.build - -# generic stuff/Makefile -# -include ./$(depth)/make/Include.make - -# list of distribution files: -# -INIFILES = $(wildcard *.ly) -DISTFILES = Makefile $(INIFILES) - -## we probably can make tex/*defs.tex and init/*.ly in one go... -## moved to mf/Makefile -FONT_FILES = $(wildcard $(depth)/mf/*[0-9].mf) -TABLES = $(patsubst $(depth)/mf/%.mf,%.ly,$(FONT_FILES)) -## -## all: $(TABLES) -## -## $(outdir)/%.log: $(depth)/mf/%.mf -## mf $< -## mv $(@F) $@ -## rm $(shell basename $< .mf).*gf -## -## %.ly: $(outdir)/%.log -## mf-to-table -o $@ $< -## -localclean: - rm -f $(TABLES) - -localinstall: - $(INSTALL) -d $(datadir)/lilypond/init - $(INSTALL) -m 644 $(INIFILES) $(datadir)/lilypond/init - -localuninstall: - for i in $(INIFILES) ; do rm -f $(datadir)/lilypond/init/$$i; done - -rmdir $(datadir)/lilypond/init $(datadir)/lilypond/ diff --git a/input/Makefile b/input/Makefile deleted file mode 100644 index 45c1320de0..0000000000 --- a/input/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# input/Makefile - -# subdir level: -# -depth = .. -# - -build = ./$(depth)/lily/$(outdir)/.build - -# generic stuff/Makefile -# -include ./$(depth)/make/Include.make -# - -# list of distribution files: -# -LYFILES = $(wildcard *.ly) -TEXFILES = $(wildcard *.tex) -M4FILES = $(wildcard *.m4) -DISTFILES = Makefile TODO $(LYFILES) $(TEXFILES) $(wildcard *.m4) -# - -OUTFILES = $(addprefix $(outdir)/,$(M4FILES:%.m4=%)) - -all: $(OUTFILES) diff --git a/lib/Makefile b/lib/Makefile deleted file mode 100644 index 83dfc51d4f..0000000000 --- a/lib/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# -# project LilyPond -- the musical typesetter -# title makefile for micro-lily-lib -# file lib/Makefile -# -# Copyright (c) 1997 by -# Jan Nieuwenhuizen -# Han-Wen Nienhuys -# - -# subdir level: -# -depth = .. -# - -# generic variables: -# -include ./$(depth)/make/Variables.make -include ./$(depth)/make/Files.make -include ./$(depth)/make/Version.make -# - -# identify module: -# -NAME = lily -# - -# descent order into subdirectories: -# -SUBDIRS = include -# - -# to be remade each build: -# -VERSION_DEPENDENCY =# -# - -# list of distribution files: -# -EXTRA_DISTFILES = config.hh.in -# - -MODULE_CXXFLAGS += -D_REENTRANT - -# list of custom libraries: - -LOADLIBES += -# - -# main target of this module: -# -# MAINTARGET = $(EXECUTABLE) -# MAINTARGET = $(LIBRARY) -# MAINTARGET = $(bindir)/$(EXECUTABLE)# huh? -MAINTARGET = $(outdir)/$(LIBRARY)# huh? - -default: configheader $(MAINTARGET) -# - -localclean: - rm -f $(MAINTARGET) - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make - -# auto dependencies: -# --include $(DEPFILES) -# - -.PHONY: configheader - -configheader: $(outdir)/config.hh - -# Ugh ugh -$(outdir)/config.hh: config.hh.in - sed 's!@datadir@!$(datadir)!'< $< > $@ diff --git a/lib/include/Makefile b/lib/include/Makefile deleted file mode 100644 index 43a98084f3..0000000000 --- a/lib/include/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# lib/include/Makefile - -# subdir level: -# -depth = ../.. -# - -# identify module: -# -MODULE_NAME = lilypond - -# generic stuff/Makefile -# - -include ./$(depth)/make/Include.make - - diff --git a/lily/Makefile b/lily/Makefile deleted file mode 100644 index 936d4c31a7..0000000000 --- a/lily/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# project LilyPond -- the musical typesetter -# title makefile for lilypond -# file lily/Makefile -# -# Copyright (c) 1997 by -# Jan Nieuwenhuizen -# Han-Wen Nienhuys -# - -# subdir level: -# -depth = .. -# - -# identify module: -# -NAME = lilypond -# - -# generic variables: -# -include Stable.make -include ./$(depth)/make/Variables.make -include VERSION -# - -# descent order into subdirectories: -# -SUBDIRS = include -# - - -# list of distribution files: -# -EXTRA_DISTFILES = VERSION -# - -# list of custom libraries: -# -MODULE_LIBDEPS= check-flower-deps check-lib-deps -MODULE_LIBES= -llily -lflower - -# - -# main target of this module: -# - -default: $(EXECUTABLE) - -out/engraver.o: include/engraver.hh -# -include ./$(depth)/make/Files.make - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make -# - -# force these: Make can't know these have to be generated in advance -my-lily-lexer.cc: $(outdir)/parser.hh -$(outdir)/lexer.cc: $(outdir)/parser.hh - -# - - -localclean: - rm -f $(outdir)/parser.* $(outdir)/lexer.cc - -#should merge with mi2mu rule -localinstall: installexe - -localuninstall: uninstallexe - -$(outdir)/lily-version.o: $(outdir)/version.hh - -# make config.hh. Ugh -$(outdir)/main.o: $(libout)/config.hh - -$(libout)/config.hh: check-lib-deps diff --git a/lily/include/Makefile b/lily/include/Makefile deleted file mode 100644 index da392fe30f..0000000000 --- a/lily/include/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# lily/include/Makefile - -# subdir level: -# -depth = ../.. -# - -# identify module: -# -MODULE_NAME = lilypond -include ./$(depth)/make/Include.make - diff --git a/lily/lexer.l b/lily/lexer.l deleted file mode 100644 index c7df7be95e..0000000000 --- a/lily/lexer.l +++ /dev/null @@ -1,430 +0,0 @@ -%{ // -*-Fundamental-*- -/* - lexer.l -- implement the Flex lexer - - source file of the LilyPond music typesetter - - (c) 1996,1997 Han-Wen Nienhuys -*/ - - -/* - backup rules - - after making a change to the lexer rules, run - flex -b - and make sure that - lex.backup - contains no backup states, but only the reminder - Compressed tables always back up. - (don-t forget to rm lex.yy.cc :-) - */ - - -#include -#include - -#include "string.hh" -#include "string-convert.hh" -#include "my-lily-lexer.hh" -#include "varray.hh" -#include "interval.hh" -#include "parser.hh" -#include "debug.hh" -#include "parseconstruct.hh" -#include "main.hh" -#include "identifier.hh" -void strip_trailing_white (String&); -void strip_leading_white (String&); - - -#define start_quote() \ - yy_push_state (quote);\ - yylval.string = new String - -#define yylval (*(YYSTYPE*)lexval_l) - -#define YY_USER_ACTION add_lexed_char (YYLeng ()); -%} - -%option c++ -%option noyywrap -%option nodefault -%option debug -%option yyclass="My_lily_lexer" -%option stack -%option never-interactive -%option warn - -%x incl -%x lyrics -%x notes -%x quote -%x longcomment - - -A [a-zA-Z] -AA {A}|_ -N [0-9] -AN {AA}|{N} -PUNCT [?!:'] -ACCENT \\[`'"^] -NATIONAL [\001-\006\021-\027\031\036\200-\377] -TEX {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL} -WORD {A}{AN}* -ALPHAWORD {A}+ -DIGIT {N} -UNSIGNED {N}+ -INT -?{UNSIGNED} -REAL ({INT}\.{N}*)|(-?\.{N}+) -KEYWORD \\{WORD} -WHITE [ \n\t\f] -HORIZONTALWHITE [ \t] -BLACK [^ \n\t\f] -RESTNAME [rs] -NOTECOMMAND \\{A}+ -LYRICS ({AA}|{TEX})[^0-9 \t\n\f]* -ESCAPED [nt\\'"] -PLET \\\[ -TELP \\\] - -%% - - -<*>\r { - // windows-suck-suck-suck -} - -{ - "%{" { - yy_push_state (longcomment); - } - %[^{\n].*\n { - } - %[^{\n] { // backup rule - } - %\n { - } - %[^{\n].* { - } - {WHITE}+ { - - } -} - -{ - [^\%]* { - } - \%*[^}%]* { - - } - "%"+"}" { - yy_pop_state (); - } - <> { - LexerError ("EOF found inside a comment"); - if (! close_input ()) - yyterminate (); // can't move this, since it actually rets a YY_NULL - } -} - - - -\\include { - yy_push_state (incl); -} -\"[^"]*\" { /* got the include file name */ - String s (YYText ()+1); - s = s.left_str (s.length_i ()-1); - DOUT << "#include `" << s << "\'\n"; - new_input (s,source_global_l); - yy_pop_state (); -} -\"[^"]* { // backup rule - cerr << "missing end quote" << endl; - exit (1); -} -{RESTNAME} { - const char *s = YYText (); - yylval.string = new String (s); - DOUT << "rest:"<< yylval.string; - return RESTNAME; -} -\\\${BLACK}*{WHITE} { - String s=YYText () + 2; - s=s.left_str (s.length_i () - 1); - return scan_escaped_word (s); -} -\${BLACK}*{WHITE} { - String s=YYText () + 1; - s=s.left_str (s.length_i () - 1); - return scan_bare_word (s); -} -\\\${BLACK}* { // backup rule - cerr << "white expected" << endl; - exit (1); -} -\${BLACK}* { // backup rule - cerr << "white expected" << endl; - exit (1); -} -{ - {ALPHAWORD}/\' { - post_quotes_b_ = true; - return scan_bare_word (YYText ()); - } - \'+ { - yylval.i = YYLeng (); - if (post_quotes_b_) { - post_quotes_b_ = false; - return POST_QUOTES; - } else - return PRE_QUOTES; - } - {ALPHAWORD} { - return scan_bare_word (YYText ()); - - } - - {NOTECOMMAND} { - return scan_escaped_word (YYText ()+1); - } - - {DIGIT} { - yylval.i = String_convert::dec2_i (String (YYText ())); - return DIGIT; - } - - {UNSIGNED} { - yylval.i = String_convert::dec2_i (String (YYText ())); - return UNSIGNED; - } - - \" { - start_quote (); - } -} - -\" { - start_quote (); -} -{ - \\{ESCAPED} { - *yylval.string += escaped_char(YYText()[1]); - } - [^\\"]+ { - *yylval.string += YYText (); - } - \" { - DOUT << "quoted string: `" << *yylval.string << "'\n"; - yy_pop_state (); - return STRING; - } - . { - *yylval.string += YYText (); - } -} - -{ - - \" { - start_quote (); - } - {UNSIGNED} { - yylval.i = String_convert::dec2_i (String (YYText ())); - return UNSIGNED; - } - {NOTECOMMAND} { - return scan_escaped_word (YYText ()+1); - } - {LYRICS} { - /* ugr. This sux. */ - String s (YYText ()); - int i = 0; - while ((i=s.index_i ("_")) != -1) // change word binding "_" to " " - *(s.ch_l () + i) = ' '; - if ((i=s.index_i ("\\,")) != -1) // change "\," to TeX's "\c " - { - *(s.ch_l () + i + 1) = 'c'; - s = s.left_str (i+2) + " " + s.right_str (s.length_i ()-i-2); - } - yylval.string = new String (s); - DOUT << "lyric : `" << s << "'\n"; - return STRING; - } - . { - return yylval.c = YYText ()[0]; - } -} - -<> { - DOUT << "<>"; - - if (! close_input ()) { - yyterminate (); // can't move this, since it actually rets a YY_NULL - } -} -{WORD} { - return scan_bare_word (YYText ()); -} -{KEYWORD} { - return scan_escaped_word (YYText ()+1); -} -{REAL} { - Real r; - int cnv=sscanf (YYText (), "%lf", &r); - assert (cnv == 1); - DOUT << "REAL" << r<<'\n'; - yylval.real = r; - return REAL; -} - -{UNSIGNED} { - yylval.i = String_convert::dec2_i (String (YYText ())); - return UNSIGNED; -} - -[{}] { - - DOUT << "parens\n"; - return YYText ()[0]; -} -[*:=] { - char c = YYText ()[0]; - DOUT << "misc char" <{PLET} { - return yylval.i = PLET; -} - -{TELP} { - return yylval.i = TELP; -} - -. { - return yylval.c = YYText ()[0]; -} - -\\. { - char c= YYText ()[1]; - yylval.c = c; - switch (c) { - case '>': - return E_BIGGER; - case '<': - return E_SMALLER; - case '!': - return E_EXCLAMATION; - default: - return E_CHAR; - } -} - -<*>. { - String msg= String ("illegal character: ") +String (YYText ()[0]); - LexerError (msg.ch_C ()); - return YYText ()[0]; -} - -%% - -void -My_lily_lexer::push_note_state () -{ - yy_push_state (notes); -} - -void -My_lily_lexer::push_lyric_state () -{ - yy_push_state (lyrics); -} -void -My_lily_lexer::pop_state () -{ - yy_pop_state (); -} - -int -My_lily_lexer::scan_escaped_word (String str) -{ - DOUT << "\\word: `" << str<<"'\n"; - int l = lookup_keyword (str); - if (l != -1) { - DOUT << "(keyword)\n"; - return l; - } - Identifier * id = lookup_identifier (str); - if (id) { - DOUT << "(identifier)\n"; - yylval.id = id; - return id->token_code_i_; - } - if (YYSTATE != notes) { - Melodic_req * mel_l = lookup_melodic_req_l (str); - if (mel_l) { - DOUT << "(notename)\n"; - yylval.melreq = mel_l; - return NOTENAME_ID; - } - } - String msg ("Unknown escaped string: `" + str + "'"); - LexerError (msg.ch_C ()); - DOUT << "(string)"; - String *sp = new String (str); - yylval.string=sp; - return STRING; -} - -int -My_lily_lexer::scan_bare_word (String str) -{ - DOUT << "word: `" << str<< "'\n"; - if (YYSTATE == notes){ - Melodic_req * mel_l = lookup_melodic_req_l (str); - if (mel_l) { - DOUT << "(notename)\n"; - yylval.melreq = mel_l; - return NOTENAME_ID; - } - } - - yylval.string=new String (str); - return STRING; -} - -bool -My_lily_lexer::note_state_b () const -{ - return YY_START == notes; -} - -bool -My_lily_lexer::lyric_state_b () const -{ - return YY_START == lyrics; -} - -void -strip_trailing_white (String&s) -{ - int i=0; - for (; i < s.length_i (); i++) - if (!isspace (s[i])) - break; - - s = s.nomid_str (0, i); -} - -void -strip_leading_white (String&s) -{ - int i=s.length_i (); - while (i--) - if (!isspace (s[i])) - break; - - s = s.left_str (i+1); -} diff --git a/lily/parser.y b/lily/parser.y deleted file mode 100644 index 545d72c8a6..0000000000 --- a/lily/parser.y +++ /dev/null @@ -1,1337 +0,0 @@ -%{ // -*-Fundamental-*- - -/* - parser.y -- YACC parser for mudela - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - -#include - -// mmm -#define MUDELA_VERSION "0.1.9" - -#include "scalar.hh" -#include "translation-property.hh" -#include "script-def.hh" -#include "symtable.hh" -#include "lookup.hh" -#include "misc.hh" -#include "my-lily-lexer.hh" -#include "paper-def.hh" -#include "midi-def.hh" -#include "main.hh" -#include "keyword.hh" -#include "debug.hh" -#include "parseconstruct.hh" -#include "dimen.hh" -#include "identifier.hh" -#include "command-request.hh" -#include "musical-request.hh" -#include "my-lily-parser.hh" -#include "text-def.hh" -#include "translator-group.hh" -#include "score.hh" -#include "music-list.hh" -#include "header.hh" -#include "duration-convert.hh" -#include "change-translator.hh" - -int const GUESS_PLET = 5; -int guess_plet_a[GUESS_PLET] = -{ - 1, - 3, - 2, - 3, - 4 -}; - -#ifndef NDEBUG -#define YYDEBUG 1 -#endif - -#define YYERROR_VERBOSE 1 - -#define YYPARSE_PARAM my_lily_parser_l -#define YYLEX_PARAM my_lily_parser_l -#define THIS ((My_lily_parser *) my_lily_parser_l) - -#define yyerror THIS->parser_error - -%} - - -%union { - Array* intarr; - Array *melreqvec;/* should clean up naming */ - Array * strvec; - Array *intvec; - Box *box; - Chord * chord; - Duration *duration; - Identifier *id; - Translator* trans; - Music *music; - Music_list *musiclist; - Score *score; - Header *header; - Interval *interval; - Lookup*lookup; - Melodic_req * melreq; - Musical_req* musreq; - Music_output_def * outputdef; - Midi_def* midi; - Moment *moment; - Note_req *notereq; - Paper_def *paper; - Real real; - Request * request; - General_script_def * script; - Scalar *scalar; - String *string; - Atom * symbol; - Symtable * symtable; - Symtables * symtables; - Text_def * textdef; - Tempo_req *tempo; - char c; - const char *consstr; - int i; - int pair[2]; - int ii[10]; -} -%{ - -int -yylex (YYSTYPE *s, void * v_l) -{ - My_lily_parser *pars_l = (My_lily_parser*) v_l; - My_lily_lexer * lex_l = pars_l->lexer_p_; - - lex_l->lexval_l = (void*) s; - return lex_l->yylex (); -} - - -%} - -%pure_parser - -/* tokens which are not keywords */ - -%token ALIAS -%token BAR -%token BEAMPLET -%token MAEBTELP -%token CADENZA -%token CLEAR -%token CLEF -%token CONTAINS -%token CONSISTS -%token ACCEPTS -%token CM_T -%token DURATION -%token ABSDYNAMIC -%token END -%token GROUPING -%token TRANSLATOR -%token HEADER -%token IN_T -%token LYRIC -%token KEY -%token MELODIC -%token MIDI -%token MELODIC_REQUEST -%token METER -%token MM_T -%token MULTI -%token NOTENAMES -%token OCTAVE -%token OUTPUT -%token PAPER -%token PARTIAL -%token PLET -%token TELP -%token PT_T -%token SCORE -%token SCRIPT -%token SHAPE -%token SKIP -%token SPANDYNAMIC -%token STAFF -%token START_T -%token SYMBOLTABLES -%token TABLE -%token TRANSPOSE -%token TEMPO -%token TYPE -%token TEXID -%token TEXTSTYLE -%token TITLE -%token PROPERTY -%token VERSION - -/* escaped */ -%token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR - -%type dots -%token DIGIT -%token NOTENAME_ID -%token DURATION_IDENTIFIER -%token IDENTIFIER -%token MELODIC_REQUEST_IDENTIFIER -%token MUSIC_IDENTIFIER -%token VOICE_IDENTIFIER -%token POST_REQUEST_IDENTIFIER -%token SCRIPT_IDENTIFIER -%token COMMAND_IDENTIFIER -%token REAL_IDENTIFIER -%token TRANS_IDENTIFIER -%token INT_IDENTIFIER -%token SCORE_IDENTIFIER -%token MIDI_IDENTIFIER -%token PAPER_IDENTIFIER -%token REQUEST_IDENTIFIER -%token REAL -%token DURATION RESTNAME -%token STRING -%token UNSIGNED -%token POST_QUOTES -%token PRE_QUOTES - -%type output_def -%type
mudela_header mudela_header_body -%type box -%type open_request_parens close_request_parens -%type open_abbrev_parens -%type open_plet_parens close_plet_parens -%type simple_element music_elt full_element lyrics_elt command_elt -%type abbrev_type -%type int unsigned -%type script_dir -%type identifier_init -%type explicit_steno_duration notemode_duration -%type entered_notemode_duration explicit_duration -%type dinterval -%type intastint_list -%type symtables symtables_body -%type melodic_request steno_melodic_req -%type steno_note_req -%type pitch_list -%type midi_block midi_body -%type duration_length - -%type scalar -%type Music transposed_music -%type property_def translator_change -%type Voice Voice_body -%type Chord Chord_body -%type paper_block paper_body -%type dim real -%type unit -%type abbrev_command_req -%type post_request structured_post_request -%type plet_fraction -%type command_req verbose_command_req -%type script_req dynamic_req -%type score_block score_body -%type shape_array -%type