author | wenzelm |
Sun, 15 Jan 2017 16:47:42 +0100 | |
changeset 64903 | ba72a13eb78c |
parent 64313 | ae7c11573922 |
permissions | -rwxr-xr-x |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
1 |
#!/usr/bin/env bash |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
2 |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
3 |
THIS="$(cd "$(dirname "$0")"; pwd)" |
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
4 |
|
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
5 |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
6 |
## diagnostics |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
7 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
8 |
function fail() |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
9 |
{ |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
10 |
echo "$1" >&2 |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
11 |
exit 2 |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
12 |
} |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
13 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
14 |
|
48825 | 15 |
## parameters |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
16 |
|
64313 | 17 |
VERSION="8u112" |
18 |
FULL_VERSION="1.8.0_112" |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
19 |
|
50890 | 20 |
ARCHIVE_LINUX32="jdk-${VERSION}-linux-i586.tar.gz" |
21 |
ARCHIVE_LINUX64="jdk-${VERSION}-linux-x64.tar.gz" |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
22 |
ARCHIVE_WINDOWS32="jdk${FULL_VERSION}-w32.tar.gz" |
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
23 |
ARCHIVE_WINDOWS64="jdk${FULL_VERSION}-w64.tar.gz" |
50890 | 24 |
ARCHIVE_DARWIN="jdk${FULL_VERSION}.jdk.tar.gz" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
25 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
26 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
27 |
## main |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
28 |
|
48825 | 29 |
DIR="jdk-${VERSION}" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
30 |
mkdir "$DIR" || fail "Cannot create fresh directory: \"$DIR\"" |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
31 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
32 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
33 |
# README |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
34 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
35 |
cat >> "$DIR/README" << EOF |
58794 | 36 |
This is JDK/JRE $FULL_VERSION as required for Isabelle. |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
37 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
38 |
See http://www.oracle.com/technetwork/java/javase/downloads/index.html |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
39 |
for the original downloads, which are covered by the Oracle Binary |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
40 |
Code License Agreement for Java SE. |
48825 | 41 |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
42 |
Linux, Windows, Mac OS X all work uniformly, depending on certain |
50294 | 43 |
platform-specific subdirectories. |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
44 |
EOF |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
45 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
46 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
47 |
# settings |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
48 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
49 |
mkdir "$DIR/etc" |
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
50 |
cp "$THIS/settings" "$DIR/etc/settings" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
51 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
52 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
53 |
# content |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
54 |
|
53913
5ff12177a067
prefer GNU tar for Isabelle to avoid odd extended header keywords produced by Apple's bsdtar (see also 8f6046b7f850);
wenzelm
parents:
53631
diff
changeset
|
55 |
#GNU tar (notably on Mac OS X) |
63897
85c83757788c
consolidate implicit use of gnutar, via somewhat fragile dynamic scoping within existing shell scripts;
wenzelm
parents:
63557
diff
changeset
|
56 |
type -p gnutar >/dev/null && function tar() { gnutar "$@"; } |
50863 | 57 |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
58 |
mkdir "$DIR/x86-linux" "$DIR/x86_64-linux" "$DIR/x86-windows" "$DIR/x86_64-windows" "$DIR/x86_64-darwin" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
59 |
|
48825 | 60 |
tar -C "$DIR/x86-linux" -xf "$ARCHIVE_LINUX32" |
61 |
tar -C "$DIR/x86_64-linux" -xf "$ARCHIVE_LINUX64" |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
62 |
tar -C "$DIR/x86-windows" -xf "$ARCHIVE_WINDOWS32" |
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
63 |
tar -C "$DIR/x86_64-windows" -xf "$ARCHIVE_WINDOWS64" |
48825 | 64 |
tar -C "$DIR/x86_64-darwin" -xf "$ARCHIVE_DARWIN" |
65 |
||
53417 | 66 |
( |
67 |
cd "$DIR" |
|
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
68 |
for PLATFORM in x86-linux x86_64-linux x86-windows x86_64-windows |
53417 | 69 |
do |
70 |
mv "$PLATFORM/jdk${FULL_VERSION}"/* "$PLATFORM"/. |
|
71 |
rmdir "$PLATFORM/jdk${FULL_VERSION}" |
|
72 |
done |
|
73 |
PLATFORM=x86_64-darwin |
|
74 |
mv "$PLATFORM/jdk${FULL_VERSION}.jdk"/* "$PLATFORM"/. |
|
75 |
rmdir "$PLATFORM/jdk${FULL_VERSION}.jdk" |
|
76 |
) |
|
77 |
||
48825 | 78 |
chgrp -R isabelle "$DIR" |
79 |
chmod -R a+r "$DIR" |
|
80 |
chmod -R a+X "$DIR" |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
81 |
|
50294 | 82 |
find "$DIR/x86_64-darwin" -name "._*" -exec rm -f {} ";" |
83 |
||
50890 | 84 |
echo "Sharing ..." |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
85 |
( |
53417 | 86 |
cd "$DIR/x86-linux" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
87 |
for FILE in $(find . -type f) |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
88 |
do |
48825 | 89 |
for OTHER in \ |
53631
e68732cd842e
proper sharing after change of directory structure (cf. 32ec957e5c3e);
wenzelm
parents:
53625
diff
changeset
|
90 |
"../x86_64-linux/$FILE" \ |
60995
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
91 |
"../x86-windows/$FILE" \ |
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
92 |
"../x86_64-windows/$FILE" \ |
5176de8f90db
updated to jdk-8u60, with support for x86_64-windows;
wenzelm
parents:
60760
diff
changeset
|
93 |
"../x86_64-darwin/Contents/Home/$FILE" |
48825 | 94 |
do |
95 |
if cmp -s "$FILE" "$OTHER" |
|
96 |
then |
|
57587 | 97 |
echo -n "*" |
48825 | 98 |
ln -f "$FILE" "$OTHER" |
99 |
fi |
|
100 |
done |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
101 |
done |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
102 |
) |
53631
e68732cd842e
proper sharing after change of directory structure (cf. 32ec957e5c3e);
wenzelm
parents:
53625
diff
changeset
|
103 |
echo |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
104 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
105 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
106 |
# create archive |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
107 |
|
50890 | 108 |
echo "Archiving ..." |
109 |
tar -c -z -f "${DIR}.tar.gz" "$DIR" && echo "${DIR}.tar.gz" |