From: Han-Wen Nienhuys Date: Sun, 13 Jun 2004 21:53:52 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.4~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4270f2868b4a7a3ae468e84767f16d34a68978c9;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 97d27adb7d..48da22da57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ 2004-06-13 Han-Wen Nienhuys + * Documentation/user/invoking.itexi (Invoking the lilypond + binary): document --safe. + * scm/output-gnome.scm: set PATH in script. * scm/page-layout.scm (default-page-make-stencil): don't stretch diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index deaf79c535..1e19e91e26 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -103,7 +103,7 @@ included. Default: unset. @item latexheaders Specify additional La@TeX{} headers file. - +< Normally read from the @code{\header} block. Default value: empty. @item latexpackages @@ -134,13 +134,8 @@ block. @item papersize The paper size (as a name, e.g. @code{a4}). It is normally read from the @code{\paper} block. - -@item pagenumber - If set to @code{no}, no page numbers will be printed. If set to a -positive integer, start with this value as the first page number. - - @item fontenc +@item fontenc The font encoding, should be set identical to the @code{font-encoding} property in the score. @end table @@ -177,22 +172,8 @@ output). If @file{filename.ly} contains more than one @code{\score} block, then the rest of the scores will be output in numbered files, starting with @file{filename-1.tex}. Several files can be specified; they will each be processed independently. @footnote{The status of - GUILE is not reset across invocations, so be careful not to change any - system defaults from within Scheme.} - -We strongly advise against making LilyPond formatting available -through a web server. That is, processing input from untrusted users, -and returning the resulting PDF file. LilyPond is a big and complex -program. It was not written with security in mind. Making it available -to the outside world is a huge risk; consider the security -implications of - -@verbatim - #(system "rm -rf /") - \score { - c4^#(ly:export (ly:gulp-file "/etc/passwd")) - } -@end verbatim +GUILE is not reset across invocations, so be careful not to change any +system defaults from within Scheme.} @section Command line options @@ -211,11 +192,11 @@ information. @item -f,--format=@var{format} @c @c -Output format for sheet music. Choices are @code{tex} (for @TeX{} -output, to be processed with La@TeX{}, or through @code{lilypond}), -and @code{ps} for PostScript. +A comma separated list of output formats. Choices are @code{tex} (for +@TeX{} output, to be processed with La@TeX{}, and @code{ps} for +PostScript. -Other output options are intended for developers. +Other output options are intended for developers. @cindex output format, setting @@ -238,8 +219,28 @@ will be generated. Set the default output file to @var{FILE}. @item -s,--safe -Disallow untrusted @code{\include} directives, limit available in-line -Scheme function, disable backslashes in @TeX{}, code. +Do not trust the @code{.ly} input. + +When LilyPond formatting available through a web server, the +@code{--safe} @b{MUST} be passed. This will prevent code like + +@verbatim + #(system "rm -rf /") + \score { + c4^#(ly:export (ly:gulp-file "/etc/passwd")) + } +@end verbatim + +The @code{--safe} option works by evaluating in-line Scheme +expressions in a special safe module. This safe module is derived from +GUILE @file{safe-r5rs} module, but adds a number of functions of the +LilyPond API. These functions are listed in @file{safe-lily.scm}. + +In addition, @code{--safe} disallows @code{\include} directives and +disables the use of backslashes in @TeX{} strings. + +In @code{--safe} mode, it is not possible to import LilyPond variables +into Scheme. @item -v,--version Show version information. diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 0b8613180d..45c35c02f4 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -37,7 +37,7 @@ ABC2LY = $(script-dir)/abc2ly.py CONVERT_LY = $(script-dir)/convert-ly.py LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond LILYPOND_BOOK = $(script-dir)/lilypond-book.py -LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/ +LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/ #texi-html for www only: LILYPOND_BOOK_FORMAT=$(if $(subst out-www,,$(notdir $(outdir))),texi,texi-html) diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 7980d184a7..80ae95f5b2 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -15,10 +15,19 @@ ;;; ;;; Try it ;;; +;;; * If using GUILE CVS , then compile LilyPond with GUILE 1.6, +;;; +;;; PATH=/usr/bin/:$PATH ./configure --enable-config=g16 ; make conf=g16 +;;; ;;; * Install gnome/gtk development stuff and g-wrap, guile-gnome ;;; see buildscripts/guile-gnome.sh ;;; ;;; * Use latin1 encoding for gnome backend, do +;;; +;;; make -C mf conf=g16 clean +;;; make -C mf conf=g16 ENCODING_FILE=$(kpsewhich cork.enc) +;;; (cd mf/out && mkfontdir)i +;;; xset +fp $(pwd)/mf/out " make -C mf clean make -C mf ENCODING_FILE=$(kpsewhich cork.enc) @@ -56,6 +65,101 @@ lilypond-bin -fgnome input/simple-song.ly ;;; * papersize, outputscale from book +" +#!/bin/bash + +set -ex + +# no CVS guile. +export PATH=/usr/bin/:$PATH + +if [ -d $HOME/usr/pkg/libffi/ ] ; then + export LDFLAGS=-L$HOME/usr/pkg/libffi/lib/ + export CPPFLAGS=-I$HOME/usr/pkg/libffi/include +fi + +export AUTOMAKE=automake-1.8 +export AUTOCONF=autoconf2.50 + +rm -rf test +mkdir test +cd test + +## 1. install gnome-devel (Debian/unstable: apt-get install gnome-devel) + +## 2. *** NOTE: use guile-1.6 for g-wrap and guile-gnome *** +##### using GUILE CVS g-wrap/guile-gnome is experimental (read: segfaults) +PATH=/usr/bin:$PATH + + +## 3. get g-wrap 2.0 +tla register-archive a.rottmann@gmx.at--2004-main http://people.debian.org/~rotty/arch/a.rottmann@gmx.at/2004-main || true + +rm -rf g-wrap +## tla get a.rottmann@gmx.at--2004-main/g-wrap--tng g-wrap +## pull latest g-wrap from janneke -- this step is probably no longer +## necessary when you read this +tla register-archive janneke@gnu.org--2004-gnome http://lilypond.org/~janneke/{arch}/2004-gnome || true +tla get janneke@gnu.org--2004-gnome/g-wrap--janneke g-wrap +cd g-wrap + +rm -rf $HOME/usr/pkg/g-wrap +sh autogen.sh --noconfigure +mkdir =build +cd =build +../configure --prefix=$HOME/usr/pkg/g-wrap +make install + +# cp srfi-34.scm from CVS head ? --hwn +(cd $HOME/usr/pkg/g-wrap/share/guile/site + mv srfi-34.scm srfi-34.scm-g-wrap + cp $HOME/usr/pkg/guile/share/guile-1.7/srfi/srfi-34.scm .) + +cd ../.. + +## 4. get guile-gnome +tla register-archive guile-gnome-devel@gnu.org--2004 http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true +rm -rf guile-gnome +tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome +cd guile-gnome +tla build-config -r configs/gnu.org/dev +cd src + +## 5. get the gnome canvas module +tla get guile-gnome-devel@gnu.org--2004/libgnomecanvas--dev libgnomecanvas + +## pull latest defs from janneke -- this step is probably no longer +## necessary when you read this +## tla register-archive janneke@gnu.org--2004-gnome http://lilypond.org/~janneke/{arch}/2004-gnome || true +## rm -rf defs +## tla get janneke@gnu.org--2004-gnome/defs--janneke defs + +rm -rf $HOME/usr/pkg/guile-gnome +sh autogen.sh --noconfigure +mkdir ../=build +cd ../=build + +export GUILE_LOAD_PATH=$HOME/usr/pkg/g-wrap/share/guile/site:$GUILE_LOAD_PATH +export LD_LIBRARY_PATH=$HOME/usr/pkg/g-wrap/lib:$LD_LIBRARY_PATH +export PKG_CONFIG_PATH=$HOME/usr/pkg/g-wrap/lib/pkgconfig:$PKG_CONFIG_PATH + +../src/configure --prefix=$HOME/usr/pkg/guile-gnome + + +# requires 800mb RAM with -O2 +(cd gtk/gnome/gw; perl -i~ -pe 's/-O2//g' Makefile) + +G_WRAP_MODULE_DIR=$HOME/usr/pkg/g-wrap/share/guile/site make install + +export GUILE_LOAD_PATH=$HOME/usr/pkg/guile-gnome/share/guile:$GUILE_LOAD_PATH +export LD_LIBRARY_PATH=$HOME/usr/pkg/guile-gnome/lib:$LD_LIBRARY_PATH + + +# simple test +guile -s ../src/libgnomecanvas/examples/canvas.scm +======= +>>>>>>> 1.21 + (debug-enable 'backtrace) @@ -69,6 +173,12 @@ lilypond-bin -fgnome input/simple-song.ly (srfi srfi-13) (lily) (gnome gtk) +<<<<<<< output-gnome.scm + (gnome gtk gdk-event) + ;; the name of the module will change to canvas rsn + (gnome gw libgnomecanvas)) + ;;(gnome gw canvas)) +======= (gnome gtk gdk-event)) ;; the name of the module will change to canvas rsn @@ -76,6 +186,7 @@ lilypond-bin -fgnome input/simple-song.ly (use-modules (gnome gw canvas)) (use-modules (gnome gw libgnomecanvas))) +>>>>>>> 1.21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; module entry @@ -99,7 +210,6 @@ lilypond-bin -fgnome input/simple-song.ly ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Lily output interface --- fix silly names and docme - " The output interface has functions for * formatting stencils, and @@ -134,9 +244,15 @@ lilypond-bin -fgnome input/simple-song.ly ;; minimal intercept list: (define output-interface-intercept +<<<<<<< output-gnome.scm + '( + no-origin +)) +======= '(comment define-origin no-origin)) +>>>>>>> 1.21 (map (lambda (x) (module-define! this-module x dummy)) output-interface-intercept)