Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 10.2 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.4.0
6 7
# pkgver is <JDK version>.<JDK update>.<JDK build>
# Check http://icedtea.classpath.org/wiki/Main_Page when updating!
8 9
pkgver=8.131.11
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 28

case $CARCH in
x86)	_jarch=i386;;
x86_64)	_jarch=amd64;;
arm*)	_jarch=arm;;
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 63
	icedtea-hotspot-noagent-musl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-ipv6-init.patch
64
	icedtea-jdk-fix-libjvm-load.patch
Timo Teräs's avatar
Timo Teräs committed
65 66
	icedtea-jdk-musl.patch
	icedtea-jdk-includes.patch
67
	icedtea-autoconf-config.patch
Timo Teräs's avatar
Timo Teräs committed
68
	"
69 70 71 72 73 74 75 76 77 78 79
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
80 81

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

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

87
	local patch; for patch in $source; do
88
		case $patch in
89 90 91
		icedtea-*.patch)
			cp ../$patch patches
			;;
92 93
		*.patch)
			msg "Applying patch $patch"
94
			patch -p1 -i "$srcdir"/$patch || return 1
95 96 97
			;;
		esac
	done
98 99

	./autogen.sh
Timo Teräs's avatar
Timo Teräs committed
100 101 102
}

build() {
103
	export JAVA_HOME="$_bootstrap_java_home"
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
	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"

121
	cd "$builddir"
122
	./configure \
Timo Teräs's avatar
Timo Teräs committed
123 124
		--build=$CBUILD \
		--host=$CHOST \
125
		--prefix="$_java_home" \
Timo Teräs's avatar
Timo Teräs committed
126 127 128 129
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
130 131 132 133 134 135 136 137 138 139 140 141
		--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 \
142
		--with-jdk-home="$_bootstrap_java_home" \
143
		--with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
144 145 146
		--enable-nss \
		--enable-sunec \
		--enable-non-nss-curves \
Timo Teräs's avatar
Timo Teräs committed
147
		|| return 1
148
	make || return 1
Timo Teräs's avatar
Timo Teräs committed
149 150 151
}

package() {
152 153
	cd "$builddir"

154
	mkdir -p "$pkgdir"/$_java_home
155

156 157
	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
158

159 160 161
	# 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`.
162
	rm -f "$pkgdir"/$_jrelib/server/classes.jsa
Timo Teräs's avatar
Timo Teräs committed
163

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

167 168
	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts
169
	ln -sf /etc/ssl/certs/java/cacerts \
170
		"$pkgdir"/$_java_home/jre/lib/security/cacerts
Timo Teräs's avatar
Timo Teräs committed
171 172 173 174 175 176
}

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

177 178 179 180 181 182 183 184 185 186 187
	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%/*}
188 189
		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
190 191 192 193 194
	done
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
195
	local file dir
Timo Teräs's avatar
Timo Teräs committed
196 197

	mkdir -p "$subpkgdir"
198
	for file in jre/bin/policytool \
199 200 201 202 203
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
204
			jre/lib/$_jarch/libjsoundalsa.so \
205 206
			jre/lib/$_jarch/libsplashscreen.so; do

207
		dir=${file%/*}
208 209 210 211 212
		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).
213
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
}

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
229 230
	done

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

234
	# Pax mark again (due to fakeroot xattr handling bug).
235
	"$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1
Timo Teräs's avatar
Timo Teräs committed
236 237 238
}

doc() {
239
	default_doc || return 1
Timo Teräs's avatar
Timo Teräs committed
240

241 242
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/
Timo Teräs's avatar
Timo Teräs committed
243 244
}

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

249 250 251
	mkdir -p "$subpkgdir"/$_java_home/
	mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \
		"$subpkgdir"/$_java_home/
252 253
}

254 255 256 257 258 259 260 261 262
sha512sums="78d3004626138430c5a3d956b652ad2ad57da7732d210baa0f31a83b4ce93b4feb32da6e8655838c7dc3b66a1170377456f5da89077ee9cd3b18ee9c76dce8f1  icedtea-3.4.0.tar.gz
f3cca223bd39c0202dd1a65a38ca17024b6cb5c82d833946ec1b7d28d205833b4dd2dadde505a1c2384e3b28ff0d21a4f175e064b8ac82aa8a07508e53cdc722  openjdk-3.4.0.tar.xz
f0579608ab1342df231c4542dab1c40e648cda8e9780ea584fd47679b07c93508cbfa85f0406d8aa8b9d528fc5bd99c9d41469568fbec41a6456a13d914ac71c  corba-3.4.0.tar.xz
ef3ed47815e6d15f40c5947fee1058c252ac673f70b6bf7c30505faa12fa5cbab8168d816abe7791dc88acec457744883db4c0af23fb2166bbb709e870685bcd  jaxp-3.4.0.tar.xz
867cac2919e715190596ae4f73fa42c6cba839ba48ae940adcef20abfb23ffeeaa2501c4aedc214b3595bc4e2a4eea9fa7e7cac62a3420a11fb30a1f7edc9254  jaxws-3.4.0.tar.xz
180d7b4435e465d68ed0b420b42dddc598c872075e225b8885ae1833fa4ab5034ce5083c4dfba516a21b2d472321b37a01ba92793e17c78e9fddb1e254f12065  jdk-3.4.0.tar.xz
0663f40b07de88cd7939557bf7fdb92077d7ca2132e369caefa82db887261ea02102864d33ec0fef3b2c80dd366d25dbc1a95144139498be581dfabe913e4312  langtools-3.4.0.tar.xz
29bc953d283f0a0a464fa150e2c4d71b0adaa29da67246843d230f370b5a20227fb40ef6a7e3b93f10b0cdec18b0cd2bbbceeaea3c9db4d64c158cc23babbad2  hotspot-3.4.0.tar.xz
79b5095bab447d1911696bc1e328fb72c08764c0139cab14a28c0f6c2e49a2d96bb06fbbb85523b2586672cb0f13709c3158823d5ac3f3fe3f0f88402d3cb246  nashorn-3.4.0.tar.xz
263
1f470432275d5beaa8b4e4352a2f24a4a00593546dc4f3bd857794c89e521e8e6d6abc540762bbd769be3e1e3da058e134dc5dc066d12b9b8a1f0656040a795c  fix-paxmark.patch
264
ada3bc4024682bfb86ebf3850d3a36cf4c0f0677a6d56eac2e0959b92bfe759010d5b9c801b043cae3ca8418d7819546ae245ac163df83e48c5d4b34478daeb0  icedtea-hotspot-musl.patch
265
e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef  icedtea-hotspot-musl-ppc.patch
266
3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
267 268 269
822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a  icedtea-hotspot-uclibc-fixes.patch
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
270
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
271
cdebe2c59657e7fd317a4841b2fbe95d9e8d7ee9d1593edf352ed7f49a92a42cbce82cbaa404d3f02c6d273eae03222a79559c09bf6cf439396c5ec5434f5458  icedtea-jdk-musl.patch
272
e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc  icedtea-jdk-includes.patch
273
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch"