]> git.donarmstrong.com Git - lilypond.git/blob - cygwin/postinstall-lilypond.sh
from stable
[lilypond.git] / cygwin / postinstall-lilypond.sh
1 #!@SHELL@
2 # /etc/postinstall/lilypond.sh  -- Setup LilyPond
3
4 # register .ly
5 ROOT=$(cygpath -w /)
6 [ -z "$ROOT" ] && ROOT=$(regtool get '/machine/Software/Cygnus Solutions/Cygwin/mounts v2/\\\//native')
7 [ -z "$ROOT" ] && ROOT=$(cat '/proc/registry/HKEY_LOCAL_MACHINE/Software/Cygnus Solutions/Cygwin/mounts v2/\\\//native')
8 [ -z "$ROOT" ] && ROOT='c:\cygwin'
9
10 regtool add '/root/.ly'
11 regtool set '/root/.ly/' 'LilyPond'
12 regtool set '/root/.ly/Content Type' 'text/lilypond-source'
13 regtool add '/root/LilyPond'
14 regtool set '/root/LilyPond/' 'LilyPond source'
15 regtool add '/root/LilyPond/shell'
16 regtool add '/root/LilyPond/shell/open'
17 regtool add '/root/LilyPond/shell/open/command'
18
19 # old ideas - discarded for now
20 # regtool set '/root/LilyPond/shell/open/command/' $ROOT'\bin\python /usr/bin/lily-wins %1'
21 # invoking python directly does not work
22 # regtool set '/root/LilyPond/shell/open/command/' $ROOT'\bin\run-lily-wins.bat %1'
23 # we now use generated run-lily-wins.bat in /
24 # regtool set '/root/LilyPond/shell/open/command/' $ROOT'\run-lily-wins.bat %1'
25 # the direct bash route:
26
27 # TODO: should 'open' run LilyPond?
28 #       should 'open' also start PDF viewer?
29 regtool set '/root/LilyPond/shell/open/command/' $ROOT'\bin\bash.exe --login -c '"'"'/usr/bin/lily-wins "%1"'"'"
30 regtool add '/root/LilyPond/shell/edit'
31 regtool set '/root/LilyPond/shell/edit/' '&Edit source in Notepad ...'
32 regtool add '/root/LilyPond/shell/edit/command'
33 regtool set '/root/LilyPond/shell/edit/command/' '%SystemRoot%\system32\notepad.exe %1'
34 regtool add '/root/LilyPond/shell/generate'
35 regtool set '/root/LilyPond/shell/generate/' '&Generate PDF ...'
36 regtool add '/root/LilyPond/shell/generate/command'
37 # regtool set '/root/LilyPond/shell/generate/command/' $ROOT'\bin\python /usr/bin/lily-wins %1'
38 regtool set '/root/LilyPond/shell/generate/command/' $ROOT'\bin\bash.exe --login -c '"'"'/usr/bin/lily-wins "%1"'"'"
39
40 # static run-lily-wins.bat, does not work.
41 # @echo off
42 # rem run-lily-wins.bat - Invoke /usr/bin/lily-wins from explorer
43 # rem cd %~dp0%
44 # rem bash.exe --login -c "/usr/bin/lily-wins '%1%'"
45 # rem only works in Windows NT
46 # rem %~dp0~bin\bash.exe --login -c "/usr/bin/lily-wins '%1%'"
47
48 # generate run-lily-wins.bat - not necessary: direct bash route
49 # how to handle \r\n endings? text/bin mode?
50 #cat > /run-lily-wins.bat <<EOF
51 #@echo off\r
52 #rem run-lily-wins.bat - Invoke /usr/bin/lily-wins from explorer\r
53 #$ROOT\\bin\\bash.exe --login -c "/usr/bin/lily-wins '%1%'"\r
54 #EOF
55
56 # cleanup old fonts
57 touch /tmp/.lilypond-install
58 rm $(find /var/lib/texmf /var/spool/texmf /var/cache/fonts -name 'feta*pk' -or -name 'feta*tfm' -or -name 'parmesan*pk' -or -name 'parmesan*tfm')
59 rm -f /tmp/.lilypond-install