blob: 6d99306aa413001f913b63d437b5dd97e1259535 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
|
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk11
pkgver=11.0.4_p4
_pkgver=${pkgver/_p/+}
pkgrel=1
pkgdesc="Oracle OpenJDK 11"
url="https://hg.openjdk.java.net/jdk-updates/jdk11u"
arch="all !x86 !armhf !armv7" # openjdk10 is not yet available on 32 bit arches
license="GPL-2.0 with Classpath"
makedepends="autoconf
bash
gawk
grep
make
openjdk10-jdk
zip
alsa-lib-dev
cups-dev
elfutils-dev
fontconfig-dev
freetype-dev
giflib-dev
lcms2-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrandr-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk11 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-dbg:_dbg
$pkgname-jre:_jre
$pkgname-src:_src:noarch
$pkgname-jre-headless:_jre_headless
$pkgname-jdk:_jdk"
source="jdk-$_pkgver.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk11u/archive/jdk-$_pkgver.tar.bz2
build.patch
aarch64.patch
arm.patch
ppc64le.patch
x86.patch
HelloWorld.java
TestECDSA.java
TestCryptoLevel.java
Alpine_Bug_10126.java
"
builddir="$srcdir/jdk11u-jdk-$_pkgver"
_java_home="/usr/lib/jvm/java-11-openjdk"
ldpath="$_java_home/lib:$_java_home/lib/jli:$_java_home/lib/server"
sonameprefix="$pkgname:"
# enable running the JTReg tests in check?
# see comment in that function for explanation
_run_jtreg=0
if [ $_run_jtreg -ne 0 ]; then
makedepends="$makedepends java-jtreg"
checkdepends="$checkdepends ttf-freefont xvfb"
fi
prepare() {
default_prepare
# update autoconf files to detect alpine
update_config_sub
update_config_guess
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r src/jdk.hotspot.agent
}
build() {
cd "$builddir"
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
fi
# CFLAGS, CXXFLAGS and LDFLAGS are ignored as shown by a warning
# in the output of ./configure unless used like such:
# --with-extra-cflags="${CFLAGS}"
# --with-extra-cxxflags="${CXXFLAGS}"
# --with-extra-ldflags="${LDFLAGS}"
# See also paragraph "Configure Control Variables" from "common/doc/building.md"
CFLAGS= CXXFLAGS= LDFLAGS= \
bash ./configure \
--openjdk-target=$CHOST \
--prefix="$_java_home" \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-extra-cflags="$CFLAGS" \
--with-extra-cxxflags="$CXXFLAGS" \
--with-extra-ldflags="$LDFLAGS" \
--with-zlib=system \
--with-libjpeg=system \
--with-giflib=system \
--with-libpng=system \
--with-lcms=system \
--with-jobs=${JOBS:-4} \
--with-test-jobs=${JOBS:-4} \
--with-native-debug-symbols=external \
$_with_jtreg \
--disable-warnings-as-errors \
--disable-precompiled-headers \
--enable-dtrace=no \
--with-jvm-variants=server \
--with-debug-level=release \
--with-version-pre= \
--with-version-opt=alpine-r${pkgrel} \
--with-version-build=${_pkgver#*+} \
--with-vendor-name="Alpine" \
--with-vendor-url="https://alpinelinux.org/" \
--with-vendor-bug-url="https://bugs.alpinelinux.org/projects/alpine/issues" \
--with-vendor-vm-bug-url="https://bugs.alpinelinux.org/projects/alpine/issues"
MAKEFLAGS= make images
}
check() {
cd "$builddir"
local _java_bin="./build/*-normal-server-release/images/jdk/bin"
# 1) compile and run a simple hello world
$_java_bin/javac -d . "$srcdir"/HelloWorld.java
$_java_bin/java HelloWorld
# 2) compile and run a testcase for unlimited policy
$_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java
$_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 3) compile and run a testcase for ECDSA signatures
$_java_bin/javac -d . "$srcdir"/TestECDSA.java
$_java_bin/java TestECDSA
# 4) compile and run testcase for bug 10126
$_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java
$_java_bin/java Alpine_Bug_10126
# run the gtest unittest suites
MAKEFLAGS= make test-hotspot-gtest
# The jtreg tests take very, very long to finish and show some failures (9 - 12 on my machine, varying between runs)
# I think these are not critical and can be safely ignored.
# As the tests take too long, they are disabled by default.
# When updating this aport please let them run at least once on your machine to see if the failure count changes.
if [ $_run_jtreg -ne 0 ]; then
_logfile=$( mktemp -p "$builddir" )
if [ -z "$DISPLAY" ]; then
Xvfb :99 &
_xvfb_pid=$!
DISPLAY=:99
fi
MAKEFLAGS= DISPLAY=$DISPLAY make \
run-test-tier1 \
run-test-tier2 \
run-test-tier3 \
| tee "$_logfile"
msg "---------------------------------------"
msg "The build log can be found at $_logfile"
if [ -n "$_xvfb_pid" ]; then
kill $_xvfb_pid
fi
# abort the build so you may take a look at the logfile
false
fi
}
package() {
cd "$builddir"
mkdir -p "$pkgdir/$_java_home"
cp -r build/*-normal-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 11 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 11 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 11 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_dbg() {
pkgdesc="Oracle OpenJDK 11 (debug)"
depends="$pkgname-jdk"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot/lib/server"
mkdir -p "$_toroot/lib/jli"
mv "$_fromroot"/lib/server/*.debuginfo "$_toroot"/lib/server
mv "$_fromroot"/lib/jli/*.debuginfo "$_toroot"/lib/jli
mv "$_fromroot"/lib/*.debuginfo "$_toroot"/lib
}
_jre() {
pkgdesc="Oracle OpenJDK 11 (JRE)"
depends="$pkgname-jre-headless"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot/lib"
mv "$_fromroot/lib/libawt_xawt.so" \
"$_fromroot/lib/libfontmanager.so" \
"$_fromroot/lib/libjavajpeg.so" \
"$_fromroot/lib/libjawt.so" \
"$_fromroot/lib/libjsound.so" \
"$_fromroot/lib/liblcms.so" \
"$_fromroot/lib/libsplashscreen.so" \
"$_toroot/lib"
}
_src() {
pkgdesc="Oracle OpenJDK 11 (sources)"
depends="$pkgname-jre-headless"
mkdir -p "$subpkgdir/$_java_home"/lib
mv "$pkgdir"/$_java_home/lib/src.zip \
"$subpkgdir"/$_java_home/lib/
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 11 (JRE headless)"
depends="java-common java-cacerts"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/lib" "$_toroot"
mkdir -p "$_toroot/bin"
for i in java \
jjs \
keytool \
pack200 \
rmid \
rmiregistry \
unpack200; do
mv "$_fromroot/bin/$i" "$_toroot/bin/$i"
done
mv "$_fromroot/legal" "$_toroot"
mv "$_fromroot/conf" "$_toroot"
mv "$_fromroot/release" "$_toroot"
cp "$builddir/ASSEMBLY_EXCEPTION" "$_toroot"
cp "$builddir/LICENSE" "$_toroot"
cp "$builddir/README" "$_toroot"
# symlink to shared cacerts store
rm "$_toroot/lib/security/cacerts"
ln -sf /etc/ssl/certs/java/cacerts \
"$_toroot/lib/security/cacerts"
# symlink for java-common to work (expects jre in $_java_home/jre)
ln -sf . "$_toroot/jre"
}
_jdk() {
pkgdesc="Oracle OpenJDK 11 (JDK)"
depends="$pkgname-jre"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="3f64c8911d31214c2f07b359b57c08117597cf22e078f640b4d741b8d60c5926c6bd22f2612b54502eb14afb30e5f2012f12a69f5b77aea6273fd36fc2a5bc24 jdk-11.0.4+4.tar.bz2
66a9f2736da87de09d7bcc136771ab760bdba7847f3a23b2aa4efbc2e55ac8b49510c6d7afdf3f8d046c6e3fe9dca0d4cb0b5a38d7a3aebaf86fa0e3cc635eac build.patch
8c0f1f8d2a78ebb30a8460bc0ea9cd2349cea98819df1577bf7de19a1dd82d06a593f36b4e17c282ed53d23f00163e387e3dd1f3c9e5a092726e78c3aa710370 aarch64.patch
d2903a5b3b9f82c4888416580f0b93888bf21ae0dac0ce6e926607a82a9e53b7e10e13f07a984f65dc116e81f58cd3844d6156088534c0059be8f6ee68e19a43 arm.patch
4eb577645e7b6d4563290480e162702030033515ff4845edbd1dbf2604b6f1e7d2a3cdd85058d6b41938b54c097635125c4429b9df3fcda589b980aa1740fd2e ppc64le.patch
89e681da2de0bcb5131e2512d1280ce8da684ede5b38379c6325cd9f57e78a4bdde3abfa0a0a496889411dd57264312094973ce2da301293d0826114a3ef09d3 x86.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
18f72fcc3b09e772da10d6875a7081fe21d3b387e1d4d9a45bb9cc3e306393960b19c27dac61d33a20d7484c22109c2d091c062523d5575b8d30b20949b74f70 Alpine_Bug_10126.java"
|