author | wenzelm |
Mon, 09 Sep 2013 17:02:06 +0200 | |
changeset 53488 | 009d3bcf6907 |
parent 53485 | a837df2ceee5 |
child 53489 | 97222a86aec0 |
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 |
||
50863 | 44 |
export COPYFILE_DISABLE=true |
45 |
||
50794 | 46 |
TMP="/var/tmp/isabelle-makedist$$" |
37315 | 47 |
mkdir "$TMP" || fail "Cannot create directory $TMP" |
48 |
||
50790 | 49 |
ISABELLE_TARGET="$TMP/$ISABELLE_NAME" |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
50 |
|
53418 | 51 |
tar -C "$TMP" -x -z -f "$ARCHIVE" || exit 2 |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
52 |
|
37315 | 53 |
|
50790 | 54 |
# bundled components |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
55 |
|
53485
a837df2ceee5
override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents:
53484
diff
changeset
|
56 |
init_component "$JEDIT_HOME" |
a837df2ceee5
override potential changes in $ISABELLE_HOME_USER/etc/settings;
wenzelm
parents:
53484
diff
changeset
|
57 |
|
50790 | 58 |
mkdir -p "$ARCHIVE_DIR/contrib" |
59 |
||
60 |
echo "#bundled components" >> "$ISABELLE_TARGET/etc/components" |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
61 |
|
50812 | 62 |
for CATALOG in main "$PLATFORM_FAMILY" bundled "bundled-$PLATFORM_FAMILY" |
50790 | 63 |
do |
64 |
CATALOG_FILE="$ISABELLE_HOME/Admin/components/$CATALOG" |
|
65 |
if [ -f "$CATALOG_FILE" ] |
|
66 |
then |
|
67 |
echo "catalog ${CATALOG}" |
|
68 |
{ |
|
69 |
while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } |
|
70 |
do |
|
71 |
case "$REPLY" in |
|
72 |
\#* | "") ;; |
|
73 |
*) |
|
74 |
COMPONENT="$REPLY" |
|
50891
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
75 |
COMPONENT_DIR="$ISABELLE_TARGET/contrib/$COMPONENT" |
50790 | 76 |
case "$COMPONENT" in |
77 |
jedit_build*) ;; |
|
78 |
*) |
|
79 |
echo " component $COMPONENT" |
|
80 |
CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz" |
|
81 |
if [ ! -f "$CONTRIB" ]; then |
|
82 |
REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz" |
|
83 |
echo " download $REMOTE" |
|
84 |
perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB" |
|
85 |
perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2 |
|
86 |
fi |
|
87 |
||
53418 | 88 |
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
|
89 |
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
|
90 |
then |
53418 | 91 |
case "$COMPONENT" in |
92 |
jdk-*) |
|
93 |
mv "$ISABELLE_TARGET/contrib/$COMPONENT" "$ISABELLE_TARGET/contrib/jdk" |
|
94 |
echo "contrib/jdk" >> "$ISABELLE_TARGET/etc/components" |
|
95 |
;; |
|
96 |
*) |
|
97 |
echo "contrib/$COMPONENT" >> "$ISABELLE_TARGET/etc/components" |
|
98 |
;; |
|
99 |
esac |
|
50891
d1a0335b4231
do not register quasi-components, notably cygwin;
wenzelm
parents:
50863
diff
changeset
|
100 |
fi |
50790 | 101 |
;; |
102 |
esac |
|
103 |
;; |
|
104 |
esac |
|
105 |
done |
|
106 |
} < "$CATALOG_FILE" |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
107 |
fi |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
108 |
done |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
109 |
|
47742
316c67657fd3
move polyml within Cygwin /usr/local to simplify its rebasing;
wenzelm
parents:
47723
diff
changeset
|
110 |
|
52501 | 111 |
# purge other platforms |
112 |
||
113 |
function purge_contrib |
|
114 |
{ |
|
115 |
( |
|
116 |
cd "$ISABELLE_TARGET" |
|
117 |
for DIR in $(eval find contrib "$@" | sort) |
|
118 |
do |
|
119 |
echo "removing $DIR" |
|
120 |
rm -rf "$DIR" |
|
121 |
done |
|
122 |
) |
|
123 |
} |
|
124 |
||
125 |
||
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
|
126 |
# platform-specific setup (inside archive) |
47833
12cb7b5d4b77
more windows-friendly presentation of main text files;
wenzelm
parents:
47760
diff
changeset
|
127 |
|
50790 | 128 |
case "$PLATFORM_FAMILY" in |
129 |
linux) |
|
52501 | 130 |
purge_contrib '-name "x86*-darwin" -o -name "x86*-cygwin" -o -name "x86*-windows"' |
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
|
131 |
cat "$ISABELLE_HOME/Admin/Linux/Isabelle" | \ |
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
|
132 |
perl -p -e "s,{JAVA_ARGS},$JEDIT_JAVA_OPTIONS $JEDIT_SYSTEM_OPTIONS,g;" \ |
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
|
133 |
> "$ISABELLE_TARGET/$ISABELLE_NAME" |
53463 | 134 |
chmod +x "$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
|
135 |
;; |
50790 | 136 |
macos) |
52501 | 137 |
purge_contrib '-name "x86*-linux" -o -name "x86*-cygwin" -o -name "x86*-windows"' |
52677 | 138 |
mv "$ISABELLE_TARGET/contrib/macos_app" "$TMP/." |
50798 | 139 |
|
44807 | 140 |
perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.apple.laf.AquaLookAndFeel,g;" \ |
44964 | 141 |
-e "s,delete-line.shortcut=.*,delete-line.shortcut=C+d,g;" \ |
142 |
-e "s,delete.shortcut2=.*,delete.shortcut2=A+d,g;" \ |
|
53463 | 143 |
"$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props" |
44807 | 144 |
;; |
50790 | 145 |
windows) |
52501 | 146 |
purge_contrib '-name "x86*-linux" -o -name "x86*-darwin"' |
52677 | 147 |
mv "$ISABELLE_TARGET/contrib/windows_app" "$TMP/." |
50790 | 148 |
|
44807 | 149 |
perl -pi -e "s,lookAndFeel=.*,lookAndFeel=com.sun.java.swing.plaf.windows.WindowsLookAndFeel,g;" \ |
53463 | 150 |
"$ISABELLE_TARGET/src/Tools/jEdit/dist/properties/jEdit.props" |
50790 | 151 |
|
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
|
152 |
( |
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
|
153 |
cat "$ISABELLE_HOME/Admin/Windows/WinRun4J/Isabelle.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
|
154 |
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
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
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
|
160 |
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
|
161 |
done |
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
|
162 |
) > "$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
|
163 |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
164 |
cp "$TMP/windows_app/Isabelle.exe" "$ISABELLE_TARGET/${ISABELLE_NAME}.exe" |
53473 | 165 |
cp "$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Setup.bat" \ |
50961 | 166 |
"$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Latex-Setup.bat" \ |
50810
76967aa4fe84
outermost directory structure for Windows/Cygwin;
wenzelm
parents:
50798
diff
changeset
|
167 |
"$ISABELLE_HOME/Admin/Windows/Cygwin/Cygwin-Terminal.bat" "$ISABELLE_TARGET" |
50790 | 168 |
|
52501 | 169 |
( |
170 |
cd "$ISABELLE_TARGET" |
|
171 |
||
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
172 |
for NAME in postinstall rebaseall |
52501 | 173 |
do |
174 |
cp -a "$ISABELLE_HOME/Admin/Windows/Cygwin/isabelle/$NAME" \ |
|
175 |
"contrib/cygwin/isabelle/." |
|
176 |
done |
|
177 |
||
52561 | 178 |
find . -type f -not -name '*.exe' -not -name '*.dll' -perm +100 \ |
179 |
-print0 > "contrib/cygwin/isabelle/executables" |
|
52501 | 180 |
|
52668
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
181 |
find . -type l -exec echo "{}" ";" -exec readlink "{}" ";" \ |
a467a6b4376c
produce 7z archive for windows and preserve symlinks separately;
wenzelm
parents:
52561
diff
changeset
|
182 |
> "contrib/cygwin/isabelle/symlinks" |
53421 | 183 |
|
184 |
touch "contrib/cygwin/isabelle/uninitialized" |
|
52501 | 185 |
) |
50892
9a7d81d66d09
include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents:
50891
diff
changeset
|
186 |
|
9a7d81d66d09
include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents:
50891
diff
changeset
|
187 |
perl -pi -e "s,/bin/rebaseall.*,/isabelle/rebaseall,g;" \ |
9a7d81d66d09
include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents:
50891
diff
changeset
|
188 |
"$ISABELLE_TARGET/contrib/cygwin/etc/postinstall/autorebase.bat.done" |
9a7d81d66d09
include /isabelle/rebaseall in autorebaseall, which is run after installation of further packages;
wenzelm
parents:
50891
diff
changeset
|
189 |
|
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
|
190 |
;; |
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
|
191 |
*) |
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
|
192 |
;; |
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
|
193 |
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
|
194 |
|
50798 | 195 |
|
196 |
# archive |
|
197 |
||
198 |
BUNDLE_ARCHIVE="${ARCHIVE_DIR}/${ISABELLE_NAME}_${PLATFORM_FAMILY}.tar.gz" |
|
37315 | 199 |
|
50790 | 200 |
echo "packaging $(basename "$BUNDLE_ARCHIVE")" |
50899
506ff6abfde0
grand-unified Admin/Release/build script (excluding .app and .exe);
wenzelm
parents:
50892
diff
changeset
|
201 |
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
|
202 |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
203 |
|
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
|
204 |
# platform-specific setup (outside archive) |
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
205 |
|
52677 | 206 |
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
|
207 |
then |
52677 | 208 |
case "$PLATFORM_FAMILY" in |
209 |
macos) |
|
52670
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
210 |
echo "application for $PLATFORM_FAMILY" |
57a00f274130
build Windows application on the spot, using Unix tools;
wenzelm
parents:
52668
diff
changeset
|
211 |
( |
52677 | 212 |
cd "$TMP" |
213 |
||
214 |
APP_TEMPLATE="$ISABELLE_HOME/Admin/MacOS/App3" |
|
215 |
APP="${ISABELLE_NAME}.app" |
|
216 |
||
217 |
for NAME in Java MacOS PlugIns Resources |
|
218 |
do |
|
219 |
mkdir -p "$APP/Contents/$NAME" |
|
220 |
done |
|
221 |
||
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
|
222 |
( |
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
|
223 |
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
|
224 |
|
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
|
225 |
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
|
226 |
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
|
227 |
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
|
228 |
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
|
229 |
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
|
230 |
done |
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
|
231 |
|
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
|
232 |
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
|
233 |
) | perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;" > "$APP/Contents/Info.plist" |
52677 | 234 |
|
53464
b363138c269c
imitate "isabelle java" and "isabelle jedit" wrt. classpath and options (see also a221a4fdb5a0);
wenzelm
parents:
53463
diff
changeset
|
235 |
for NAME in Pure.jar scala-compiler.jar scala-library.jar scala-swing.jar scala-actors.jar scala-reflect.jar |
52677 | 236 |
do |
237 |
ln -sf "../Resources/${ISABELLE_NAME}/lib/classes/ext/$NAME" "$APP/Contents/Java" |
|
238 |
done |
|
53464
b363138c269c
imitate "isabelle java" and "isabelle jedit" wrt. classpath and options (see also a221a4fdb5a0);
wenzelm
parents:
53463
diff
changeset
|
239 |
ln -sf "../Resources/${ISABELLE_NAME}/src/Tools/jEdit/dist/jedit.jar" "$APP/Contents/Java" |
52677 | 240 |
|
241 |
cp -R "$APP_TEMPLATE/Resources/." "$APP/Contents/Resources/." |
|
242 |
cp "$APP_TEMPLATE/../isabelle.icns" "$APP/Contents/Resources/." |
|
243 |
||
53418 | 244 |
ln -sf "../Resources/${ISABELLE_NAME}/contrib/jdk/x86_64-darwin" \ |
52677 | 245 |
"$APP/Contents/PlugIns/jdk" |
246 |
||
247 |
cp macos_app/JavaAppLauncher "$APP/Contents/MacOS/." && \ |
|
248 |
chmod +x "$APP/Contents/MacOS/JavaAppLauncher" |
|
249 |
||
250 |
mv "$ISABELLE_NAME" "$APP/Contents/Resources/." |
|
251 |
ln -sf "Contents/Resources/$ISABELLE_NAME" "$APP/Isabelle" |
|
252 |
||
52678 | 253 |
rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg" |
52677 | 254 |
hdiutil create -srcfolder "$APP" "${ARCHIVE_DIR}/${ISABELLE_NAME}.dmg" |
255 |
) |
|
256 |
;; |
|
257 |
windows) |
|
258 |
( |
|
259 |
cd "$TMP" |
|
260 |
rm -f "${ARCHIVE_DIR}/${ISABELLE_NAME}.7z" |
|
261 |
7z -y -bd a "$TMP/${ISABELLE_NAME}.7z" "$ISABELLE_NAME" || exit 2 |
|
262 |
||
263 |
echo "application for $PLATFORM_FAMILY" |
|
264 |
( |
|
265 |
cat "windows_app/7zsd_All.sfx" |
|
266 |
cat "$ISABELLE_HOME/Admin/Windows/Installer/sfx.txt" | \ |
|
267 |
perl -p -e "s,{ISABELLE_NAME},${ISABELLE_NAME},g;" |
|
268 |
cat "$TMP/${ISABELLE_NAME}.7z" |
|
269 |
) > "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe" |
|
270 |
chmod +x "${ARCHIVE_DIR}/${ISABELLE_NAME}.exe" |
|
271 |
) |
|
272 |
;; |
|
273 |
*) |
|
274 |
;; |
|
275 |
esac |
|
276 |
else |
|
277 |
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
|
278 |
fi |
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
279 |
|
52677 | 280 |
|
33907
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
281 |
# clean up |
473f859e1c29
re-package Isabelle distribution with add-on components;
wenzelm
parents:
diff
changeset
|
282 |
rm -rf "$TMP" |