author | wenzelm |
Sun, 12 Apr 2015 12:45:06 +0200 | |
changeset 60031 | 9cecf02bf65b |
parent 58792 | d6d9bb806bb5 |
child 60994 | b1e324a0677c |
permissions | -rwxr-xr-x |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
1 |
#!/usr/bin/env bash |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
2 |
# |
50790 | 3 |
# DESCRIPTION: re-package Isabelle distribution with add-on components |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
4 |
|
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
5 |
## diagnostics |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
6 |
|
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
7 |
PRG=$(basename "$0") |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
8 |
|
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
9 |
function usage() |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
10 |
{ |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
11 |
echo |
51064
9c425ed4a52c
separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents:
50961
diff
changeset
|
12 |
echo "Usage: isabelle $PRG ARCHIVE PLATFORM_FAMILY" |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
13 |
echo |
37315 | 14 |
echo " Re-package Isabelle source distribution with add-on components" |
51064
9c425ed4a52c
separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents:
50961
diff
changeset
|
15 |
echo " and post-hoc patches for platform family linux, macos, windows." |
50790 | 16 |
echo |
17 |
echo " Add-on components are that of the running Isabelle version!" |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
18 |
echo |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
19 |
exit 1 |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
20 |
} |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
21 |
|
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
22 |
function fail() |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
23 |
{ |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
24 |
echo "$1" >&2 |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
25 |
exit 2 |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
26 |
} |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
27 |
|
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
28 |
|
50790 | 29 |
## arguments |
30 |
||
51064
9c425ed4a52c
separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents:
50961
diff
changeset
|
31 |
[ "$#" -ne 2 ] && usage |
50790 | 32 |
|
33 |
ARCHIVE="$1"; shift |
|
51064
9c425ed4a52c
separate makedist_bundle for each platform family, which is more useful for manual use;
wenzelm
parents:
50961
diff
changeset
|
34 |
PLATFORM_FAMILY="$1"; shift |
50790 | 35 |
|
36 |
[ -f "$ARCHIVE" ] || fail "Bad source archive: $ARCHIVE" |
|
37 |
||
38 |
ARCHIVE_DIR="$(cd $(dirname "$ARCHIVE"); echo "$PWD")" |
|
39 |
ISABELLE_NAME="$(basename "$ARCHIVE" .tar.gz)" |
|
40 |
||
41 |
||
42 |
## main |
|
43 |
||
50794 | 44 |
TMP="/var/tmp/isabelle-makedist$$" |
37315 | 45 |
mkdir "$TMP" || fail "Cannot create directory $TMP" |
46 |
||
50790 | 47 |
ISABELLE_TARGET="$TMP/$ISABELLE_NAME" |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
48 |
|
53418 | 49 |
tar -C "$TMP" -x -z -f "$ARCHIVE" || exit 2 |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
50 |
|
37315 | 51 |
|
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
52 |
# distribution classpath (based on educated guesses) |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
53 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
54 |
splitarray ":" "$ISABELLE_CLASSPATH"; CLASSPATH_ENTRIES=("${SPLITARRAY[@]}") |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
55 |
declare -a DISTRIBITION_CLASSPATH=() |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
56 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
57 |
for ENTRY in "${CLASSPATH_ENTRIES[@]}" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
58 |
do |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
59 |
ENTRY=$(echo "$ENTRY" | perl -n -e " |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
60 |
if (m,$ISABELLE_HOME/(.*)\$,) { print qq{\$1}; } |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
61 |
elsif (m,$USER_HOME/.isabelle/contrib/(.*)\$,) { print qq{contrib/\$1}; } |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
62 |
else { print; }; |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
63 |
print qq{\n};") |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
64 |
DISTRIBITION_CLASSPATH["${#DISTRIBITION_CLASSPATH[@]}"]="$ENTRY" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
65 |
done |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
66 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
67 |
DISTRIBITION_CLASSPATH["${#DISTRIBITION_CLASSPATH[@]}"]="src/Tools/jEdit/dist/jedit.jar" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
68 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
69 |
echo "classpath" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
70 |
for ENTRY in "${DISTRIBITION_CLASSPATH[@]}" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
71 |
do |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
72 |
echo " $ENTRY" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
73 |
done |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
74 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
75 |
|
50790 | 76 |
# bundled components |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
77 |
|
53485
a837df2ceee5
override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents:
53484
diff
changeset
|
78 |
init_component "$JEDIT_HOME" |
a837df2ceee5
override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents:
53484
diff
changeset
|
79 |
|
50790 | 80 |
mkdir -p "$ARCHIVE_DIR/contrib" |
81 |
||
82 |
echo "#bundled components" >> "$ISABELLE_TARGET/etc/components" |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
83 |
|
50812 | 84 |
for CATALOG in main "$PLATFORM_FAMILY" bundled "bundled-$PLATFORM_FAMILY" |
50790 | 85 |
do |
86 |
CATALOG_FILE="$ISABELLE_HOME/Admin/components/$CATALOG" |
|
87 |
if [ -f "$CATALOG_FILE" ] |
|
88 |
then |
|
89 |
echo "catalog ${CATALOG}" |
|
90 |
{ |
|
91 |
while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } |
|
92 |
do |
|
93 |
case "$REPLY" in |
|
94 |
\#* | "") ;; |
|
95 |
*) |
|
96 |
COMPONENT="$REPLY" |
|
50891
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
97 |
COMPONENT_DIR="$ISABELLE_TARGET/contrib/$COMPONENT" |
50790 | 98 |
case "$COMPONENT" in |
57443
577f029fde39
ProofGeneral-4.2-2 is optional component (including the traditional helper scripts);
wenzelm
parents:
57084
diff
changeset
|
99 |
jedit_build*) ;; |
50790 | 100 |
*) |
101 |
echo " component $COMPONENT" |
|
102 |
CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz" |
|
103 |
if [ ! -f "$CONTRIB" ]; then |
|
104 |
REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz" |
|
105 |
echo " download $REMOTE" |
|
106 |
perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB" |
|
107 |
perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2 |
|
108 |
fi |
|
109 |
||
53418 | 110 |
tar -C "$ISABELLE_TARGET/contrib" -x -z -f "$CONTRIB" || exit 2 |
50891
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
111 |
if [ -f "$COMPONENT_DIR/etc/settings" -o -f "$COMPONENT_DIR/etc/components" ] |
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
112 |
then |
53418 | 113 |
case "$COMPONENT" in |
114 |
jdk-*) |
|
115 |
mv "$ISABELLE_TARGET/contrib/$COMPONENT" "$ISABELLE_TARGET/contrib/jdk" |
|
116 |
echo "contrib/jdk" >> "$ISABELLE_TARGET/etc/components" |
|
117 |
;; |
|
118 |
*) |
|
119 |
echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components" |
|
120 |
;; |
|
121 |
esac |
|
50891
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
122 |
fi |
50790 | 123 |
;; |
124 |
esac |
|
125 |
;; |
|
126 |
esac |
|
127 |
done |
|
128 |
} < "$CATALOG_FILE" |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
129 |
fi |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
130 |
done |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
131 |
|
47742
316c67657fd3
move polyml within Cygwin /usr/local to simplify its rebasing;
wenzelm
parents:
47723
diff
changeset
|
132 |
|
52501 | 133 |
# purge other platforms |
134 |
||
135 |
function purge_contrib |
|
136 |
{ |
|
137 |
( |
|
138 |
cd "$ISABELLE_TARGET" |
|
139 |
for DIR in $(eval find contrib "$@" | sort) |
|
140 |
do |
|
141 |
echo "removing $DIR" |
|
142 |
rm -rf "$DIR" |
|
143 |
done |
|
144 |
) |
|
145 |
} |
|
146 |
||
147 |
||
58792
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
148 |
# purge jdk -- keep only jre |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
149 |
|
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
150 |
function purge_jdk |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
151 |
{ |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
152 |
local DIR="contrib/jdk/$1" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
153 |
( |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
154 |
cd "$ISABELLE_TARGET" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
155 |
if [ -d "$DIR/jre" ]; then |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
156 |
for X in "$DIR"/* |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
157 |
do |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
158 |
case "$X" in |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
159 |
*/jre) ;; |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
160 |
*) |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
161 |
echo "removing $X" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
162 |
rm -rf "$X" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
163 |
;; |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
164 |
esac |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
165 |
done |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
166 |
else |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
167 |
fail "Bad JDK directory: \"$DIR\"" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
168 |
fi |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
169 |
) |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
170 |
} |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
171 |
|
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
172 |
|
53483
74a4685a96c8
generate application based on $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53473
diff
changeset
|
173 |
# platform-specific setup (inside archive) |
47833
12cb7b5d4b77
more windows-friendly presentation of main text files;
wenzelm
parents:
47760
diff
changeset
|
174 |
|
54661
6ad5242deaa7
specific application name for official bundle (as for Mac OS X);
wenzelm
parents:
54315
diff
changeset
|
175 |
perl -pi -e "s,view.title=Isabelle/jEdit,view.title=${ISABELLE_NAME},g;" \ |
6ad5242deaa7
specific application name for official bundle (as for Mac OS X);
wenzelm
parents:
54315
diff
changeset
|
176 |
"$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props" |
6ad5242deaa7
specific application name for official bundle (as for Mac OS X);
wenzelm
parents:
54315
diff
changeset
|
177 |
|
50790 | 178 |
case "$PLATFORM_FAMILY" in |
179 |
linux) |
|
52501 | 180 |
purge_contrib '-name "x86*-darwin" -o -name "x86*-cygwin" -o -name "x86*-windows"' |
58792
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
181 |
purge_jdk "x86-linux" |
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
182 |
purge_jdk "x86_64-linux" |
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
183 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
184 |
LINUX_CLASSPATH="" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
185 |
for ENTRY in "${DISTRIBITION_CLASSPATH[@]}" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
186 |
do |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
187 |
if [ -z "$LINUX_CLASSPATH" ]; then |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
188 |
LINUX_CLASSPATH="\\\$ISABELLE_HOME/$ENTRY" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
189 |
else |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
190 |
LINUX_CLASSPATH="$LINUX_CLASSPATH:\\\$ISABELLE_HOME/$ENTRY" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
191 |
fi |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
192 |
done |
54315 | 193 |
cat "$ISABELLE_HOME/Admin/Linux/Isabelle.run" | \ |
194 |
perl -p > "$ISABELLE_TARGET/${ISABELLE_NAME}.run" \ |
|
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
195 |
-e "s,{JAVA_ARGS},$JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS,g; s,{CLASSPATH},$LINUX_CLASSPATH,;" |
54315 | 196 |
chmod +x "$ISABELLE_TARGET/${ISABELLE_NAME}.run" |
197 |
||
198 |
mv "$ISABELLE_TARGET/contrib/linux_app" "$TMP/." |
|
199 |
cp "$TMP/linux_app/Isabelle" "$ISABELLE_TARGET/$ISABELLE_NAME" |
|
44951
3aa3aeb4980f
specific bundle for x86_64-linux, which is especially important for JRE due to its extra library dependencies;
wenzelm
parents:
44807
diff
changeset
|
200 |
;; |
50790 | 201 |
macos) |
52501 | 202 |
purge_contrib '-name "x86*-linux" -o -name "x86*-cygwin" -o -name "x86*-windows"' |
58792
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
203 |
purge_jdk "x86_64-darwin/Contents/Home" |
52677 | 204 |
mv "$ISABELLE_TARGET/contrib/macos_app" "$TMP/." |
50798 | 205 |
|
53883
f1c5f857df3d
include MacOSX plugin by default -- disabled by default to avoid multiplatform confusion;
wenzelm
parents:
53581
diff
changeset
|
206 |
perl -pi \ |
53936 | 207 |
-e 's,\Qaction-bar.shortcut=C+ENTER\E,action-bar.shortcut=\naction-bar.shortcut2=C+ENTER,g;' \ |
53883
f1c5f857df3d
include MacOSX plugin by default -- disabled by default to avoid multiplatform confusion;
wenzelm
parents:
53581
diff
changeset
|
208 |
-e "s,lookAndFeel=.*,lookAndFeel=com.apple.laf.AquaLookAndFeel,g;" \ |
44964 | 209 |
-e "s,delete-line.shortcut=.*,delete-line.shortcut=C+d,g;" \ |
210 |
-e "s,delete.shortcut2=.*,delete.shortcut2=A+d,g;" \ |
|
53883
f1c5f857df3d
include MacOSX plugin by default -- disabled by default to avoid multiplatform confusion;
wenzelm
parents:
53581
diff
changeset
|
211 |
-e "s,plugin-blacklist.MacOSX.jar=true,plugin-blacklist.MacOSX.jar=,g;" \ |
53463 | 212 |
"$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props" |
44807 | 213 |
;; |
50790 | 214 |
windows) |
52501 | 215 |
purge_contrib '-name "x86*-linux" -o -name "x86*-darwin"' |
58792
d6d9bb806bb5
JRE is sufficient for official release -- javac and jar are only needed for self-build;
wenzelm
parents:
58760
diff
changeset
|
216 |
purge_jdk "x86-cygwin" |
52677 | 217 |
mv "$ISABELLE_TARGET/contrib/windows_app" "$TMP/." |
50790 | 218 |
|
58760 | 219 |
perl -pi \ |
220 |
-e "s,lookAndFeel=.*,lookAndFeel=com.sun.java.swing.plaf.windows.WindowsLookAndFeel,g;" \ |
|
221 |
-e "s,foldPainter=.*,foldPainter=Square,g;" \ |
|
53463 | 222 |
"$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props" |
50790 | 223 |
|
53484
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
224 |
( |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
225 |
cat "$ISABELLE_HOME/Admin/Windows/WinRun4J/Isabelle.ini" |
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
226 |
|
53484
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
227 |
declare -a JAVA_ARGS=() |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
228 |
eval "JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)" |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
229 |
A=2 |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
230 |
for ARG in "${JAVA_ARGS[@]}" |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
231 |
do |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
232 |
echo -e "vmarg.$A=$ARG\r" |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
233 |
A=$[ $A + 1 ] |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
234 |
done |
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
235 |
|
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
236 |
A=1 |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
237 |
for ENTRY in "${DISTRIBITION_CLASSPATH[@]}" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
238 |
do |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
239 |
ENTRY=$(echo "$ENTRY" | perl -p -e 's,/,\\\\,g;') |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
240 |
echo -e "classpath.$A=$ENTRY\r" |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
241 |
A=$[ $A + 1 ] |
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
242 |
done |
53484
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
243 |
) > "$ISABELLE_TARGET/${ISABELLE_NAME}.ini" |
1100982a071c
generate application ini based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53483
diff
changeset
|
244 |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
245 |
cp "$TMP/windows_app/Isabelle.exe" "$ISABELLE_TARGET/${ISABELLE_NAME}.exe" |
57871
be1bcec13663
application manifest for Windows 8/8.1 dpi scaling;
wenzelm
parents:
57682
diff
changeset
|
246 |
cp "$ISABELLE_HOME/Admin/Windows/WinRun4J/manifest.xml" "$ISABELLE_TARGET/${ISABELLE_NAME}.exe.manifest" |
53473 | 247 |
cp "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Setup.bat" \ |
50810
76967aa4fe84
outermost directory structure for Windows/Cygwin;
wenzelm
parents:
50798
diff
changeset
|
248 |
"$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Terminal.bat" "$ISABELLE_TARGET" |
50790 | 249 |
|
52501 | 250 |
( |
251 |
cd "$ISABELLE_TARGET" |
|
252 |
||
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
253 |
for NAME in postinstall rebaseall |
52501 | 254 |
do |
255 |
cp -a "$ISABELLE_HOME/Admin/Windows/Cygwin/isabelle/$NAME" \ |
|
256 |
"contrib/cygwin/isabelle/." |
|
257 |
done |
|
258 |
||
52561 | 259 |
find . -type f -not -name '*.exe' -not -name '*.dll' -perm +100 \ |
260 |
-print0 > "contrib/cygwin/isabelle/executables" |
|
52501 | 261 |
|
52668
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
262 |
find . -type l -exec echo "{}" ";" -exec readlink "{}" ";" \ |
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
263 |
> "contrib/cygwin/isabelle/symlinks" |
53421 | 264 |
|
265 |
touch "contrib/cygwin/isabelle/uninitialized" |
|
52501 | 266 |
) |
41627
0040e0ea02e7
delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents:
41611
diff
changeset
|
267 |
;; |
0040e0ea02e7
delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents:
41611
diff
changeset
|
268 |
*) |
0040e0ea02e7
delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents:
41611
diff
changeset
|
269 |
;; |
0040e0ea02e7
delete compiled .elc files to improve portability on Linux, notably for GNU Emacs 23.1.x instead of 23.2.x;
wenzelm
parents:
41611
diff
changeset
|
270 |
esac |
41611
f23ce44fbaec
Cygwin: back to ProofGeneral-3.7.1.1 with XEmacs, since PG 4.x with GNU Emacs 23 is painfully slow;
wenzelm
parents:
41555
diff
changeset
|
271 |
|
50798 | 272 |
|
273 |
# archive |
|
274 |
||
275 |
BUNDLE_ARCHIVE="${ARCHIVE_DIR}/${ISABELLE_NAME}_${PLATFORM_FAMILY}.tar.gz" |
|
37315 | 276 |
|
50790 | 277 |
echo "packaging $(basename "$BUNDLE_ARCHIVE")" |
50899
506ff6abfde0
grand-unified Admin/Release/build script (excluding .app and .exe);
wenzelm
parents:
50892
diff
changeset
|
278 |
tar -C "$TMP" -c -z -f "$BUNDLE_ARCHIVE" "$ISABELLE_NAME" || exit 2 |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
279 |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
280 |
|
53483
74a4685a96c8
generate application based on $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53473
diff
changeset
|
281 |
# platform-specific setup (outside archive) |
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
282 |
|
52677 | 283 |
if [ "$ISABELLE_PLATFORM_FAMILY" = linux -a "$PLATFORM_FAMILY" != macos -o "$ISABELLE_PLATFORM_FAMILY" = macos ] |
52668
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
284 |
then |
52677 | 285 |
case "$PLATFORM_FAMILY" in |
286 |
macos) |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
287 |
echo "application for $PLATFORM_FAMILY" |
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
288 |
( |
52677 | 289 |
cd "$TMP" |
290 |
||
54392 | 291 |
APP_TEMPLATE="$ISABELLE_HOME/Admin/MacOS" |
57679 | 292 |
APP="dmg/${ISABELLE_NAME}.app" |
293 |
||
294 |
mkdir -p "dmg/.background" |
|
295 |
cp "$APP_TEMPLATE/dmg/background.png" "dmg/.background/" |
|
296 |
cp "$APP_TEMPLATE/dmg/DS_Store" "dmg/.DS_Store" |
|
297 |
ln -s /Applications "dmg/." |
|
52677 | 298 |
|
299 |
for NAME in Java MacOS PlugIns Resources |
|
300 |
do |
|
301 |
mkdir -p "$APP/Contents/$NAME" |
|
302 |
done |
|
303 |
||
53488
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
304 |
( |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
305 |
cat "$APP_TEMPLATE/Info.plist-part1" |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
306 |
|
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
307 |
declare -a OPTIONS=() |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
308 |
eval "OPTIONS=($ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS)" |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
309 |
for OPT in "${OPTIONS[@]}" |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
310 |
do |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
311 |
echo "<string>$OPT</string>" |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
312 |
done |
53489 | 313 |
echo "<string>-Dapple.awt.application.name={ISABELLE_NAME}</string>" |
53488
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
314 |
|
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
315 |
cat "$APP_TEMPLATE/Info.plist-part2" |
009d3bcf6907
generate application Info.plist based on $ISABELLE_JAVA_SYSTEM_OPTIONS $JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS at build time (see also lib/Tools/java and src/Tools/jEdit/lib/Tools/jedit);
wenzelm
parents:
53485
diff
changeset
|
316 |
) | perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;" > "$APP/Contents/Info.plist" |
52677 | 317 |
|
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
318 |
for ENTRY in "${DISTRIBITION_CLASSPATH[@]}" |
52677 | 319 |
do |
53581
c0ad478abf50
generate distribution classpath for cold-start application wrappers;
wenzelm
parents:
53489
diff
changeset
|
320 |
ln -sf "../Resources/${ISABELLE_NAME}/$ENTRY" "$APP/Contents/Java" |
52677 | 321 |
done |
322 |
||
323 |
cp -R "$APP_TEMPLATE/Resources/." "$APP/Contents/Resources/." |
|
324 |
||
53418 | 325 |
ln -sf "../Resources/${ISABELLE_NAME}/contrib/jdk/x86_64-darwin" \ |
52677 | 326 |
"$APP/Contents/PlugIns/jdk" |
327 |
||
328 |
cp macos_app/JavaAppLauncher "$APP/Contents/MacOS/." && \ |
|
329 |
chmod +x "$APP/Contents/MacOS/JavaAppLauncher" |
|
330 |
||
331 |
mv "$ISABELLE_NAME" "$APP/Contents/Resources/." |
|
332 |
ln -sf "Contents/Resources/$ISABELLE_NAME" "$APP/Isabelle" |
|
333 |
||
52678 | 334 |
rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg" |
57679 | 335 |
|
336 |
cd dmg |
|
57682
648c5ef4876d
proper volume name, such that background image is found in /Volumes/Isabelle/.background;
wenzelm
parents:
57679
diff
changeset
|
337 |
hdiutil create -srcfolder . -volname Isabelle "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg" |
52677 | 338 |
) |
339 |
;; |
|
340 |
windows) |
|
341 |
( |
|
342 |
cd "$TMP" |
|
343 |
rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.7z" |
|
344 |
7z -y -bd a "$TMP/${ISABELLE_NAME}.7z" "$ISABELLE_NAME" || exit 2 |
|
345 |
||
346 |
echo "application for $PLATFORM_FAMILY" |
|
347 |
( |
|
348 |
cat "windows_app/7zsd_All.sfx" |
|
349 |
cat "$ISABELLE_HOME/Admin/Windows/Installer/sfx.txt" | \ |
|
350 |
perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;" |
|
351 |
cat "$TMP/${ISABELLE_NAME}.7z" |
|
352 |
) > "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe" |
|
353 |
chmod +x "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe" |
|
354 |
) |
|
355 |
;; |
|
356 |
*) |
|
357 |
;; |
|
358 |
esac |
|
359 |
else |
|
360 |
echo "### Cannot build application for $PLATFORM_FAMILY on $ISABELLE_PLATFORM_FAMILY" |
|
52668
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
361 |
fi |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
362 |
|
52677 | 363 |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
364 |
# clean up |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
365 |
rm -rf "$TMP" |