author | blanchet |
Thu, 06 Mar 2014 13:36:15 +0100 | |
changeset 55931 | 62156e694f3d |
parent 53659 | 85ae414b0363 |
child 57027 | 80ffda443738 |
permissions | -rwxr-xr-x |
50806 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# DESCRIPTION: produce pre-canned Cygwin distribution for Isabelle |
|
4 |
||
50834
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
5 |
## global parameters |
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
6 |
|
53659 | 7 |
CYGWIN_MIRROR="http://isabelle.in.tum.de/cygwin_2013-1" |
50834
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
8 |
|
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
9 |
|
50806 | 10 |
## diagnostics |
11 |
||
12 |
PRG=$(basename "$0") |
|
13 |
||
14 |
function usage() |
|
15 |
{ |
|
16 |
echo |
|
17 |
echo "Usage: isabelle $PRG" |
|
18 |
echo |
|
19 |
echo " Produce pre-canned Cygwin distribution for Isabelle." |
|
20 |
echo |
|
21 |
exit 1 |
|
22 |
} |
|
23 |
||
24 |
function fail() |
|
25 |
{ |
|
26 |
echo "$1" >&2 |
|
27 |
exit 2 |
|
28 |
} |
|
29 |
||
30 |
||
31 |
## arguments |
|
32 |
||
33 |
[ "$#" -ne 0 ] && usage |
|
34 |
||
35 |
||
36 |
## main |
|
37 |
||
38 |
TARGET="$PWD/cygwin" |
|
39 |
||
40 |
||
41 |
# download |
|
42 |
||
43 |
[ ! -e "$TARGET" ] || fail "Target already exists: \"$TARGET\"" |
|
44 |
mkdir -p "$TARGET/isabelle" || fail "Failed to create target directory: \"$TARGET\"" |
|
45 |
||
53659 | 46 |
perl -MLWP::Simple -e "getprint '$CYGWIN_MIRROR/setup-x86.exe';" > "$TARGET/isabelle/cygwin.exe" |
50806 | 47 |
chmod +x "$TARGET/isabelle/cygwin.exe" |
48 |
||
49 |
"$TARGET/isabelle/cygwin.exe" -h </dev/null >/dev/null || exit 2 |
|
50 |
||
51 |
||
52 |
# install |
|
53 |
||
54 |
"$TARGET/isabelle/cygwin.exe" \ |
|
50834
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
55 |
--site "$CYGWIN_MIRROR" --no-verify \ |
50839 | 56 |
--local-package-dir 'C:\temp' \ |
50806 | 57 |
--root "$(cygpath -w "$TARGET")" \ |
53659 | 58 |
--packages libgmp3,perl,python,rlwrap,vim \ |
50806 | 59 |
--no-shortcuts --no-startmenu --no-desktop --quiet-mode |
60 |
||
61 |
[ "$?" = 0 -a -e "$TARGET/etc" ] || exit 2 |
|
62 |
||
63 |
||
64 |
# patches |
|
65 |
||
50887
1cadc8a8b377
avoid odd copies of local configuration or backup files;
wenzelm
parents:
50839
diff
changeset
|
66 |
for NAME in hosts protocols services networks passwd group |
50806 | 67 |
do |
68 |
rm "$TARGET/etc/$NAME" |
|
69 |
done |
|
70 |
||
71 |
ln -s cygperl5_14.dll "$TARGET/bin/cygperl5_14_2.dll" |
|
72 |
||
73 |
rm "$TARGET/Cygwin.bat" |
|
74 |
||
50811 | 75 |
|
76 |
# archive |
|
77 |
||
50834
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
78 |
DATE=$(date +%Y%m%d) |
506342881c33
refer to cygwin mirror with static copy of setup.ini;
wenzelm
parents:
50811
diff
changeset
|
79 |
tar -C "$TARGET/.." -cz -f "cygwin-${DATE}.tar.gz" cygwin |
50958 | 80 |