Mercurial > gub
annotate sourcefiles/sharhead.sh @ 6465:45335e3c7ffd
sharhead: nicer workaround for pixbuf segfault.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Tue, 01 Feb 2011 15:19:56 +0100 |
parents | e967dbafa96f |
children | c35f79f2d05a |
rev | line source |
---|---|
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
1 #! /bin/sh |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
2 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
3 # FIXME: copy from lilypond-sharhead, lilypond stuff commented-out |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
4 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
5 me="$0" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
6 root="$HOME" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
7 doc=no |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
8 extract=no |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
9 interactive=yes |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
10 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
11 if test `id -u` = "0"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
12 root=/usr/local |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
13 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
14 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
15 while test -n "$1"; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
16 do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
17 case "$1" in |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
18 --help) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
19 cat <<EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
20 $me - install %(pretty_name)s tarball |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
21 Options |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
22 --batch no interaction |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
23 --doc [attempt to] download and install documentation |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
24 --prefix PREFIX install into PREFIX/%(name)s (default: ${root}) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
25 --help this help |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
26 --tarball extract tar file for archive |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
27 EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
28 exit 0 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
29 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
30 --tarball) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
31 extract=yes |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
32 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
33 --prefix*) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
34 root=`echo "$1" | sed -e 's/.*=//g' -e 's/--prefix//g'` |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
35 if test -z "${root}"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
36 shift |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
37 root="$1" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
38 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
39 if test -z "${root}"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
40 echo 'Option --prefix requires argument.' |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
41 exit 1 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
42 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
43 if test ! -d "${root}"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
44 mkdir -p "${root}" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
45 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
46 root=`cd ${root}; pwd` |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
47 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
48 --batch) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
49 interactive=no |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
50 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
51 --doc*) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
52 doc=yes |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
53 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
54 *) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
55 echo Unknown option: $1 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
56 exit 2 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
57 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
58 esac |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
59 shift |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
60 done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
61 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
62 |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
63 cat <<EOF |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
64 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
65 %(name)s installer for version %(version)s release %(release)s. |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
66 Use --help for help |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
67 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
68 EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
69 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
70 if test "$extract" = "yes"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
71 echo "extracting %(base_file)s" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
72 tail -c+%(header_length)012d $0 > %(base_file)s |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
73 exit 0 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
74 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
75 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
76 if test "$interactive" = "yes"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
77 cat <<EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
78 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
79 You are about to install %(pretty_name)s in ${root}/%(name)s |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
80 A script in ${root}/bin will be created as a shortcut. |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
81 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
82 Press ^C to abort, or Enter to proceed. |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
83 EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
84 read junk |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
85 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
86 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
87 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
88 prefix="${root}/%(name)s" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
89 bindir="${root}/bin" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
90 binwrapscript="${bindir}/%(name)s" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
91 uninstall_script="${bindir}/uninstall-%(name)s" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
92 expandargs='"$@"' |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
93 dollar='$' |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
94 backquote='`' |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
95 binaries=%(name)s |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
96 EOF=EOF |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
97 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
98 if test -d "${prefix}"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
99 echo "Directory ${prefix} already exists." |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
100 echo "Remove old %(name)s installations before installing this one." |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
101 if test -x "$uninstall_script"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
102 echo "Run $uninstall_script to uninstall previous version." |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
103 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
104 exit 1 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
105 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
106 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
107 for d in "${prefix}" "${bindir}"; do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
108 if test ! -d "$d"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
109 echo Making "$d" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
110 mkdir -p "$d" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
111 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
112 done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
113 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
114 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
115 ################ |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
116 ## Wrappers |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
117 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
118 echo Creating script $binwrapscript |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
119 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
120 ## LD_LIBRARY_PATH is necessary for ao. FreeBSD. |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
121 rm -f "$binwrapscript" > /dev/null 2>&1 |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
122 ##lily##cat <<EOF > "$binwrapscript" |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
123 ##lily###! /bin/sh |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
124 ##lily##INSTALLER_PREFIX=${dollar}{prefix}/usr |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
125 ##lily##me=${backquote}basename ${dollar}0${backquote} |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
126 ##lily##export LD_LIBRARY_PATH="${dollar}{INSTALLER_PREFIX}/lib" |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
127 ##lily##exec "${dollar}{INSTALLER_PREFIX}/bin/${dollar}me" $expandargs |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
128 ##lily##EOF |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
129 |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
130 cat <<EOF > "$binwrapscript" |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
131 #! /bin/sh |
5326
38b673b6ace5
Replace "inkscape" with %(name)s for sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5078
diff
changeset
|
132 # relocate script for [gtk+ programs like] denemo, inkscape |
4953
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
133 # See http://www.gtk.org/api/2.6/gtk/gtk-running.html |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
134 |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
135 INSTALLER_PREFIX=${prefix}/usr |
5326
38b673b6ace5
Replace "inkscape" with %(name)s for sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5078
diff
changeset
|
136 ENV=${dollar}HOME/.%(name)s.env |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
137 |
5078
1c6a95375a52
sharhead: sed compatibility and $EOF bug.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4953
diff
changeset
|
138 cat > ${dollar}ENV <<$EOF |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
139 INSTALLER_PREFIX=${prefix}/usr |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
140 if test -d ${dollar}INSTALLER_PREFIX/lib/gtk-2.0/2.10.0/loaders; then |
6038
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
141 export GIO_MODULE_DIR=${dollar}INSTALLER_PREFIX/lib/gio/modules |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
142 export GDK_PIXBUF_MODULEDIR=${dollar}INSTALLER_PREFIX/lib/gtk-2.0/2.10.0/loaders |
6465
45335e3c7ffd
sharhead: nicer workaround for pixbuf segfault.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6064
diff
changeset
|
143 export GDK_PIXBUF_MODULE_FILE=${dollar}INSTALLER_PREFIX/etc/gtk-2.0/gdk-pixbuf.loaders |
4953
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
144 export GTK_DATA_PREFIX=${dollar}INSTALLER_PREFIX/lib/gtk-2.0 |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
145 export GTK_EXE_PREFIX=${dollar}INSTALLER_PREFIX |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
146 export GTK_IM_MODULE_FILE=${dollar}INSTALLER_PREFIX/etc/gtk-2.0/gtk.immodules |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
147 export GTK_PATH=${dollar}INSTALLER_PREFIX/lib/gtk-2.0 |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
148 export GTK_SYSCONFDIR=${dollar}INSTALLER_PREFIX/etc |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
149 fi |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
150 export LD_LIBRARY_PATH="${dollar}{INSTALLER_PREFIX}/lib" |
5078
1c6a95375a52
sharhead: sed compatibility and $EOF bug.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4953
diff
changeset
|
151 $EOF |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
152 |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
153 for file in ${dollar}INSTALLER_PREFIX/etc/relocate/*.reloc; do |
6026
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
154 cat ${dollar}file \ |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
155 | while read line; do |
6026
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
156 case ${dollar}line in |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
157 set*) |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
158 echo ${dollar}line | sed -e 's/^[^ ]* /export /' >> ${dollar}ENV |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
159 ;; |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
160 prepend*) |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
161 var=${dollar}(expr "${dollar}line" : "^[^ ]* \([^ =]*\)=") |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
162 echo ${dollar}line | sed -e 's/^[^ ]* /export /' -e 's/ *\([^:]\)$/\1:$'"${dollar}var/" >> ${dollar}ENV |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
163 ;; |
733c073b5aa0
Fix gtk sharhead prependdir: actually prepend iso junking old value.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
5326
diff
changeset
|
164 esac |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
165 done |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
166 done |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
167 |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
168 . ${dollar}ENV |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
169 |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
170 if test -d "${dollar}GDK_PIXBUF_MODULEDIR" -a ! -f "${dollar}GDK_PIXBUF_MODULE_FILE"; then |
6465
45335e3c7ffd
sharhead: nicer workaround for pixbuf segfault.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6064
diff
changeset
|
171 ${dollar}INSTALLER_PREFIX/bin/gdk-pixbuf-query-loaders > ${dollar}GDK_PIXBUF_MODULE_FILE.segfault |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
172 fi |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
173 |
4953
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
174 if test -d "${dollar}GTK_PATH" -a ! -f "${dollar}GTK_IM_MODULE_FILE"; then |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
175 ${dollar}INSTALLER_PREFIX/bin/gtk-query-immodules-2.0 > ${dollar}GTK_IM_MODULE_FILE |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
176 fi |
309084be1c6f
GTK sharhead relocation update.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4946
diff
changeset
|
177 |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
178 me=${backquote}basename ${dollar}0${backquote} |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
179 exec "${dollar}{INSTALLER_PREFIX}/bin/${dollar}me" $expandargs |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
180 EOF |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
181 |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
182 chmod +x "$binwrapscript" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
183 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
184 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
185 ##################### |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
186 ### LilyPond wrappers |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
187 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
188 ##lily##wrapscript="${bindir}/%(name)s-wrapper" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
189 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
190 ##lily##for interp in python guile; do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
191 ##lily## echo "Creating script $wrapscript.$interp" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
192 ##lily## |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
193 ##lily## if test "$interp" = "guile"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
194 ##lily## callmain="-e main" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
195 ##lily## else |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
196 ##lily## callmain="" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
197 ##lily## fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
198 ##lily## |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
199 ##lily## rm -f "$wrapscript.$interp" > /dev/null 2>&1 |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
200 ##lily## cat <<EOF > "$wrapscript.$interp" |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
201 ##lily###!/bin/sh |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
202 ##lily##export PYTHONPATH="${prefix}/usr/lib/lilypond/current/python:${prefix}/usr/share/lilypond/current/python:${dollar}PYTHONPATH" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
203 ##lily##export GUILE_LOAD_PATH="${prefix}/usr/share/lilypond/current" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
204 ##lily##export LD_LIBRARY_PATH="${prefix}/usr/lib:${dollar}LD_LIBRARY_PATH" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
205 ##lily##me=${backquote}basename ${dollar}0${backquote} |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
206 ##lily##exec "${prefix}/usr/bin/$interp" ${callmain} "${prefix}/usr/bin/${dollar}me" $expandargs |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
207 ##lily##EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
208 ##lily## chmod +x "$wrapscript.$interp" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
209 ##lily##done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
210 ##lily## |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
211 ####################### |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
212 ## symlinks to wrappers |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
213 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
214 ##lily##(cd ${bindir}; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
215 ##lily## for a in abc2ly musicxml2ly convert-ly midi2ly etf2ly lilypond-book mup2ly; do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
216 ##lily## rm -f $a; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
217 ##lily## ln -s $wrapscript.python $a; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
218 ##lily## binaries="$binaries $a" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
219 ##lily## done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
220 ##lily## for a in lilypond-invoke-editor; do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
221 ##lily## rm -f $a; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
222 ##lily## ln -s $wrapscript.guile $a; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
223 ##lily## binaries="$binaries $a" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
224 ##lily## done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
225 ##lily##) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
226 |
6038
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
227 ## fontconfig lily fonts |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
228 mkdir -p ${prefix}/usr/etc/fonts/conf.d |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
229 cat <<EOF > ${prefix}/usr/etc/fonts/conf.d/00-lilypond.conf |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
230 <?xml version="1.0"?> |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
231 <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
232 <fontconfig> |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
233 <dir>${prefix}/usr/share/lilypond/current/fonts/otf</dir> |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
234 </fontconfig> |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
235 EOF |
5a02207e3dbc
sharheads: set lily fontconfig fonts. Fixes ootb schikkers-list usage.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
6026
diff
changeset
|
236 |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
237 ################### |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
238 ## uninstall script |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
239 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
240 echo Creating script $uninstall_script |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
241 cat <<EOF > $uninstall_script |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
242 #! /bin/sh |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
243 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
244 quiet=no |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
245 while test -n "${dollar}1"; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
246 do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
247 case "${dollar}1" in |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
248 --help) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
249 cat <<BLA |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
250 options |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
251 --help this help |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
252 --quiet do not ask for confirmation |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
253 BLA |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
254 exit 0 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
255 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
256 --quiet) |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
257 quiet=yes |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
258 ;; |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
259 esac |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
260 shift |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
261 done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
262 if test "${dollar}quiet" = "no"; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
263 echo "About to remove a %(name)s installation from ${prefix}" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
264 echo "Press ^C to abort, Enter to proceed" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
265 read junk |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
266 fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
267 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
268 for binary in ${binaries}; do |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
269 rm ${bindir}/${dollar}binary |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
270 done |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
271 rm -f $wrapscript.guile $wrapscript.python |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
272 rm -rf ${prefix} |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
273 rm $uninstall_script |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
274 EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
275 chmod +x $uninstall_script |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
276 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
277 echo Untarring "$me" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
278 tail -c+%(header_length)012d "$0" | tar -C "${prefix}" %(_z)s -xf - |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
279 |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
280 documentation="http://%(name)s.org/doc" |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
281 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
282 ##lily##mirror="http://lilypond.org/download" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
283 ##lily##doc_url_base="$mirror/binaries/documentation" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
284 ##lily##if test "$doc" = yes; then |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
285 ##lily## documentation="file://${prefix}/usr/share/doc/lilypond/html/index.html |
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
286 ##lily## file://${prefix}/usr/share/info/dir" |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
287 ##lily## docball=`echo $me | sed -e 's/[.][^.]\+[.]sh/.documentation.tar.bz2/'` |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
288 ##lily## doc_url="$doc_url_base/$docball" |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
289 ##lily## if ! test -e $docball; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
290 ##lily## echo "No ./$docball found, downloading." |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
291 ##lily## wget $doc_url |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
292 ##lily## fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
293 ##lily## if test -e $docball; then |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
294 ##lily## echo Untarring "$docball" |
4946
13a7635fe38b
Add gtk+/non-lilypond relocation script to sharheads.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
4939
diff
changeset
|
295 ##lily## tar -C ${prefix}/usr -xjf $docball |
4939
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
296 ##lily## fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
297 ##lily##fi |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
298 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
299 cat <<EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
300 To uninstall %(name)s, run |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
301 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
302 ${root}/bin/uninstall-%(name)s |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
303 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
304 For license and warranty information, consult |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
305 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
306 ${prefix}/license/README |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
307 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
308 Full documentation can be found at |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
309 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
310 $documentation |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
311 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
312 EOF |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
313 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
314 ## need this because binary data starts after this. |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
315 exit 0 |
ba26b16248c3
Refactor sharhead a bit and add generic sharhead based on lilypond-sharhead.
Jan Nieuwenhuizen <janneke@gnu.org>
parents:
diff
changeset
|
316 ## END of script |