Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 11.1 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.11.0
6
# pkgver is <JDK version>.<JDK update>.<JDK build>
7
# Check https://icedtea.classpath.org/wiki/Main_Page when updating!
8
pkgver=8.201.08
9
pkgrel=1
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 nss"
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
#   8.201.08-r0:
#     - CVE-2019-2422
#     - CVE-2019-2426
#     - CVE-2018-11212
77 78 79 80 81 82 83 84 85 86
#   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
87 88 89 90 91 92 93
#   8.181.13-r0:
#     - CVE-2018-2938
#     - CVE-2018-2940
#     - CVE-2018-2952
#     - CVE-2018-2973
#     - CVE-2018-3639

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

prepare() {
105
	cd "$builddir"
Timo Teräs's avatar
Timo Teräs committed
106

107 108
	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)
109 110 111
	[ "${pkgver#*.}" = "$ver_u.$ver_b" ] \
		|| die "Version mismatch, source is 8.$ver_u.$ver_b, but abuild defines $pkgver!"

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

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

	./autogen.sh
Timo Teräs's avatar
Timo Teräs committed
128 129 130
}

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

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

180 181 182 183 184 185 186
# 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
187
package() {
188 189
	cd "$builddir"

190
	mkdir -p "$pkgdir"/$_java_home
191

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

195 196 197
	# 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`.
198
	rm -f "$pkgdir"/$_jrelib/server/classes.jsa
Timo Teräs's avatar
Timo Teräs committed
199

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

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

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

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

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
231
	local file dir
Timo Teräs's avatar
Timo Teräs committed
232 233

	mkdir -p "$subpkgdir"
234
	for file in jre/bin/policytool \
235 236 237 238 239
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
240
			jre/lib/$_jarch/libjsoundalsa.so \
241 242
			jre/lib/$_jarch/libsplashscreen.so; do

243
		dir=${file%/*}
244
		mkdir -p "$subpkgdir"/$_java_home/$dir
245
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir
246 247 248
	done

	# Pax mark again (due to fakeroot xattr handling bug).
249
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true
250 251 252 253 254 255 256 257 258 259
}

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 \
260
		"$subpkgdir"/$_java_home/lib/$_jarch/
261 262 263

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

267
	# Rest of the jre subdir (which were not taken by -jre subpkg).
268
	mv "$pkgdir"/$_java_home/jre "$subpkgdir"/$_java_home/
269

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

doc() {
275
	default_doc
Timo Teräs's avatar
Timo Teräs committed
276

277 278
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/
Timo Teräs's avatar
Timo Teräs committed
279 280
}

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

285 286 287
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \
		"$subpkgdir"/$_java_home/
288 289
}

290 291 292 293 294 295 296 297 298
sha512sums="a71c9318d49077f8ae27f5c3e0b61df0709eded241f557c886f6b93aa98c13ad78f713d1286da286989bf62866dfff7538ad783eb804a705a160cbc096dea851  icedtea-3.11.0.tar.xz
fc3faa7d7b9531f10c40241d89c36854043921f6f1a0851f284bcab36fc54fb0bb8cf8365dd4b2fb22b3ee8ddb8ed4a79e0807f79cb95b4b00f164993f1acc0b  openjdk-3.11.0.tar.xz
9b8a44dda0bbfba8dc0d659e0fabf22e84b9931518e4b199a238faa103cbc4ed814c97f0f38f0aed263846b46fc7eab4500ba9759503373083e12cb8b5b364b5  corba-3.11.0.tar.xz
9eba0f6ada2ae8adc1791a91ceb4fba9bd06aee0626cd1b4310ff16c7c8006045fed5fb7f109e490395b70695be4e6bfd6f1f5cbcdb095fb17abf123012a03de  jaxp-3.11.0.tar.xz
ce5f0c2aced1af59f002dc9dc6cba4b9332167e9e019a3040267901ef7f325e05b8c99ed1f276b88ddb4e43cdd1b0c456e0c4dc2222ae6b3800c0502ffa840de  jaxws-3.11.0.tar.xz
411508ed91f14ae1c51ea54de72a943db222ff572f3991631fe1a1fa97f9bb42da1e01ca98893f7236b4b44bae2917fc3f8622d7f94a085be30d437451acd272  jdk-3.11.0.tar.xz
363c376848870c6c28415967561c4b151f1256c38a315fabc69c90425f5255224182045349a00c9433db52c416b7ebffedaa4825c980460541a3f9338adbaa5e  langtools-3.11.0.tar.xz
13fa35f4a4fe01b3da4efb8476c0cb3482a36596eb422f2ad958a4c51efc286962ac3123a75853e84c4db477ac064a0fd3ee5e03f1ea0ec4f7e2c8ac07aa2d0e  hotspot-3.11.0.tar.xz
2b46a8599d530a351522420cae8ac780cd2e64a6d7adbff87397a178f12f0a992bccd0f56435582dbd10be2157d4a4540c41b3dca488566162eed680102e58a9  nashorn-3.11.0.tar.xz
299
1f470432275d5beaa8b4e4352a2f24a4a00593546dc4f3bd857794c89e521e8e6d6abc540762bbd769be3e1e3da058e134dc5dc066d12b9b8a1f0656040a795c  fix-paxmark.patch
300
09104b19f647dce9ba0835163c05cc7e5e3ec9852b277f22b2d7a02bd483968853544125a09e384e96ba8811f2bbdc9546e05e378582ec6a554ede797ca5ad98  icedtea-hotspot-musl.patch
301
e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef  icedtea-hotspot-musl-ppc.patch
302
19459dbb922f5a71cd15b53199481498626a783c24f91d2544d55b7dddd2cdb34a64bbf0226b99548612dd1743af01b3f9ff32c30abbbc90ce727ca2dbbbd1f9  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
303 304
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
305
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
306
1fbc32ddc528c7c0099dbc1e48f88d29dccf55e7b8997793aa1d3d8408003a1223d898cca4248e1a12d343d3feec5144f875e6cdac8460d763c73ab3ad7e49f9  icedtea-jdk-musl.patch
307
e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc  icedtea-jdk-includes.patch
308
7e6fa46b10c630517bfa46943858aea1d032c12d32ba3fcb7a2143ae1e896c34fa4cb8f925af80cb19f8e29149b835aa054adfd30ebb00539f6c78588d6f5211  icedtea-jdk-getmntent-buffer.patch
309
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch
310
9ea7ac942baf29cc619bc2e1acd59201b9f6d38f39a517b495d7613aec746459200c81afb57c5fcdcb856f6bc8b33f7566c8593fed07e5c73f43e08f1072d458  icedtea-jdk-tls-nist-curves.patch"