aboutsummaryrefslogtreecommitdiffstats
path: root/community/openjdk8/APKBUILD
blob: 256c70e8ac8b465f0d27479baecc3ba8e74b51ed (plain) (blame)
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
# Contributor: Timo Teras <timo.teras@iki.fi>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk8
_icedteaver=3.2.0
# pkgver is <JDK version>.<JDK update>.<JDK build>
# Check http://icedtea.classpath.org/wiki/Main_Page when updating!
pkgver=8.111.14
pkgrel=0
pkgdesc="OpenJDK 8 provided by IcedTea"
url="http://icedtea.classpath.org/"
arch="all"
license="custom"
depends="$pkgname-jre java-cacerts"
options="sover-namecheck"
makedepends="bash findutils tar zip file paxmark gawk util-linux libxslt
	autoconf automake linux-headers sed xz coreutils
	openjdk7 ca-certificates
	nss-dev cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev
	lcms2-dev libxp-dev libxtst-dev libxinerama-dev zlib-dev
	libxrender-dev alsa-lib-dev freetype-dev fontconfig-dev
	gtk+2.0-dev krb5-dev attr-dev pcsc-lite-dev lksctp-tools-dev
	libxcomposite-dev"

case $CARCH in
x86)	_jarch=i386;;
x86_64)	_jarch=amd64;;
arm*)	_jarch=arm;;
*)	_jarch="$CARCH";;
esac

_bootstrap_java_home="/usr/lib/jvm/java-1.7-openjdk"
_java_home="/usr/lib/jvm/java-1.8-openjdk"
_jrelib="$_java_home/jre/lib/$_jarch"

# Exclude xawt from ldpath to avoid duplicate provides for libmawt.so
# (also in headless). in future this should be a virtual provides.
ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"
sonameprefix="$pkgname:"

subpackages="$pkgname-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase
	$pkgname-doc $pkgname-demos"

_dropsver=$_icedteaver
_dropsurl="http://icedtea.classpath.org/download/drops/icedtea8/$_dropsver"

source="http://icedtea.classpath.org/download/source/icedtea-$_icedteaver.tar.gz
	openjdk-$_dropsver.tar.xz::$_dropsurl/openjdk.tar.xz
	corba-$_dropsver.tar.xz::$_dropsurl/corba.tar.xz
	jaxp-$_dropsver.tar.xz::$_dropsurl/jaxp.tar.xz
	jaxws-$_dropsver.tar.xz::$_dropsurl/jaxws.tar.xz
	jdk-$_dropsver.tar.xz::$_dropsurl/jdk.tar.xz
	langtools-$_dropsver.tar.xz::$_dropsurl/langtools.tar.xz
	hotspot-$_dropsver.tar.xz::$_dropsurl/hotspot.tar.xz
	nashorn-$_dropsver.tar.xz::$_dropsurl/nashorn.tar.xz

	icedtea-hotspot-musl.patch
	icedtea-hotspot-noagent-musl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-ipv6-init.patch
	icedtea-jdk-fix-libjvm-load.patch
	icedtea-jdk-musl.patch
	icedtea-jdk-includes.patch
	icedtea-autoconf-config.patch
	"
builddir="$srcdir/icedtea-$_icedteaver"

unpack() {
	if [ -z "$force" ]; then
		verify || return 1
		initdcheck || return 1
	fi
	mkdir -p "$srcdir"
	msg "Unpacking sources..."
	tar -C "$srcdir" -zxf icedtea-$_icedteaver.tar.gz || return 1
}

prepare() {
	cd "$builddir"

	# Busybox sha256 does not support longopts.
	sed -e "s/--check/-c/g" -i Makefile.am

	local patch; for patch in $source; do
		case $patch in
		icedtea-*.patch)
			cp ../$patch patches
			;;
		*.patch)
			msg "Applying patch $patch"
			patch -p1 -i "$srcdir"/$patch || return 1
			;;
		esac
	done

	./autogen.sh
}

build() {
	export JAVA_HOME="$_bootstrap_java_home"
	export PATH="$JAVA_HOME/bin:$PATH"

	if [ -z "$JOBS" ]; then
		export JOBS=$(printf '%s\n' "$MAKEFLAGS" | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p')
	fi

	DISTRIBUTION_PATCHES=""
	local patch; for patch in $source; do
		case $patch in
		icedtea-*.patch)
			DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch"
			;;
		esac
	done
	export DISTRIBUTION_PATCHES
	echo "icedtea patches: $DISTRIBUTION_PATCHES"

	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix="$_java_home" \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-dependency-tracking \
		--disable-downloading \
		--with-parallel-jobs=${JOBS:-2} \
		--with-openjdk-src-zip="$srcdir/openjdk-$_dropsver.tar.xz" \
		--with-hotspot-src-zip="$srcdir/hotspot-$_dropsver.tar.xz" \
		--with-corba-src-zip="$srcdir/corba-$_dropsver.tar.xz" \
		--with-jaxp-src-zip="$srcdir/jaxp-$_dropsver.tar.xz" \
		--with-jaxws-src-zip="$srcdir/jaxws-$_dropsver.tar.xz" \
		--with-jdk-src-zip="$srcdir/jdk-$_dropsver.tar.xz" \
		--with-langtools-src-zip="$srcdir/langtools-$_dropsver.tar.xz" \
		--with-nashorn-src-zip="$srcdir/nashorn-$_dropsver.tar.xz" \
		--with-pax=paxmark \
		--with-jdk-home="$_bootstrap_java_home" \
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
		|| return 1
	make || return 1
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/$_java_home

	cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$_java_home/ || return 1
	rm "$pkgdir"/$_java_home/src.zip

	# This archive contains absolute paths from the build environment,
	# so it does not work on the target system. User can generate it
	# running `java -Xshare:dump`.
	rm "$pkgdir"/$_jrelib/server/classes.jsa

	# pax mark again (due to fakeroot xattr handling bug)
	./pax-mark-vm "$pkgdir"/$_java_home

	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts
	ln -sf /etc/ssl/certs/java/cacerts \
		"$pkgdir"/$_java_home/jre/lib/security/cacerts
}

jrelib() {
	pkgdesc="OpenJDK 8 Java Runtime (class libraries)"
	depends=""

	local file dir
	for file in jre/lib/images \
			jre/lib/*.jar \
			jre/lib/security \
			jre/lib/ext/*.jar \
			jre/lib/cmm \
			jre/ASSEMBLY_EXCEPTION \
			jre/THIRD_PARTY_README \
			jre/LICENSE; do

		dir=${file%/*}
		mkdir -p "$subpkgdir"/$_java_home/$dir
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir || return 1
	done
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
	local file dir

	mkdir -p "$subpkgdir"
	for file in jre/bin/policytool \
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
			jre/lib/$_jarch/libjsoundalsa.so \
			jre/lib/$_jarch/libsplashscreen.so; do

		dir=${file%/*}
		mkdir -p "$subpkgdir"/$_java_home/$dir
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir || return 1
	done

	# Pax mark again (due to fakeroot xattr handling bug).
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home
}

jrebase() {
	pkgdesc="OpenJDK 8 Java Runtime (no GUI support)"
	depends="$pkgname-jre-lib java-common java-cacerts"

	mkdir -p "$subpkgdir"/$_java_home/bin \
		"$subpkgdir"/$_java_home/lib/$_jarch

	mv "$pkgdir"/$_java_home/lib/$_jarch/jli \
		"$subpkgdir"/$_java_home/lib/$_jarch/ || return 1

	local file; for file in java orbd rmid servertool unpack200 keytool \
			pack200 rmiregistry tnameserv; do
		mv "$pkgdir"/$_java_home/bin/$file "$subpkgdir"/$_java_home/bin/ || return 1
	done

	# Rest of the jre subdir (which were not taken by -jre subpkg).
	mv "$pkgdir"/$_java_home/jre "$subpkgdir"/$_java_home/ || return 1

	# Pax mark again (due to fakeroot xattr handling bug).
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home
}

doc() {
	default_doc || return 1

	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/
}

demos() {
	pkgdesc="OpenJDK 8 Java Demos and Samples"
	depends="$pkgname"

	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \
		"$subpkgdir"/$_java_home/
}

md5sums="c25ceec95f8df5066c617b14f2735227  icedtea-3.2.0.tar.gz
c7a7681fff0afda6a897b135820a1440  openjdk-3.2.0.tar.xz
19a12dc608da61a6878f4614a91156af  corba-3.2.0.tar.xz
8b1171ec1060517fc1c4eee162c78b33  jaxp-3.2.0.tar.xz
ca6bbcdb0f87399bd0a5481ad55939c8  jaxws-3.2.0.tar.xz
5f5d90b7036f1e8561f6943308528e80  jdk-3.2.0.tar.xz
9d105ca8e4de3936fe1a4916ec30ad7f  langtools-3.2.0.tar.xz
cc5f423ed2949ee8a7e25d43f0cb425f  hotspot-3.2.0.tar.xz
05fa4f0110a5c9c18828a3e359b1adde  nashorn-3.2.0.tar.xz
2f4a5b0ec7a2bf7ab609da10b86dca4c  icedtea-hotspot-musl.patch
bd148291e75d536972cb2b1b68e5cb05  icedtea-hotspot-noagent-musl.patch
43023861c5f6efc3139a834aa3ec0476  icedtea-hotspot-uclibc-fixes.patch
bdea7060a067faf1c2de5f4eb6e8525d  icedtea-jdk-execinfo.patch
250b0807b59762670954b132e8f8dfba  icedtea-jdk-fix-ipv6-init.patch
4dcba8ae18346298c0d0b817f6922415  icedtea-jdk-fix-libjvm-load.patch
b708c7630efb0b0fe7bb3eca58cb1629  icedtea-jdk-musl.patch
da4b0b67d9b5c7f742bcea70722acd94  icedtea-jdk-includes.patch
d13bf1213635a702611af295d3977fe1  icedtea-autoconf-config.patch"
sha256sums="88cc563d5cf4d7d0e8a394800ba580c922c5703dded4922551eb1a2425010b86  icedtea-3.2.0.tar.gz
6c1040b4044efdd0c413d15865304f1ac46230d91435a31347a7b755e91e7924  openjdk-3.2.0.tar.xz
902607987e26c67489f01fe8cf693fbbbd5850f3b9b06ff12af5486b75822387  corba-3.2.0.tar.xz
61d6c7a44746ace38812582474b66c2c96f1ce9c7bd5b9ad251b4d5982bee6d6  jaxp-3.2.0.tar.xz
1285b9cb273b6fa97f985ace4cb6b5dc1963b1d5e0ae06ad4802f5ff678465b9  jaxws-3.2.0.tar.xz
92557d8fbf826a643c730bbb4081e87140eb45e40e5662fd3d75829b5f61c9c5  jdk-3.2.0.tar.xz
94d1754bba9020b2ee658c7adc2388ac38208e71e55650dc0393d24b20816a4d  langtools-3.2.0.tar.xz
9dd74ff7ac16b6104410c7c331f39e96fe50940e4023201b1a2898a8314e1fbf  hotspot-3.2.0.tar.xz
5f72fedfa82415fdf98a0a9bf01d2c171b060810b314bf5bb1c69b57123dc910  nashorn-3.2.0.tar.xz
ed114e8d00d6ed1295f5995df02ad13d3d0cd242f7a904600d93b6564856f8df  icedtea-hotspot-musl.patch
c14529a29bfdfb51bf5b4a41c977039073f470758e31235d043d373b48d46a11  icedtea-hotspot-noagent-musl.patch
0ef7592b8f2c954eda0a6cf4dc4a4010942f35ea426f44e34412be6c9a949745  icedtea-hotspot-uclibc-fixes.patch
a35d40f24098747cdb73d9c3742cfb4aecafa0f72c9dfdfe2cb460f9706ff665  icedtea-jdk-execinfo.patch
632683ec88a6fb250ef043aae9cace605d0c669b7058f8c47b62b09b03ecc6c5  icedtea-jdk-fix-ipv6-init.patch
c0f7e07293883142d7d7776c9e43a3bba7d45e4abbce6dc0fb531d25ed836ed4  icedtea-jdk-fix-libjvm-load.patch
749f9a5644253caaa0dc5b1d3ee31ed61e1392fdd127d6c68eef367902fe834c  icedtea-jdk-musl.patch
8f4edc784fd70b27f91a0acf05a1de19fc300a35852b74668332ed747ec52073  icedtea-jdk-includes.patch
51ced4c77b97744fd0ecfbeca3f94e2da1fc5072dac7830c141f70887c503c33  icedtea-autoconf-config.patch"
sha512sums="e0be02d37f76586616b68fa4f1a93f3d098d2f1fa3dcd8a1294579ce4c79e0002e7673c90a328e153869996392e6ad8a208379f42c05d225e489d8f838601abb  icedtea-3.2.0.tar.gz
89a3d39afcd6a7a1c8c55d0b7aa1a4c3d87878cf97ffe96fe13fe014edb28588cd8505281ba127eb6275b3639bbdc28593cdbf8cd56e4b033fa83c75c48b0029  openjdk-3.2.0.tar.xz
b66f13f3f65085857bbdfb37d4d05a872a4cdb115394787365c8b4f67a70b95df4c66702b930fb6ec637e9f5065e21283df344127d618477d3e1beca7b9d047a  corba-3.2.0.tar.xz
44c0c43509a5c7e7f95ff319a857019acfc1645cadc584e5a20bbc4df2ba154f1d6ed85f9e6154f5526800dcc997971b53762040c2392f4edafe85c55e05721a  jaxp-3.2.0.tar.xz
5768d2dcee308e4060f797b30176959ea1295fd448a1525ecd40fc8a5bd1e97daa81813c19d1aed370f063e81a33bed4a6cb6bbebaa55de11f6173c7eda86574  jaxws-3.2.0.tar.xz
c52136ce97db6a77fd878f4af8182aa1232a02f6010ac9cf570c99ef9576af6427f703b10efc6546bb4a72f91e2f2c39a891b54b9b34ecfc997713ed2a74025f  jdk-3.2.0.tar.xz
b799f21be6bab4cec51a3b4b8e3b578aa91501449bfd336c0fedb04df109644a41e57e847eda65bf4cee54b3f55bb8785a4c0df5fb5ff9021870883c77fe3898  langtools-3.2.0.tar.xz
69df8dc706900d07eca71982de27c55c9cde18c41061752e91108c30cd85d0d9b37f8b9e041aab0622746510900173bb635cdc4cc3c4fd0f795898fc15158441  hotspot-3.2.0.tar.xz
c526678a0c406300e92e8290617518bf326e6992f0cf8b305aa28b45e52b92cbd5a5fa54ea9ef93862a0acbf1a14a1f15986bc64ffb55a6f769a5be068e0e5e2  nashorn-3.2.0.tar.xz
ada3bc4024682bfb86ebf3850d3a36cf4c0f0677a6d56eac2e0959b92bfe759010d5b9c801b043cae3ca8418d7819546ae245ac163df83e48c5d4b34478daeb0  icedtea-hotspot-musl.patch
3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224  icedtea-hotspot-noagent-musl.patch
822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a  icedtea-hotspot-uclibc-fixes.patch
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
dc41a132e310101dfdd0d3e17eba8a53acb67392ab0d16cf09d24084ab467921a9ebfa33cde0e4e63e65c55ce7edcaf12edee10eea66e37b12ac9dba0419ac61  icedtea-jdk-musl.patch
c6caaa69a75dfcf922f7a700a4c780568ead18e8774b9df2c1d86d1ab9f5a21c239952c4053f0f839b4255c0da69d2f42cdd87637db7cf5333076872f63580e0  icedtea-jdk-includes.patch
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch"