Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 11 KB
Newer Older
Timo Teräs's avatar
Timo Teräs committed
1
# Contributor: Timo Teras <timo.teras@iki.fi>
2
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
Timo Teräs's avatar
Timo Teräs committed
3 4
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk8
5
_icedteaver=3.10.0
6
# pkgver is <JDK version>.<JDK update>.<JDK build>
7
# Check https://icedtea.classpath.org/wiki/Main_Page when updating!
8
pkgver=8.191.12
9
pkgrel=0
10
pkgdesc="OpenJDK 8 provided by IcedTea"
11
url="https://icedtea.classpath.org/"
12
arch="all"
Timo Teräs's avatar
Timo Teräs committed
13
license="custom"
14
depends="$pkgname-jre java-cacerts"
Timo Teräs's avatar
Timo Teräs committed
15 16
options="sover-namecheck"
makedepends="bash findutils tar zip file paxmark gawk util-linux libxslt
17
	autoconf automake linux-headers sed xz coreutils
18
	openjdk7 ca-certificates
Natanael Copa's avatar
Natanael Copa committed
19
	nss-dev nss-static cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev
20 21
	lcms2-dev libxp-dev libxtst-dev libxinerama-dev zlib-dev
	libxrender-dev alsa-lib-dev freetype-dev fontconfig-dev
22 23
	gtk+2.0-dev krb5-dev attr-dev pcsc-lite-dev lksctp-tools-dev
	libxcomposite-dev"
Timo Teräs's avatar
Timo Teräs committed
24 25 26 27

case $CARCH in
x86)	_jarch=i386;;
x86_64)	_jarch=amd64;;
28
arm*)	_jarch=aarch32;;
29
*)	_jarch="$CARCH";;
Timo Teräs's avatar
Timo Teräs committed
30 31
esac

32 33 34
_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"
Timo Teräs's avatar
Timo Teräs committed
35

36
# Exclude xawt from ldpath to avoid duplicate provides for libmawt.so
Timo Teräs's avatar
Timo Teräs committed
37 38
# (also in headless). in future this should be a virtual provides.
ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"
39
sonameprefix="$pkgname:"
Timo Teräs's avatar
Timo Teräs committed
40

41
subpackages="$pkgname-dbg $pkgname-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase
42
	$pkgname-doc $pkgname-demos"
Timo Teräs's avatar
Timo Teräs committed
43

44
_dropsver=$_icedteaver
45
_dropsurl="https://icedtea.classpath.org/download/drops/icedtea8/$_dropsver"
Timo Teräs's avatar
Timo Teräs committed
46

47
source="https://icedtea.classpath.org/download/source/icedtea-$_icedteaver.tar.xz
48 49 50 51 52 53 54 55
	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
56
	fix-paxmark.patch
Timo Teräs's avatar
Timo Teräs committed
57 58

	icedtea-hotspot-musl.patch
59
	icedtea-hotspot-musl-ppc.patch
Timo Teräs's avatar
Timo Teräs committed
60 61 62
	icedtea-hotspot-noagent-musl.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-ipv6-init.patch
63
	icedtea-jdk-fix-libjvm-load.patch
Timo Teräs's avatar
Timo Teräs committed
64 65
	icedtea-jdk-musl.patch
	icedtea-jdk-includes.patch
66
	icedtea-jdk-getmntent-buffer.patch
67
	icedtea-autoconf-config.patch
68
	icedtea-jdk-tls-nist-curves.patch
Timo Teräs's avatar
Timo Teräs committed
69
	"
70 71
builddir="$srcdir/icedtea-$_icedteaver"

72
# secfixes:
73 74 75 76 77 78 79 80 81 82
#   8.191.12-r0:
#     - CVE-2018-3136
#     - CVE-2018-3139
#     - CVE-2018-3149
#     - CVE-2018-3169
#     - CVE-2018-3180
#     - CVE-2018-3183
#     - CVE-2018-3214
#     - CVE-2018-13785
#     - CVE-2018-16435
83 84 85 86 87 88 89
#   8.181.13-r0:
#     - CVE-2018-2938
#     - CVE-2018-2940
#     - CVE-2018-2952
#     - CVE-2018-2973
#     - CVE-2018-3639

90 91
unpack() {
	if [ -z "$force" ]; then
92 93
		verify
		initdcheck
94 95 96
	fi
	mkdir -p "$srcdir"
	msg "Unpacking sources..."
97
	tar -C "$srcdir" -Jxf icedtea-$_icedteaver.tar.xz
98
}
Timo Teräs's avatar
Timo Teräs committed
99 100

prepare() {
101
	cd "$builddir"
Timo Teräs's avatar
Timo Teräs committed
102

103 104
	local ver_u=$(sed -En 's/^\s*JDK_UPDATE_VERSION\s*=\s*(\S+).*/\1/p' acinclude.m4)
	local ver_b=$(sed -En 's/^\s*BUILD_VERSION\s*=\s*b(\S+).*/\1/p' acinclude.m4)
105 106 107
	[ "${pkgver#*.}" = "$ver_u.$ver_b" ] \
		|| die "Version mismatch, source is 8.$ver_u.$ver_b, but abuild defines $pkgver!"

108 109
	# Busybox sha256 does not support longopts.
	sed -e "s/--check/-c/g" -i Makefile.am
Timo Teräs's avatar
Timo Teräs committed
110

111
	local patch; for patch in $source; do
112
		case $patch in
113 114 115
		icedtea-*.patch)
			cp ../$patch patches
			;;
116 117
		*.patch)
			msg "Applying patch $patch"
118
			patch -p1 -i "$srcdir"/$patch
119 120 121
			;;
		esac
	done
122 123

	./autogen.sh
Timo Teräs's avatar
Timo Teräs committed
124 125 126
}

build() {
127
	export JAVA_HOME="$_bootstrap_java_home"
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
	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"

145
	cd "$builddir"
146
	bash ./configure \
Timo Teräs's avatar
Timo Teräs committed
147 148
		--build=$CBUILD \
		--host=$CHOST \
149
		--prefix="$_java_home" \
Timo Teräs's avatar
Timo Teräs committed
150 151 152 153
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
154 155
		--disable-dependency-tracking \
		--disable-downloading \
156
		--disable-precompiled-headers \
157
		--with-parallel-jobs=${JOBS:-2} \
158
		--with-hotspot-build=default \
159 160 161 162 163 164 165 166 167
		--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 \
168
		--with-jdk-home="$_bootstrap_java_home" \
169
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
170 171
		--enable-nss \
		--enable-sunec \
172 173
		--enable-non-nss-curves
	make
Timo Teräs's avatar
Timo Teräs committed
174 175
}

176 177 178 179 180 181 182
# TODO: Run tests or at least try to compile and run hello world.
check() {
	cd "$builddir"/openjdk.build/images/j2sdk-image

	./bin/java -version
}

Timo Teräs's avatar
Timo Teräs committed
183
package() {
184 185
	cd "$builddir"

186
	mkdir -p "$pkgdir"/$_java_home
187

188
	cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$_java_home/
189
	rm "$pkgdir"/$_java_home/src.zip
Timo Teräs's avatar
Timo Teräs committed
190

191 192 193
	# 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`.
194
	rm -f "$pkgdir"/$_jrelib/server/classes.jsa
Timo Teräs's avatar
Timo Teräs committed
195

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

199 200
	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts
201
	ln -sf /etc/ssl/certs/java/cacerts \
202
		"$pkgdir"/$_java_home/jre/lib/security/cacerts
Timo Teräs's avatar
Timo Teräs committed
203 204 205 206 207 208
}

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

209 210 211 212 213 214 215 216 217 218 219
	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%/*}
220
		mkdir -p "$subpkgdir"/$_java_home/$dir
221
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir
Timo Teräs's avatar
Timo Teräs committed
222 223 224 225 226
	done
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
227
	local file dir
Timo Teräs's avatar
Timo Teräs committed
228 229

	mkdir -p "$subpkgdir"
230
	for file in jre/bin/policytool \
231 232 233 234 235
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
236
			jre/lib/$_jarch/libjsoundalsa.so \
237 238
			jre/lib/$_jarch/libsplashscreen.so; do

239
		dir=${file%/*}
240
		mkdir -p "$subpkgdir"/$_java_home/$dir
241
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir
242 243 244
	done

	# Pax mark again (due to fakeroot xattr handling bug).
245
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true
246 247 248 249 250 251 252 253 254 255
}

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 \
256
		"$subpkgdir"/$_java_home/lib/$_jarch/
257 258 259

	local file; for file in java orbd rmid servertool unpack200 keytool \
			pack200 rmiregistry tnameserv; do
260
		mv "$pkgdir"/$_java_home/bin/$file "$subpkgdir"/$_java_home/bin/
Timo Teräs's avatar
Timo Teräs committed
261 262
	done

263
	# Rest of the jre subdir (which were not taken by -jre subpkg).
264
	mv "$pkgdir"/$_java_home/jre "$subpkgdir"/$_java_home/
265

266
	# Pax mark again (due to fakeroot xattr handling bug).
267
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true
Timo Teräs's avatar
Timo Teräs committed
268 269 270
}

doc() {
271
	default_doc
Timo Teräs's avatar
Timo Teräs committed
272

273 274
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/
Timo Teräs's avatar
Timo Teräs committed
275 276
}

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

281 282 283
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \
		"$subpkgdir"/$_java_home/
284 285
}

286 287 288 289 290 291 292 293 294
sha512sums="af244a8bdb083e6273de14a04c0f2c21513a9cbe3fd2437c1503f3df88ef7ec77449387e24e4d8cb0fe7dbe0b8b023ea6a3041f145a00560999781027322c697  icedtea-3.10.0.tar.xz
dcd7a9a73ee9fb13317fbf0778e002309194ab035289c4095b3d4940f76dbd21b7b7c7eda414b9208dc6a9eadc078eddbe51900b86b6b1eb66de3b9e15ec0868  openjdk-3.10.0.tar.xz
8593710e672c841b76b4e36b917671545e7204039d0ccb88ab71da41b4690766af48f6bd0b6b4530e58ddb9ab716f9ac448c4d934471c9a9757a32f35340a0fe  corba-3.10.0.tar.xz
47d6691e4cc572e21738452137784bfcc6734b5ac80792e6556d6734596802d7ca0ab7efec1535e0234e32ed20b36647b61ab2b13b7b3356f5c9c4393d7ca73c  jaxp-3.10.0.tar.xz
33f2c248d6f92b68905a5e0f3f308420cc6f980cd0bea52ff534a9af624f6119b00bf5c92f76b2734fd2793fb54ef1759ce66a5f9347b7bbc34e32be381a7f27  jaxws-3.10.0.tar.xz
4c0c68edaa27bf73d4edf69ca44a5c40228b132538c37ae05c522b360c1d7b8899e28ec43873f4b51fe731ff344b78861cec3d6e9eb16565eaa1f224b11e93b2  jdk-3.10.0.tar.xz
8b5d1f221bc920e4fab755732e5db2e4dda944208536cd3703692acf7560e882dbf47195a1ecab7606f2d61a77a2e63a8fdfbc74a2622f11f622d49b2bfa49b2  langtools-3.10.0.tar.xz
265f519a8deb9c94a4e614c0ab0e1e707dc6982bb9e83f19101d8a8ec68f0c27f25edf1f9d5940ed5fe8c3eaa563297a9b4fb6d09a7488dc9c82f21179790f09  hotspot-3.10.0.tar.xz
7bbd0de8738affb24f8fd59bb22db856f3dc247bd3aaa58eba455f3af442c9bd1d0ad563114931104329eac47a30764dde8cc699b09c3729fb26dfd585a25079  nashorn-3.10.0.tar.xz
295
1f470432275d5beaa8b4e4352a2f24a4a00593546dc4f3bd857794c89e521e8e6d6abc540762bbd769be3e1e3da058e134dc5dc066d12b9b8a1f0656040a795c  fix-paxmark.patch
296
09104b19f647dce9ba0835163c05cc7e5e3ec9852b277f22b2d7a02bd483968853544125a09e384e96ba8811f2bbdc9546e05e378582ec6a554ede797ca5ad98  icedtea-hotspot-musl.patch
297
e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef  icedtea-hotspot-musl-ppc.patch
298
3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
299 300
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
301
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
302
1fbc32ddc528c7c0099dbc1e48f88d29dccf55e7b8997793aa1d3d8408003a1223d898cca4248e1a12d343d3feec5144f875e6cdac8460d763c73ab3ad7e49f9  icedtea-jdk-musl.patch
303
e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc  icedtea-jdk-includes.patch
304
7e6fa46b10c630517bfa46943858aea1d032c12d32ba3fcb7a2143ae1e896c34fa4cb8f925af80cb19f8e29149b835aa054adfd30ebb00539f6c78588d6f5211  icedtea-jdk-getmntent-buffer.patch
305
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch
306
9ea7ac942baf29cc619bc2e1acd59201b9f6d38f39a517b495d7613aec746459200c81afb57c5fcdcb856f6bc8b33f7566c8593fed07e5c73f43e08f1072d458  icedtea-jdk-tls-nist-curves.patch"