3 # Setup TeX/LaTeX Ghostscript environment for LilyPond.
5 # Red Hat-like systems should install this in /etc/profile.d/
7 # If run by hand or from you .profile, run as follows
8 # . /PATH/TO/lilypond-profile
11 # workaround for ZSH posix $0-problem
12 [ -n "$ZSH_NAME" ] && setopt nofunctionargzero
14 if [ `basename "$0"` = "lilypond-profile" ] ; then
15 cat >/dev/stderr <<EOF
17 Error: This script cannot be run in a subshell; it MUST be sourced.
20 EXAMPLE 1: One time use
28 EXAMPLE 2: Install for self
32 cp lilypond-profile $HOME/bin/
36 . $HOME/bin/lilypond-profile
38 to either $HOME/.profile or $HOME/.bash_profile,
43 EXAMPLE 3: Install for all users.
47 mv lilypond-profile /etc/profile.d/lilypond.sh
56 ## If the message above is printed erroneously,
57 ## the following commands kills the current terminal/shell.
58 ## hence the ZSH test above.
63 if [ -z "$LILYPONDPREFIX" ]; then
64 datadir=`echo "@local_lilypond_datadir@" | sed 's!//!/!g'`
66 if [ -d "$LILYPONDPREFIX/share" ]; then
67 datadir=$LILYPONDPREFIX/share/lilypond/
69 echo "Setting tree to $datadir"
72 # Add the installation directory to the teTeX system tree,
73 # see Documentation/misc/fontinstallation
74 TEXMF="{$datadir,"`kpsexpand \\$TEXMF`"}"
77 # For direct ps output: ps/lilyponddefs.ps
78 ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
81 # For direct ps output fonts. Add all available TeX Type1 fonts
82 ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}