pathsettings:
@echo export PATH=$(PATH)
- @echo export LILYPONDPREFIX=$(LILYPONDPREFIX)
+ @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
@echo export PYTHONPATH=$(PYTHONPATH)
xml: $(outdir)/lilypond/lilypond.xml $(outdir)/lilypond-internals/lilypond-internals.xml
@cindex LANG
-@cindex LILYPONDPREFIX
+@cindex LILYPOND_DATADIR
@code{Lilypond} recognizes the following environment variables:
@table @code
-@item LILYPONDPREFIX
+@item LILYPOND_DATADIR
This specifies a directory where locale messages and
data files will be looked up by default. The directory should contain
subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc.
PATH=$run/bin:$PATH
#optionally, if you do not use custom.py below
- #export LILYPONDPREFIX=$run/share/lilypond/<VERSION>
+ #export LILYPOND_DATADIR=$run/share/lilypond/<VERSION>
lilypond input/simple
CacheDir (cachedir)
-# No need to set $LILYPONDPREFIX to run lily, but cannot install...
+# No need to set $LILYPOND_DATADIR to run lily, but cannot install...
if env['debugging'] and not 'install' in COMMAND_LINE_TARGETS:
env['prefix'] = run_prefix
env.PrependENVPath ('PATH',
os.path.join (env['absbuild'], env['out'], 'usr/bin'))
-LILYPONDPREFIX = os.path.join (run_prefix, 'share/lilypond/', version)
+LILYPOND_DATADIR = os.path.join (run_prefix, 'share/lilypond/', version)
-if not os.path.exists (LILYPONDPREFIX):
- os.makedirs (LILYPONDPREFIX)
+if not os.path.exists (LILYPOND_DATADIR):
+ os.makedirs (LILYPOND_DATADIR)
-env.Command (LILYPONDPREFIX, ['#/SConstruct', '#/VERSION'], symlink_tree)
-env.Depends ('lily', LILYPONDPREFIX)
+env.Command (LILYPOND_DATADIR, ['#/SConstruct', '#/VERSION'], symlink_tree)
+env.Depends ('lily', LILYPOND_DATADIR)
env.Append (ENV = {
- 'LILYPONDPREFIX' : LILYPONDPREFIX,
- 'TEXMF' : '{$LILYPONDPREFIX,'
+ 'LILYPOND_DATADIR' : LILYPOND_DATADIR,
+ 'TEXMF' : '{$LILYPOND_DATADIR,'
+ os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}',
})
# post-config environment update
env.Append (
run_prefix = run_prefix,
- LILYPONDPREFIX = LILYPONDPREFIX,
+ LILYPOND_DATADIR = LILYPOND_DATADIR,
# FIXME: move to lily/SConscript?
LIBPATH = [os.path.join (absbuild, 'flower', env['out'])],
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=10
-PATCH_LEVEL=15
+PATCH_LEVEL=16
MY_PATCH_LEVEL=
a.append (match.group (1))
return ''
- str = re.sub ('\(([a-zA-Z_0-9-]+\.mf)', include_func, str)
+ str = re.sub ('\\(([/a-z.A-Z_0-9-]+\\.mf)', include_func, str)
str = re.sub ('@{(.*?)@}', auto_func, str)
return (autolines, deps)
EXTRA_DIST_FILES= VERSION $(README_FILES) $(SCRIPTS)
STEPMAKE_TEMPLATES=library c++ po test
-# test uses LILYPONDPREFIX
+# test uses LILYPOND_DATADIR
LOCALSTEPMAKE_TEMPLATES=lilypond
TEST_MODULE_LIBS = ../flower
export top-src-dir
+++ /dev/null
-\header {
-
- texidoc = "Microtonal shifts should be corrected before the start of
- the next (possibly grace) note. "
-}
-
-\version "2.10.14"
-
-\score
-{
-
- \relative {
- a geseh \acciaccatura a geseh
- }
-
- \midi {}
-}
vector<string> dirs;
- dirs.push_back (prefix_directory + "/fonts/otf/");
- dirs.push_back (prefix_directory + "/fonts/type1/");
+ dirs.push_back (lilypond_datadir + "/fonts/otf/");
+ dirs.push_back (lilypond_datadir + "/fonts/type1/");
for (vsize i = 0; i < dirs.size (); i++)
{
0, 0, 0, (),
"Return effective prefix.")
{
- return scm_makfrom0str (prefix_directory.c_str ());
+ return scm_makfrom0str (lilypond_datadir.c_str ());
}
LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
extern bool is_pango_format_global;
extern bool is_TeX_format_global;
extern bool point_and_click_global;
-extern string prefix_directory;
+extern string lilypond_datadir;
extern bool use_object_keys;
extern bool strict_infinity_checking;
/*
void read_relocation_dir (string dirname);
void read_relocation_file (string filename);
-string read_line (FILE *f);
string expand_environment_variables (string orig);
int sane_putenv (char const *key, string value, bool overwrite);
void
Lyric_combine_music_iterator::check_new_context (SCM sev)
{
+ if (!ok ())
+ return ;
+
// TODO: Check first if type=Voice and if id matches
Stream_event * ev = unsmob_stream_event (sev);
if (ev->get_property ("type") != ly_symbol2scm ("Voice"))
/* Where the init files live. Typically:
LILYPOND_DATADIR = /usr/share/lilypond
*/
-string prefix_directory;
+string lilypond_datadir;
/* The jail specification: USER,GROUP,JAIL,DIR. */
string jail_spec;
fputs ("\n", out);
fprintf (out, "LILYPOND_DATADIR=\"%s\"\n", LILYPOND_DATADIR);
env_var_info (out, "LILYPONDPREFIX");
+ env_var_info (out, "LILYPOND_DATADIR");
fprintf (out, "LOCALEDIR=\"%s\"\n", LOCALEDIR);
- fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.c_str ());
+ fprintf (out, "\nEffective prefix: \"%s\"\n", lilypond_datadir.c_str ());
if (relocate_binary)
{
/* Engravers use lily.scm contents, need to make Guile find it.
Prepend onto GUILE %load-path, very ugh. */
- prepend_load_path (prefix_directory);
- prepend_load_path (prefix_directory + "/scm");
+ prepend_load_path (lilypond_datadir);
+ prepend_load_path (lilypond_datadir + "/scm");
if (be_verbose_global)
dir_info (stderr);
"104857600", overwrite);
}
-void
-read_relocation_dir (string);
-
int
main (int argc, char **argv)
{
SCM answer = SCM_UNSPECIFIED;
SCM form = scm_read (port);
+
+ /* Reset read_buf for scm_ftell.
+ Shouldn't scm_read () do this for us? */
+ scm_fill_input (port);
+ SCM to = scm_ftell (port);
+ ps->nchars = scm_to_int (to) - scm_to_int (from);
+
+
/* Read expression from port. */
if (!SCM_EOF_OBJECT_P (form))
{
answer = scm_primitive_eval (form);
}
- /* Reset read_buf for scm_ftell.
- Shouldn't scm_read () do this for us? */
- scm_fill_input (port);
- SCM to = scm_ftell (port);
- ps->nchars = scm_to_int (to) - scm_to_int (from);
-
/* Don't close the port here; if we re-enter this function via a
continuation, then the next time we enter it, we'll get an error.
It's a string port anyway, so there's no advantage to closing it
parse_handler (void *data, SCM tag, SCM args)
{
Parse_start *ps = (Parse_start *) data;
- (void) tag;
ps->start_location_.error (_ ("GUILE signaled an error for the expression beginning here"));
if (scm_ilength (args) > 2)
scm_display_error_message (scm_cadr (args), scm_caddr (args), scm_current_error_port ());
- /*
- The following is a kludge; we should probably search for
- [a-z][0-9] (a note), and start before that.
- */
- ps->nchars = 1;
+ if (tag == ly_symbol2scm ("read-error"))
+ ps->nchars = 1;
return SCM_UNDEFINED;
}
/*
unfortunately, we can't portably free S here,
due to various bugs in glibc prior to 2.1.1
- */
+ */
return retval;
}
#include <winbase.h>
#endif
-void
+static void
prefix_relocation (string prefix)
{
- if (be_verbose_global)
- warning (_f ("Relocation: compile prefix=%s, new prefix=%s",
- prefix_directory,
- prefix.c_str ()));
-
string bindir = prefix + "/bin";
string datadir = prefix + "/share";
string localedir = datadir + "/locale";
- string lilypond_datadir = datadir + "/lilypond/";
-
- if (is_dir (lilypond_datadir + "/" + TOPLEVEL_VERSION))
- prefix_directory = lilypond_datadir + "/" + TOPLEVEL_VERSION;
- else if (is_dir (lilypond_datadir + "/current"))
- prefix_directory = lilypond_datadir + "/current";
-
+ string package_datadir = datadir + "/lilypond/";
+ string old_lilypond_datadir = lilypond_datadir;
+
+ if (is_dir (package_datadir + "/" + TOPLEVEL_VERSION))
+ lilypond_datadir = package_datadir + "/" + TOPLEVEL_VERSION;
+ else if (is_dir (package_datadir + "/current"))
+ lilypond_datadir = package_datadir + "/current";
+ else
+ warning (_f ("not relocating, no %s/ or current/ found under %s",
+ TOPLEVEL_VERSION, package_datadir.c_str ()));
+
#if HAVE_GETTEXT
if (is_dir (localedir))
bindtextdomain ("lilypond", localedir.c_str ());
#endif
prepend_env_path ("PATH", bindir);
+
+ if (be_verbose_global)
+ warning (_f ("Relocation: compile datadir=%s, new datadir=%s",
+ old_lilypond_datadir.c_str (),
+ lilypond_datadir.c_str ()));
}
/*
UGH : this is a complete mess.
- */
+*/
-void
+static void
framework_relocation (string prefix)
{
if (be_verbose_global)
/*
UGH : this is a complete mess.
- */
+*/
void
setup_paths (char const *argv0_ptr)
{
File_name argv0_filename (argv0_ptr);
- prefix_directory = LILYPOND_DATADIR;
- if (relocate_binary
- && getenv ("LILYPOND_RELOCATE_PREFIX"))
+ if (relocate_binary)
{
- prefix_directory = getenv ("LILYPOND_RELOCATE_PREFIX");
+ string prefix_directory;
+ if (getenv ("LILYPOND_RELOCATE_PREFIX"))
+ {
+ prefix_directory = getenv ("LILYPOND_RELOCATE_PREFIX");
#ifdef __MINGW32__
- /* Normalize file name. */
- prefix_directory = File_name (prefix_directory).to_string ();
+ /* Normalize file name. */
+ prefix_directory = File_name (prefix_directory).to_string ();
#endif /* __MINGW32__ */
- prefix_relocation (prefix_directory);
- string bindir = prefix_directory + "/bin";
- framework_relocation (bindir);
- }
- else if (relocate_binary)
- {
- string argv0_abs;
- if (argv0_filename.is_absolute ())
- {
- argv0_abs = argv0_filename.to_string ();
- if (be_verbose_global)
- warning (_f ("Relocation: is absolute: argv0=%s", argv0_ptr));
+ prefix_relocation (prefix_directory);
+ string bindir = prefix_directory + "/bin";
+ framework_relocation (bindir);
}
- else if (argv0_filename.dir_.length ())
+ else if (relocate_binary)
{
- argv0_abs = get_working_directory ()
- + "/" + string (argv0_filename.to_string ());
- if (be_verbose_global)
- warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr));
- }
- else
- {
- /* Find absolute ARGV0 name, using PATH. */
- File_path path;
- path.parse_path (getenv ("PATH"));
+ string argv0_abs;
+ if (argv0_filename.is_absolute ())
+ {
+ argv0_abs = argv0_filename.to_string ();
+ if (be_verbose_global)
+ warning (_f ("Relocation: is absolute: argv0=%s", argv0_ptr));
+ }
+ else if (argv0_filename.dir_.length ())
+ {
+ argv0_abs = get_working_directory ()
+ + "/" + string (argv0_filename.to_string ());
+ if (be_verbose_global)
+ warning (_f ("Relocation: from cwd: argv0=%s", argv0_ptr));
+ }
+ else
+ {
+ /* Find absolute ARGV0 name, using PATH. */
+ File_path path;
+ path.parse_path (getenv ("PATH"));
- if (be_verbose_global)
- warning (_f ("Relocation: from PATH=%s\nargv0=%s",
- path.to_string ().c_str (), argv0_ptr));
+ if (be_verbose_global)
+ warning (_f ("Relocation: from PATH=%s\nargv0=%s",
+ path.to_string ().c_str (), argv0_ptr));
#ifndef __MINGW32__
- argv0_abs = path.find (argv0_filename.to_string ());
+ argv0_abs = path.find (argv0_filename.to_string ());
#else /* __MINGW32__ */
- char const *ext[] = {"exe", "", 0 };
- argv0_abs = path.find (argv0_filename.to_string (), ext);
+ char const *ext[] = {"exe", "", 0 };
+ argv0_abs = path.find (argv0_filename.to_string (), ext);
#endif /* __MINGW32__ */
- if (argv0_abs.empty ())
- programming_error ("can't find absolute argv0.");
- }
+ if (argv0_abs.empty ())
+ programming_error ("cannot find absolute argv0");
+ }
- string bindir = dir_name (argv0_abs);
- string argv0_prefix = dir_name (bindir);
- string compile_prefix = dir_name (dir_name (dir_name (prefix_directory)));
- if (argv0_prefix != compile_prefix)
- {
- prefix_relocation (argv0_prefix);
- prefix_directory = argv0_prefix;
- }
- if (argv0_prefix != compile_prefix || string (FRAMEWORKDIR) != "..")
- {
- framework_relocation (bindir + "/" + FRAMEWORKDIR);
- prefix_directory = bindir + "/" + FRAMEWORKDIR;
+ string bindir = dir_name (argv0_abs);
+ string argv0_prefix = dir_name (bindir);
+ string compile_prefix = dir_name (dir_name (dir_name (lilypond_datadir)));
+ if (argv0_prefix != compile_prefix)
+ {
+ prefix_relocation (argv0_prefix);
+ prefix_directory = argv0_prefix;
+ }
+ if (argv0_prefix != compile_prefix || string (FRAMEWORKDIR) != "..")
+ {
+ framework_relocation (bindir + "/" + FRAMEWORKDIR);
+ prefix_directory = bindir + "/" + FRAMEWORKDIR;
+ }
}
+
+ lilypond_datadir = prefix_directory
+ + "/share/lilypond/" TOPLEVEL_VERSION;
}
- /* FIXME: use LILYPOND_DATADIR. */
- if (char const *env = getenv ("LILYPONDPREFIX"))
+ if (getenv ("LILYPONDPREFIX"))
+ error (_ ("LILYPONDPREFIX is obsolete, use LILYPOND_DATADIR"));
+
+ if (char const *env = getenv ("LILYPOND_DATADIR"))
{
#ifdef __MINGW32__
/* Normalize file name. */
- prefix_directory = File_name (env).to_string ();
+ lilypond_datadir = File_name (env).to_string ();
#else
- prefix_directory = env;
+ lilypond_datadir = env;
#endif
}
+ /* When running from build dir, a full LILYPOND_DATADIR is set-up at
+ $(OUTBASE)/{share, lib}/lilypond/current. Configure lily using
+ ./configure --prefix=$(pwd)/out */
+ string build_datadir_current = dir_name (lilypond_datadir) + "/current";
+ if (!is_dir (lilypond_datadir.c_str ())
+ && is_dir (build_datadir_current.c_str ()))
+ lilypond_datadir = build_datadir_current;
+
global_path.append ("");
-
- /*
- When running from build dir, a full LILYPOND_PREFIX is set-up at
-
- $(OUTBASE)/share/lilypond/TOPLEVEL_VERSION
-
- This historical hack will allow the shorthand
-
- LILYPONDPREFIX=out lily/out/lilypond ...
-
- */
-
- string build_prefix_current = prefix_directory + "/share/lilypond/" "current";
- string build_prefix_version = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
- if (is_dir (build_prefix_version.c_str ()))
- prefix_directory = build_prefix_version;
- else if (is_dir (build_prefix_current.c_str ()))
- prefix_directory = build_prefix_current;
-
/* Adding mf/out make lilypond unchanged source directory, when setting
LILYPONDPREFIX to lilypond-x.y.z */
char const *suffixes[] = {"ly", "ps", "scm", 0 };
vector<string> dirs;
for (char const **s = suffixes; *s; s++)
{
- string path = prefix_directory + to_string ('/') + string (*s);
+ string path = lilypond_datadir + to_string ('/') + string (*s);
dirs.push_back (path);
}
- dirs.push_back (prefix_directory + "/fonts/otf/");
- dirs.push_back (prefix_directory + "/fonts/type1/");
- dirs.push_back (prefix_directory + "/fonts/svg/");
+ dirs.push_back (lilypond_datadir + "/fonts/otf/");
+ dirs.push_back (lilypond_datadir + "/fonts/type1/");
+ dirs.push_back (lilypond_datadir + "/fonts/svg/");
for (vsize i = 0; i < dirs.size (); i++)
global_path.prepend (dirs[i]);
}
-
-
string
expand_environment_variables (string orig)
{
{
/*
Hmm. what to do for $1 , $~ etc.?
- */
+ */
do
{
end_var ++;
}
-string
+static string
read_line (FILE *f)
{
string out;
{
File_name name (ent->d_name);
if (name.ext_ == "reloc")
- read_relocation_file (dirname + "/" + name.to_string ());
+ read_relocation_file (dirname + "/" + name.to_string ());
}
}
Slur_engraver::finalize ()
{
if (slurs_.size ())
- slurs_[0]->warning (_ ("unterminated slur"));
+ {
+ slurs_[0]->warning (_ ("unterminated slur"));
+ for (vsize i = 0; i < slurs_.size (); i++)
+ slurs_[i]->suicide ();
+ }
}
void
(defined? 'input-file-name))
(version-not-seen-message input-file-name))
+#(ly:set-option 'protected-scheme-parsing #f)
#(if (pair? toplevel-scores)
(toplevel-book-handler
parser
# Magic: find and include LilyPond's StepMake rules
#
# 0: try local tree
-# 1: follow LILYPONDPREFIX
+# 1: follow LILYPOND_DATADIR
# 2: try source tree in home
# 3: try installed tree in $HOME
# 4: try system installed tree
# 5: try system installed tree
#
make-root=$(wildcard $(depth)/make)
-make-root?=$(wildcard $(LILYPONDPREFIX)/make)
+make-root?=$(wildcard $(LILYPOND_DATADIR)/make)
make-root?=$(wildcard $(HOME)/usr/src/lilypond/make)
make-root?=$(wildcard $(HOME)/usr/share/lilypond/make)
make-root?=$(wildcard /usr/share/lilypond/make)
# it as we do with teTeX on Red Hat Linux: set some environment var
# (PYTHONPATH) in profile)
-# If set, LILYPONDPREFIX must take prevalence
-# if datadir is not set, we're doing a build and LILYPONDPREFIX
+# If set, LILYPOND_DATADIR must take prevalence
+# if datadir is not set, we're doing a build and LILYPOND_DATADIR
datadir = '@local_lilypond_datadir@'
if not os.path.isdir (datadir):
datadir = '@lilypond_datadir@'
-if os.environ.has_key ('LILYPONDPREFIX') :
- datadir = os.environ['LILYPONDPREFIX']
+if os.environ.has_key ('LILYPOND_DATADIR') :
+ datadir = os.environ['LILYPOND_DATADIR']
while datadir[-1] == os.sep:
datadir= datadir[:-1]
(define (scm-gulp-file name)
(set! %load-path
- (cons (string-append (getenv 'LILYPONDPREFIX) "/ly")
- (cons (string-append (getenv 'LILYPONDPREFIX) "/ps")
+ (cons (string-append (getenv "LILYPOND_DATADIR") "/ly")
+ (cons (string-append (getenv "LILYPOND_DATADIR") "/ps")
%load-path)))
(let ((path (%search-load-path name)))
(if path
;; argv0 relocation -- do in wrapper?
-(define LILYPONDPREFIX
+(define LILYPOND_DATADIR
(let* ((prefix
- (or (getenv "LILYPONDPREFIX")
+ (or (getenv "LILYPOND_DATADIR")
(dirname (dirname (car (command-line)))))))
(begin
(show-help (current-error-port))
(exit 2)))
- (set! %load-path (cons LILYPONDPREFIX %load-path))
+ (set! %load-path (cons LILYPOND_DATADIR %load-path))
(primitive-eval '(use-modules (scm editor)))