APKBUILD 12.4 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 6 7 8 9 10 11 12
_icedteaver=3.1.0
# pkgver is <JDK version>.<JDK update>.<JDK build>
# Check http://icedtea.classpath.org/wiki/Main_Page when updating!
pkgver=8.101.13
pkgrel=0
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 19 20 21
	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
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 32 33 34 35 36 37 38
esac

INSTALL_BASE=/usr/lib/jvm/java-1.8-openjdk
BOOTSTRAP_JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk
_jrelib="$INSTALL_BASE/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"
39
sonameprefix="$pkgname:"
Timo Teräs's avatar
Timo Teräs committed
40 41

subpackages="$pkgname-jre-lib:jrelib $pkgname-jre $pkgname-jre-base:jrebase
42
	$pkgname-doc:doc $pkgname-demos: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
Timo Teräs's avatar
Timo Teräs committed
56 57 58 59 60 61

	icedtea-hotspot-musl.patch
	icedtea-hotspot-noagent-musl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-ipv6-init.patch
62
	icedtea-jdk-fix-libjvm-load.patch
Timo Teräs's avatar
Timo Teräs committed
63 64
	icedtea-jdk-musl.patch
	icedtea-jdk-includes.patch
65
	icedtea-autoconf-config.patch
Timo Teräs's avatar
Timo Teräs committed
66 67
	"

68 69 70 71 72 73 74 75 76 77 78
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
79 80

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

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

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

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

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

120
	cd "$builddir"
121
	./configure \
Timo Teräs's avatar
Timo Teräs committed
122 123 124 125 126 127 128
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=$INSTALL_BASE \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
129 130 131 132 133 134 135 136 137 138 139 140 141 142
		--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}" \
Timo Teräs's avatar
Timo Teräs committed
143
		|| return 1
144
	make || return 1
Timo Teräs's avatar
Timo Teräs committed
145 146 147
}

package() {
148 149
	cd "$builddir"

Timo Teräs's avatar
Timo Teräs committed
150
	mkdir -p "$pkgdir"/$INSTALL_BASE
151 152

	cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$INSTALL_BASE/ || return 1
153
	rm "$pkgdir"/$INSTALL_BASE/src.zip
Timo Teräs's avatar
Timo Teräs committed
154

155 156 157 158
	# 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
Timo Teräs's avatar
Timo Teräs committed
159

160 161
	# Pax mark again (due to fakeroot xattr handling bug).
	./pax-mark-vm "$pkgdir"/$INSTALL_BASE
162

163
	# Symlink to shared java cacerts store.
164 165 166
	rm -f "$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts
	ln -sf /etc/ssl/certs/java/cacerts \
		"$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts
Timo Teräs's avatar
Timo Teräs committed
167 168 169 170 171 172 173
}

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

174 175 176 177 178 179 180 181 182 183 184 185 186
	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"/$INSTALL_BASE/$dir
		mv "$pkgdir"/$INSTALL_BASE/$file "$subpkgdir"/$INSTALL_BASE/$dir || return 1
Timo Teräs's avatar
Timo Teräs committed
187 188 189 190 191
	done
}

jrebase() {
	pkgdesc="OpenJDK 8 Java Runtime (no GUI support)"
192
	depends="$pkgname-jre-lib java-common java-cacerts"
Timo Teräs's avatar
Timo Teräs committed
193

194 195
	mkdir -p "$subpkgdir"/$INSTALL_BASE/bin \
		"$subpkgdir"/$INSTALL_BASE/lib/$_jarch
Timo Teräs's avatar
Timo Teräs committed
196

197 198
	mv "$pkgdir"/$INSTALL_BASE/lib/$_jarch/jli \
		"$subpkgdir"/$INSTALL_BASE/lib/$_jarch/ || return 1
199 200

	local file; for file in java orbd rmid servertool unpack200 keytool \
201
			pack200 rmiregistry tnameserv; do
202
		mv "$pkgdir"/$INSTALL_BASE/bin/$file "$subpkgdir"/$INSTALL_BASE/bin/ || return 1
Timo Teräs's avatar
Timo Teräs committed
203 204
	done

205 206
	# Rest of the jre subdir (which were not taken by -jre subpkg).
	mv "$pkgdir"/$INSTALL_BASE/jre "$subpkgdir"/$INSTALL_BASE/ || return 1
Timo Teräs's avatar
Timo Teräs committed
207

208 209
	# Pax mark again (due to fakeroot xattr handling bug).
	"$builddir"/pax-mark-vm "$subpkgdir"/$INSTALL_BASE
Timo Teräs's avatar
Timo Teräs committed
210 211 212 213
}

jre() {
	pkgdesc="OpenJDK 8 Java Runtime"
214
	local file dir
Timo Teräs's avatar
Timo Teräs committed
215 216

	mkdir -p "$subpkgdir"
217
	for file in jre/bin/policytool \
218 219 220 221 222 223 224
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/libawt_xawt.so \
			jre/lib/$_jarch/libfontmanager.so \
			jre/lib/$_jarch/libjawt.so \
			jre/lib/$_jarch/libsplashscreen.so; do

225 226 227
		dir=${file%/*}
		mkdir -p "$subpkgdir"/$INSTALL_BASE/$dir
		mv "$pkgdir"/$INSTALL_BASE/$file "$subpkgdir"/$INSTALL_BASE/$dir || return 1
Timo Teräs's avatar
Timo Teräs committed
228 229
	done

230 231
	# Pax mark again (due to fakeroot xattr handling bug).
	"$builddir"/pax-mark-vm "$subpkgdir"/$INSTALL_BASE
Timo Teräs's avatar
Timo Teräs committed
232 233 234
}

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

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

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

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

250 251 252 253 254 255 256 257 258
md5sums="7b54dacd18f3adc0d77008d15db2b5c6  icedtea-3.1.0.tar.gz
1b9b9e9102abfc387acb4d244580fb9a  openjdk-3.1.0.tar.xz
d697eb0b8df5ee5242768be1678f1684  corba-3.1.0.tar.xz
a3cbe28e27ebff38c8475ecae56ad446  jaxp-3.1.0.tar.xz
92da27a8622b92ee60ca67452f695927  jaxws-3.1.0.tar.xz
e2143b152be03f3ec66313294606c100  jdk-3.1.0.tar.xz
39c75541d8bbe9be9cfd7f58c0950641  langtools-3.1.0.tar.xz
d4d70521fee922201c309a64be22b239  hotspot-3.1.0.tar.xz
3c266698f3b192fd5616ce9548d1ead2  nashorn-3.1.0.tar.xz
Timo Teräs's avatar
Timo Teräs committed
259
f87dd2c4c3c97fc3ac33080a65ca9e14  icedtea-hotspot-musl.patch
260
bd148291e75d536972cb2b1b68e5cb05  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
261 262 263
43023861c5f6efc3139a834aa3ec0476  icedtea-hotspot-uclibc-fixes.patch
bdea7060a067faf1c2de5f4eb6e8525d  icedtea-jdk-execinfo.patch
250b0807b59762670954b132e8f8dfba  icedtea-jdk-fix-ipv6-init.patch
264 265 266 267 268 269 270 271 272 273 274 275 276
4dcba8ae18346298c0d0b817f6922415  icedtea-jdk-fix-libjvm-load.patch
b708c7630efb0b0fe7bb3eca58cb1629  icedtea-jdk-musl.patch
da4b0b67d9b5c7f742bcea70722acd94  icedtea-jdk-includes.patch
d13bf1213635a702611af295d3977fe1  icedtea-autoconf-config.patch"
sha256sums="694477835af753d59b5f03f4939a6015d7d4a00e5e5bb3d5c9e3e5186d3163e1  icedtea-3.1.0.tar.gz
c19f7ffaec510db20b3c66b6447040012c28df319ab1dcfaf0a41c0e807bdddc  openjdk-3.1.0.tar.xz
5e334d4250de441517c0e761a3202dfdf4beacb75c0f7a03617b62d89cb71c21  corba-3.1.0.tar.xz
6d58edfd2b7f07b4d543910f7525fe08d94d56899b96493efce217b4a226aca3  jaxp-3.1.0.tar.xz
811ad76dfcffe1e6f2ef39a088f27a8858ed3371ef93816c8dc453f90516c7d7  jaxws-3.1.0.tar.xz
83880a4b865e33e7913bec603da1e5439ea3602b3540d8071408de7bef8162a9  jdk-3.1.0.tar.xz
2a7f8dd0b0c1b256c58b8e841033b7915beb08d983350f9a9357115a05677f1d  langtools-3.1.0.tar.xz
33581ea3ef4deffa786be82e110ae3d6b0431cc56140eb51453af1f11962b174  hotspot-3.1.0.tar.xz
56b36f5f7c073b140f8316084a23080553d8790d9f1f7e6d6288c6b0fd45cd7f  nashorn-3.1.0.tar.xz
Timo Teräs's avatar
Timo Teräs committed
277
a7922430cb767c8a4baae232c8b2e5f377aeb7cfde0c9901cd7774f078e7f92e  icedtea-hotspot-musl.patch
278
c14529a29bfdfb51bf5b4a41c977039073f470758e31235d043d373b48d46a11  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
279 280 281
0ef7592b8f2c954eda0a6cf4dc4a4010942f35ea426f44e34412be6c9a949745  icedtea-hotspot-uclibc-fixes.patch
a35d40f24098747cdb73d9c3742cfb4aecafa0f72c9dfdfe2cb460f9706ff665  icedtea-jdk-execinfo.patch
632683ec88a6fb250ef043aae9cace605d0c669b7058f8c47b62b09b03ecc6c5  icedtea-jdk-fix-ipv6-init.patch
282 283 284 285 286 287 288 289 290 291 292 293 294
c0f7e07293883142d7d7776c9e43a3bba7d45e4abbce6dc0fb531d25ed836ed4  icedtea-jdk-fix-libjvm-load.patch
749f9a5644253caaa0dc5b1d3ee31ed61e1392fdd127d6c68eef367902fe834c  icedtea-jdk-musl.patch
8f4edc784fd70b27f91a0acf05a1de19fc300a35852b74668332ed747ec52073  icedtea-jdk-includes.patch
51ced4c77b97744fd0ecfbeca3f94e2da1fc5072dac7830c141f70887c503c33  icedtea-autoconf-config.patch"
sha512sums="5543f3ffcbf06afbdc94555361af9823707586769d95f6294865a0bfc5b1526aaf84d7b2bf826a481ef26d70b8b9a398f08e0d72654b5ca41c2ec0d2e6c68cd3  icedtea-3.1.0.tar.gz
f2b40a39418e9df667a871293629cec85a8b43edd9051caf80961e1b92916e7a7509dfebaaf6c461ff0d51e6e8d653d7584de8ff35fb7229e8def6ee0f8ddadc  openjdk-3.1.0.tar.xz
9b0ebefec9cdc6b653b7b88b2db4c7dd7aebe0e120c23e967cf3433837bc52c65b31da36034161d1c7ae18ddc18a2a5294b2a1469eeec23c7817ef1530909d67  corba-3.1.0.tar.xz
e7e605937292f37aa8a5510f3bfda20ccdeee17d6cbe5a69260eddbb7f39733ef9dd7d91ffd3e968aee926d1c21b4ace2522cb28687915168baf070b0fe38354  jaxp-3.1.0.tar.xz
0fd71e75e38a90e4d74477c9c7a2843d3b7fb9430332fa18a1a2f36376918832f6091bc3f2de86900e332bb4fc11a480ce7aedafeaddc3fc93493944183dc42a  jaxws-3.1.0.tar.xz
9fb70cd63412c4de7112fa1645b485ef5840dc21ff8fc35c12a10d843b879d6400a6109634351974257a1e12d2843ad4b22811d4d9662cbe2e2114838bd6cba8  jdk-3.1.0.tar.xz
c6eb7b5287cb7dbf518ac9d7167b9e63df086b9abe893adfc72b7ba5d9e0a16861fa72b5fbb46ce58bd02cf837b81d03cd1b860dea947a9e58ff39a8d62411ee  langtools-3.1.0.tar.xz
8fcd3934afb446cd683f991f99c2b22fbeee607a1221665d7300d1e8d53740d7d2fee7894ccc53cddb02b902acaff68fd3ca1454dc244feeb641f5d5fd6308b4  hotspot-3.1.0.tar.xz
61f060f02a8852681212ac26018de0ad3403156f9c1fb984c658fa31bc4e58a0da588188c57d629da022b32c763c2f5915a8938997c6f94b127ceacde8d050f9  nashorn-3.1.0.tar.xz
Timo Teräs's avatar
Timo Teräs committed
295
994e8a79a0a23f26d633bf2ce9dad62198c699892f6e7729cc6e509481330399bb2ba736514b516fd2b3dd125fd6c74a127ae7f16d643c3f6a69776737cdb933  icedtea-hotspot-musl.patch
296
3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224  icedtea-hotspot-noagent-musl.patch
Timo Teräs's avatar
Timo Teräs committed
297 298 299
822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a  icedtea-hotspot-uclibc-fixes.patch
f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f  icedtea-jdk-execinfo.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
300 301 302 303
b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471  icedtea-jdk-fix-libjvm-load.patch
dc41a132e310101dfdd0d3e17eba8a53acb67392ab0d16cf09d24084ab467921a9ebfa33cde0e4e63e65c55ce7edcaf12edee10eea66e37b12ac9dba0419ac61  icedtea-jdk-musl.patch
c6caaa69a75dfcf922f7a700a4c780568ead18e8774b9df2c1d86d1ab9f5a21c239952c4053f0f839b4255c0da69d2f42cdd87637db7cf5333076872f63580e0  icedtea-jdk-includes.patch
662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167  icedtea-autoconf-config.patch"