Relocation algorithm
LilyPond uses the following algorithm to find its data files.
-
Compute the directory where the currently executed
lilypond binary is located. Let’s call this
bindir. Set (internal) environment variable
INSTALLER_PREFIX to ‘bindir/..’ (i.e., the
parent directory of bindir).
-
Check environment variable
LILYPOND_DATADIR. If it is set,
use its value for LilyPond’s data directory, datadir.
Otherwise use either
‘$INSTALLER_PREFIX/share/lilypond/version’ (with
version being the current LilyPond version) or
‘$INSTALLER_PREFIX/share/lilypond/current’.
-
Check environment variable
LILYPOND_LOCALEDIR. If it is
set, use its value for LilyPond’s locale data directory,
localedir. Otherwise use
‘$INSTALLER_PREFIX/share/locale’.
-
Check environment variable
LILYPOND_RELOCDIR. If it is
set, use its value for the directory of LilyPond’s relocation
files, relocdir. Otherwise use
‘$INSTALLER_PREFIX/etc/relocate’.
-
If
datadir doesn’t exist, use a compile-time value instead.
Ditto for localedir (but not for relocdir, since it
doesn’t make sense to have that).
-
If
relocdir exists, process all files in this directory
(see Relocation files).