author | wenzelm |
Thu, 25 Apr 2013 13:22:45 +0200 | |
changeset 51776 | 8ea64fb16bae |
parent 51074 | f95817852bdd |
child 53417 | 32ec957e5c3e |
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 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
3 |
## diagnostics |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
4 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
5 |
function fail() |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
6 |
{ |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
7 |
echo "$1" >&2 |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
8 |
exit 2 |
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 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
11 |
|
48825 | 12 |
## parameters |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
13 |
|
51776 | 14 |
VERSION="7u21" |
15 |
FULL_VERSION="1.7.0_21" |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
16 |
|
50890 | 17 |
ARCHIVE_LINUX32="jdk-${VERSION}-linux-i586.tar.gz" |
18 |
ARCHIVE_LINUX64="jdk-${VERSION}-linux-x64.tar.gz" |
|
19 |
ARCHIVE_DARWIN="jdk${FULL_VERSION}.jdk.tar.gz" |
|
20 |
ARCHIVE_WINDOWS="jdk${FULL_VERSION}.tar.gz" |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
21 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
22 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
23 |
## main |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
24 |
|
48825 | 25 |
DIR="jdk-${VERSION}" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
26 |
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
|
27 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
28 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
29 |
# README |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
30 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
31 |
cat >> "$DIR/README" << EOF |
50294 | 32 |
This is JDK $FULL_VERSION as required for Isabelle. |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
33 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
34 |
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
|
35 |
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
|
36 |
Code License Agreement for Java SE. |
48825 | 37 |
|
50294 | 38 |
Linux, Mac OS X, Windows work uniformly, depending on certain |
39 |
platform-specific subdirectories. |
|
40 |
||
41 |
Note that Java 1.7 on Mac OS X requires 64bit hardware! |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
42 |
EOF |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
43 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
44 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
45 |
# settings |
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 |
mkdir "$DIR/etc" |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
48 |
cat >> "$DIR/etc/settings" << EOF |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
49 |
# -*- shell-script -*- :mode=shellscript: |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
50 |
|
48825 | 51 |
case "\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}" in |
52 |
x86-darwin) |
|
53 |
echo "### Java 1.7 unavailable on 32bit Macintosh!" >&2 |
|
54 |
;; |
|
55 |
x86_64-darwin) |
|
56 |
ISABELLE_JDK_HOME="\$COMPONENT/\$ISABELLE_PLATFORM64/jdk${FULL_VERSION}.jdk/Contents/Home" |
|
57 |
;; |
|
58 |
*) |
|
59 |
ISABELLE_JDK_HOME="\$COMPONENT/\${ISABELLE_PLATFORM64:-\$ISABELLE_PLATFORM32}/jdk${FULL_VERSION}" |
|
60 |
;; |
|
61 |
esac |
|
62 |
||
63 |
if [ -n "\$ISABELLE_JDK_HOME" ]; then |
|
50294 | 64 |
if [ -d "\$ISABELLE_JDK_HOME" ]; then |
65 |
ISABELLE_JAVA_EXT="\${ISABELLE_JDK_HOME}/jre/lib/ext" |
|
66 |
else |
|
67 |
echo "### Missing Java 1.7 platform directory: \"\$ISABELLE_JDK_HOME\"" >&2 |
|
68 |
unset ISABELLE_JDK_HOME |
|
69 |
fi |
|
48825 | 70 |
fi |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
71 |
EOF |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
72 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
73 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
74 |
# content |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
75 |
|
50863 | 76 |
export COPYFILE_DISABLE=true |
77 |
||
48825 | 78 |
mkdir "$DIR/x86-linux" "$DIR/x86_64-linux" "$DIR/x86_64-darwin" "$DIR/x86-cygwin" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
79 |
|
48825 | 80 |
tar -C "$DIR/x86-linux" -xf "$ARCHIVE_LINUX32" |
81 |
tar -C "$DIR/x86_64-linux" -xf "$ARCHIVE_LINUX64" |
|
82 |
tar -C "$DIR/x86_64-darwin" -xf "$ARCHIVE_DARWIN" |
|
83 |
tar -C "$DIR/x86-cygwin" -xf "$ARCHIVE_WINDOWS" |
|
84 |
||
85 |
chgrp -R isabelle "$DIR" |
|
86 |
chmod -R a+r "$DIR" |
|
87 |
chmod -R a+X "$DIR" |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
88 |
|
50294 | 89 |
find "$DIR/x86_64-darwin" -name "._*" -exec rm -f {} ";" |
90 |
||
50890 | 91 |
echo "Sharing ..." |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
92 |
( |
48825 | 93 |
cd "$DIR/x86-linux/jdk${FULL_VERSION}" |
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
94 |
for FILE in $(find . -type f) |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
95 |
do |
48825 | 96 |
for OTHER in \ |
97 |
"../../x86_64-linux/jdk${FULL_VERSION}/$FILE" \ |
|
98 |
"../../x86_64-darwin/jdk${FULL_VERSION}.jdk/Contents/Home/$FILE" \ |
|
99 |
"../../x86-cygwin/jdk${FULL_VERSION}/$FILE" |
|
100 |
do |
|
101 |
if cmp -s "$FILE" "$OTHER" |
|
102 |
then |
|
103 |
ln -f "$FILE" "$OTHER" |
|
104 |
fi |
|
105 |
done |
|
47970
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
106 |
done |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
107 |
) |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
108 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
109 |
|
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
110 |
# create archive |
257fc09aa8a1
build hybrid Isabelle component for JDK on x86-linux/x86_64-linux;
wenzelm
parents:
diff
changeset
|
111 |
|
50890 | 112 |
echo "Archiving ..." |
113 |
tar -c -z -f "${DIR}.tar.gz" "$DIR" && echo "${DIR}.tar.gz" |