Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 10.8 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.5.1
6 7
# pkgver is <JDK version>.<JDK update>.<JDK build>
# Check http://icedtea.classpath.org/wiki/Main_Page when updating!
8 9
pkgver=8.144.01
pkgrel=0
10 11 12
pkgdesc="OpenJDK 8 provided by IcedTea"
url="http://icedtea.classpath.org/"
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 45
_dropsver=$_icedteaver
_dropsurl="http://icedtea.classpath.org/download/drops/icedtea8/$_dropsver"
Timo Teräs's avatar
Timo Teräs committed
46

47 48 49 50 51 52 53 54 55
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
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 72 73 74 75 76 77 78 79 80
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
}
Timo Teräs's avatar
Timo Teräs committed
81 82

prepare() {
83
	cd "$builddir"
Timo Teräs's avatar
Timo Teräs committed
84

85 86 87 88 89
	local ver_u=$(sed -En 's/^JDK_UPDATE_VERSION\s*=\s*(\S+).*/\1/p' Makefile.am)
	local ver_b=$(sed -En 's/^BUILD_VERSION\s*=\s*b(\S+).*/\1/p' Makefile.am)
	[ "${pkgver#*.}" = "$ver_u.$ver_b" ] \
		|| die "Version mismatch, source is 8.$ver_u.$ver_b, but abuild defines $pkgver!"

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

93
	local patch; for patch in $source; do
94
		case $patch in
95 96 97
		icedtea-*.patch)
			cp ../$patch patches
			;;
98 99
		*.patch)
			msg "Applying patch $patch"
100
			patch -p1 -i "$srcdir"/$patch || return 1
101 102 103
			;;
		esac
	done
104 105

	./autogen.sh
Timo Teräs's avatar
Timo Teräs committed
106 107 108
}

build() {
109
	export JAVA_HOME="$_bootstrap_java_home"
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
	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"

127
	cd "$builddir"
128
	./configure \
Timo Teräs's avatar
Timo Teräs committed
129 130
		--build=$CBUILD \
		--host=$CHOST \
131
		--prefix="$_java_home" \
Timo Teräs's avatar
Timo Teräs committed
132 133 134 135
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
136 137
		--disable-dependency-tracking \
		--disable-downloading \
138
		--disable-precompiled-headers \
139
		--with-parallel-jobs=${JOBS:-2} \
140
		--with-hotspot-build=default \
141 142 143 144 145 146 147 148 149
		--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 \
150
		--with-jdk-home="$_bootstrap_java_home" \
151
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
152 153 154
		--enable-nss \
		--enable-sunec \
		--enable-non-nss-curves \
Timo Teräs's avatar
Timo Teräs committed
155
		|| return 1
156
	make || return 1
Timo Teräs's avatar
Timo Teräs committed
157 158
}

159 160 161 162 163 164 165
# 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
166
package() {
167 168
	cd "$builddir"

169
	mkdir -p "$pkgdir"/$_java_home
170

171 172
	cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$_java_home/ || return 1
	rm "$pkgdir"/$_java_home/src.zip
Timo Teräs's avatar
Timo Teräs committed
173

174 175 176
	# 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`.
177
	rm -f "$pkgdir"/$_jrelib/server/classes.jsa
Timo Teräs's avatar
Timo Teräs committed
178

179
	# pax mark again (due to fakeroot xattr handling bug)
180
	./pax-mark-vm "$pkgdir"/$_java_home true || return 1
181

182 183
	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts
184
	ln -sf /etc/ssl/certs/java/cacerts \
185
		"$pkgdir"/$_java_home/jre/lib/security/cacerts
Timo Teräs's avatar
Timo Teräs committed
186 187 188 189 190 191
}

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

192 193 194 195 196 197 198 199 200 201 202
	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%/*}
203 204
		mkdir -p "$subpkgdir"/$_java_home/$dir
		mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir || return 1
Timo Teräs's avatar
Timo Teräs committed
205 206 207 208 209
	done
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
210
	local file dir
Timo Teräs's avatar
Timo Teräs committed
211 212

	mkdir -p "$subpkgdir"
213
	for file in jre/bin/policytool \
214 215 216 217 218
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
219
			jre/lib/$_jarch/libjsoundalsa.so \
220 221
			jre/lib/$_jarch/libsplashscreen.so; do

222
		dir=${file%/*}
223 224 225 226 227
		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).
228
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
}

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
Timo Teräs's avatar
Timo Teräs committed
244 245
	done

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

249
	# Pax mark again (due to fakeroot xattr handling bug).
250
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1
Timo Teräs's avatar
Timo Teräs committed
251 252 253
}

doc() {
254
	default_doc || return 1
Timo Teräs's avatar
Timo Teräs committed
255

256 257
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/
Timo Teräs's avatar
Timo Teräs committed
258 259
}

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

264 265 266
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \
		"$subpkgdir"/$_java_home/
267 268
}

269 270 271 272 273 274 275 276 277
sha512sums="c806032e5337fdd516dc7e616608fd50e31406eab21ae31a61a0d30acf2ecf1eb28d162d558e60f04ad2bdfea1f1888601427751ee5efaacc8161f3fa89afbb0  icedtea-3.5.1.tar.gz
13ea05cdc90f18a1600c7771314fcf2d07bfef186e7fe9125cf37e4a62f51a1d26dab653ee294fd9079419b3297f812c6b9c516def11ede8355dd2f6d8e7a08a  openjdk-3.5.1.tar.xz
19d4e311edd3ed5f388373e3c819a9317dbaa561c4a22c924079cef284d16ce06d5468510b84fe3f1867570e8caed915ec4edc2479bd44686493bcf9fbf523de  corba-3.5.1.tar.xz
5f932ce9453412d3a1b3108cf143836712cc46676093441b02db24652d4d30dbf21849cbb6fe75071961312c747289b8feccdf23c94b9e9ab2b78bdefd7c72df  jaxp-3.5.1.tar.xz
3259181c303fc1642816e5d3291d81e80fb62764edd38734876e9581d4d1fcb718bf5f2cc8dbf0362f218105effa50fa50a4e4b79e08501e991ff4bdbbf881cb  jaxws-3.5.1.tar.xz
9f60583ffd61d8dec73f17c7dbbf12e275c9c46b8cbafc59a969b11a0b65ae1f6366051fc1c76538b217a2b55510e112a815b279a9c19046f7035d2680ca2b9f  jdk-3.5.1.tar.xz
856fecddf01c6eb89055bd905d0df1d61d4a1605f4663ff33357c1d4372150ddf4d5d2e6e8f2c4d8c92071075b7090c9fdbe5a10d2c0c61b1d242fe938dc1b8c  langtools-3.5.1.tar.xz
c16b5db736b553acb74bce50f37213a181fc26a6fdc7ef9242aa40c46afea78e52ec08a167f5fe29023e0ecef1f92b45b51250208d63ef88f5686fe2b12d4c34  hotspot-3.5.1.tar.xz
3e3ca6942b32c1b342a108cdd08d72da49249c88c4f5da04b2e822dcb12d144584a10eb7e5c109f9bf49cd84ab957577db83d55ff31471ef76b0748b44b54896  nashorn-3.5.1.tar.xz
278
1f470432275d5beaa8b4e4352a2f24a4a00593546dc4f3bd857794c89e521e8e6d6abc540762bbd769be3e1e3da058e134dc5dc066d12b9b8a1f0656040a795c  fix-paxmark.patch
279
bfa16565d71453a0ba4204cb7ee0f8cb8c9a272c4d71d1357af4425183e64ef8df77ae1df1bbb0f984cf2d6d04a49124a6ef50f09dfee80c5b5734596e0b2a8e  icedtea-hotspot-musl.patch
280
e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef  icedtea-hotspot-musl-ppc.patch
281
3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
282 283
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
284
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
285
cdebe2c59657e7fd317a4841b2fbe95d9e8d7ee9d1593edf352ed7f49a92a42cbce82cbaa404d3f02c6d273eae03222a79559c09bf6cf439396c5ec5434f5458  icedtea-jdk-musl.patch
286
e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc  icedtea-jdk-includes.patch
287
7e6fa46b10c630517bfa46943858aea1d032c12d32ba3fcb7a2143ae1e896c34fa4cb8f925af80cb19f8e29149b835aa054adfd30ebb00539f6c78588d6f5211  icedtea-jdk-getmntent-buffer.patch
288 289
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch
313ba3467efad73120d307c16be8e793fa39de92d6c28c2faed11c14dd6f60e0f1a290f330d4dc849ae8f97c7bea84eec2d0be02c70bc9903664e22497dd2d22  icedtea-jdk-tls-nist-curves.patch"