aboutsummaryrefslogtreecommitdiffstats
path: root/community/openjdk7/APKBUILD
blob: 3d88b9ad070917990bac5d9933c7986222103da9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# Contributor: Timo Teras <timo.teras@iki.fi>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openjdk7
_icedteaver=2.6.24
_icedteaversrc=$_icedteaver
# pkgver is <JDK version>.<JDK update>
# check icedtea JDK when updating
pkgver=7.281.$_icedteaver
pkgrel=0
pkgdesc="OpenJDK 7 via IcedTea"
url="https://icedtea.classpath.org/"
# no bootstrap JDK on mips
arch="all !mips !mips64"
license="GPL-2.0 with Classpath"
depends="$pkgname-jre java-cacerts"
options="sover-namecheck"
makedepends="bash findutils tar zip file gawk util-linux libxslt
	autoconf automake linux-headers coreutils 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
	gtk+2.0-dev krb5-dev pcsc-lite-dev lksctp-tools-dev
	libxcomposite-dev nss-static xz"

# upstream binary versions
_rhino_ver=1.7.7.2 # rhino 1.7.8 is java 8+ only
_ant_ver=1.9.14

case $CARCH in
x86)		_jarch=i386;;
x86_64)		_jarch=amd64;;
aarch64)	_jarch=aarch64;;
arm*)		_jarch=arm
		# openjdk has quite a bit of arm assembly producing textrels
		# and it's non trivial to fix. allow it for now.
		options="$options textrels";;
s390x)		_jarch=s390x;;
ppc64le)	_jarch=ppc64le;;
esac

_install_base=/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"
sonameprefix="$pkgname:"

subpackages="$pkgname-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase
	$pkgname-doc:doc"

if [ "$BOOTSTRAP" != "no" ]; then
	makedepends="$makedepends java-gcj-compat"
	BOOTSTRAP_JAVA_HOME=/usr/lib/jvm/java-1.5-gcj/
else
	makedepends="$makedepends $pkgname"
	BOOTSTRAP_JAVA_HOME="$_install_base"
fi

_dropsver=$_icedteaver
_dropsurl=https://icedtea.classpath.org/download/drops/icedtea7/$_dropsver

source="https://icedtea.classpath.org/download/source/icedtea-$_icedteaversrc.tar.xz
	openjdk-$_dropsver.tar.bz2::$_dropsurl/openjdk.tar.bz2
	corba-$_dropsver.tar.bz2::$_dropsurl/corba.tar.bz2
	jaxp-$_dropsver.tar.bz2::$_dropsurl/jaxp.tar.bz2
	jaxws-$_dropsver.tar.bz2::$_dropsurl/jaxws.tar.bz2
	jdk-$_dropsver.tar.bz2::$_dropsurl/jdk.tar.bz2
	langtools-$_dropsver.tar.bz2::$_dropsurl/langtools.tar.bz2
	hotspot-$_dropsver.tar.bz2::$_dropsurl/hotspot.tar.bz2
	https://archive.apache.org/dist/ant/binaries/apache-ant-$_ant_ver-bin.tar.gz
	https://github.com/mozilla/rhino/releases/download/Rhino${_rhino_ver//./_}_Release/rhino-$_rhino_ver.zip

	icedtea-hotspot-musl.patch
	icedtea-hotspot-musl-ppc.patch
	icedtea-hotspot-noagent-musl.patch
	icedtea-hotspot-uclibc-fixes.patch
	icedtea-jdk-execinfo.patch
	icedtea-jdk-fix-build.patch
	icedtea-jdk-fix-compile-optional.patch
	icedtea-jdk-fix-gcc10.patch
	icedtea-jdk-fix-ipv6-init.patch
	icedtea-jdk-musl.patch
	icedtea-jdk-no-soname.patch
	icedtea-jdk-xattr.patch
	icedtea-cpio.patch
	icedtea-jdk-disable-vfork.patch

	fix-xattr-include.patch
	"

# secfixes:
#   7.281.2.6.24-r0:
#     - CVE-2019-2745
#     - CVE-2020-14779
#     - CVE-2020-14781
#     - CVE-2020-14782
#     - CVE-2020-14792
#     - CVE-2020-14796
#     - CVE-2020-14797
#     - CVE-2020-14798
#   7.261.2.6.22-r0:
#     - CVE-2020-2756
#     - CVE-2020-2757
#     - CVE-2020-2773
#     - CVE-2020-2781
#     - CVE-2020-2800
#     - CVE-2020-2803
#     - CVE-2020-2805
#     - CVE-2020-2830
#   7.251.2.6.21-r0:
#     - CVE-2020-2583
#     - CVE-2020-2590
#     - CVE-2020-2593
#     - CVE-2020-2601
#     - CVE-2020-2604
#     - CVE-2020-2654
#     - CVE-2020-2659
#   7.241.2.6.20-r0:
#     - CVE-2019-2894
#     - CVE-2019-2933
#     - CVE-2019-2945
#     - CVE-2019-2949
#     - CVE-2019-2958
#     - CVE-2019-2962
#     - CVE-2019-2964
#     - CVE-2019-2973
#     - CVE-2019-2978
#     - CVE-2019-2981
#     - CVE-2019-2983
#     - CVE-2019-2987
#     - CVE-2019-2988
#     - CVE-2019-2989
#     - CVE-2019-2992
#     - CVE-2019-2999
#   7.231.2.6.19-r0:
#     - CVE-2019-2766
#     - CVE-2019-2769
#     - CVE-2019-2786
#     - CVE-2019-2816
#     - CVE-2019-2842
#   7.221.2.6.18-r0:
#     - CVE-2019-2602
#     - CVE-2019-2684
#     - CVE-2019-2698
#   7.211.2.6.17-r0:
#     - CVE-2018-11212
#     - CVE-2019-2422
#     - CVE-2019-2426
#   7.201.2.6.16-r0:
#     - CVE-2018-3136
#     - CVE-2018-3139
#     - CVE-2018-3149
#     - CVE-2018-3169
#     - CVE-2018-3180
#     - CVE-2018-3214
#     - CVE-2018-13785

builddir="$srcdir/icedtea-$_icedteaver"

unpack() {
	if [ -z "$force" ]; then
		verify
		initdcheck
	fi
	mkdir -p "$srcdir"
	msg "Unpacking sources..."
	unxz -c icedtea-$_icedteaversrc.tar.xz | tar -C "$srcdir" -x
	tar -C "$srcdir" -xf apache-ant-$_ant_ver-bin.tar.gz
	unzip -o -q "rhino-$_rhino_ver.zip" -d "$srcdir"
}

prepare() {
	# Busybox sha256 does not support longopts
	sed -e "s/--check/-c/g" -i Makefile.am

	for patch in $source; do
		case $patch in
		icedtea-*.patch)
			cp ../$patch patches
			;;
		*.patch)
			msg "Applying patch $patch"
			patch -p1 -i "$srcdir"/$patch
			;;
		esac
	done

	./autogen.sh
}

build() {
	[ -z "$JOBS" ] && export JOBS=$(echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p')
	export ALT_PARALLEL_COMPILE_JOBS="${JOBS:-2}"
	export HOTSPOT_BUILD_JOBS="${JOBS:-2}"

	export JAVA_HOME=$BOOTSTRAP_JAVA_HOME
	export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$_ant_ver/bin:$PATH
	export DISTRIBUTION_PATCHES=""

	# Explicitly set the C++ standard as the default has changed on GCC 6+
	# and disable optimizations that lead to a broken JVM. These options
	# has been adopted from the Fedora package.
	export EXTRA_CPP_FLAGS="$CXXFLAGS -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"
	# CXXFLAGS doesn't make it to all calls, so we set the C++ standard
	# version for C too.
	export EXTRA_CFLAGS="$CFLAGS -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow"

	local patch
	for patch in $source; do
		case $patch in
		icedtea-*.patch)
			export DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch"
			;;
		esac
	done
	echo "icedtea patches: $DISTRIBUTION_PATCHES"

	# --disable-arm32-jit: https://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2942
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=$_install_base \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-parallel-jobs=${JOBS:-2} \
		--disable-dependency-tracking \
		--disable-downloading \
		--disable-arm32-jit \
		--disable-docs \
		--with-rhino=$srcdir/rhino$_rhino_ver/lib/rhino-$_rhino_ver.jar \
		--with-openjdk-src-zip=$srcdir/openjdk-$_dropsver.tar.bz2 \
		--with-hotspot-src-zip=$srcdir/hotspot-$_dropsver.tar.bz2 \
		--with-corba-src-zip=$srcdir/corba-$_dropsver.tar.bz2 \
		--with-jaxp-src-zip=$srcdir/jaxp-$_dropsver.tar.bz2 \
		--with-jaxws-src-zip=$srcdir/jaxws-$_dropsver.tar.bz2 \
		--with-jdk-src-zip=$srcdir/jdk-$_dropsver.tar.bz2 \
		--with-langtools-src-zip=$srcdir/langtools-$_dropsver.tar.bz2 \
		--with-jdk-home=$BOOTSTRAP_JAVA_HOME \
		--with-pkgversion="Alpine $pkgver-r$pkgrel"

	msg "Icedtea boot"
	make icedtea-boot SHELL=/bin/bash
	msg "Icedtea boot done"
	make
}

package() {
	mkdir -p "$pkgdir"/$_install_base
	cp -a "$builddir"/openjdk.build/j2sdk-image/* "$pkgdir"/$_install_base
	rm "$pkgdir"/$_install_base/src.zip

	# symlink to shared java cacerts store
	rm -f "$pkgdir"/$_install_base/jre/lib/security/cacerts
	ln -sf /etc/ssl/certs/java/cacerts \
		"$pkgdir"/$_install_base/jre/lib/security/cacerts
}

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

	local a; for a in jre/lib/zi 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

		local dirname=${a%/*}
		mkdir -p "$subpkgdir"/$_install_base/$dirname
		mv "$pkgdir"/$_install_base/$a "$subpkgdir"/$_install_base/$dirname
	done
}

jrebase() {
	pkgdesc="OpenJDK 7 Java Runtime (no GUI support)"
	depends="$pkgname-jre-lib java-common java-cacerts"

	mkdir -p "$subpkgdir"/$_install_base/bin

	local a; for a in java orbd rmid servertool unpack200 keytool \
			pack200 rmiregistry tnameserv; do
		mv "$pkgdir"/$_install_base/bin/$a "$subpkgdir"/$_install_base/bin
	done

	# rest of the jre subdir (which were not taken by -jre subpkg)
	mv "$pkgdir"/$_install_base/jre "$subpkgdir"/$_install_base
}

jre() {
	pkgdesc="OpenJDK 7 Java Runtime"
	# manually depend to avoid clash with libgcj's libjvm.so
	depends="so:openjdk7:libjvm.so=0"

	mkdir -p "$subpkgdir"
	local a; for a in jre/bin/policytool \
			bin/appletviewer \
			bin/policytool \
			jre/lib/$_jarch/xawt \
			jre/lib/$_jarch/libsplashscreen.so; do

		local dirname=${a%/*}
		mkdir -p "$subpkgdir"/$_install_base/$dirname
		mv "$pkgdir"/$_install_base/$a "$subpkgdir"/$_install_base/$dirname
	done
}

doc() {
	default_doc
	mkdir -p "$subpkgdir"/$_install_base/
	mv "$pkgdir"/$_install_base/man "$subpkgdir"/$_install_base/
}

sha512sums="db97bd4106f732cab64528b5d087ea56333d9b0916f238a58b84d44bc8602ca64419f827afca483c0ba9538986bbf0bf5b92683b6f96d8df047b334328d76d11  icedtea-2.6.24.tar.xz
fb5bd58480194b556ecfdb3225e4d70ac710cf0cc75ada483ed81786ff2b5eb961508291261742eab2ba91bdab9ea38188b02caaa1eb5abbdee43db4daad0416  openjdk-2.6.24.tar.bz2
ed6244abf6a7ddfced08c8dd1d6f0ccee2344e0e85a9499c76a97f64708cbc9676bfb475c0ae907820ea1e8b5c1c4e73f57662bdcee6e41edf25a99d46d972fc  corba-2.6.24.tar.bz2
7a867293ef178f0af8bd37bdf94dcbf56a646974742aaec1f009d328eb18f4083c0120eb16d50e4510dff344074558151736e22f767ba9aa311b9f4a0c53013d  jaxp-2.6.24.tar.bz2
3257d4058e056f5664d185ea3357972e412033bc8f69f7e0778c31f47b354741a2c2e2c2a389939a06cc4c9eb6c024bf47f5b936a09b3606d2cdcc7d7236517a  jaxws-2.6.24.tar.bz2
24ff2ca12aa2f2c1b84803586f90e77527fc2c3df726650e828ab7f8430ac5a2805eee46ee830a6e1141d6f8c5a476a3ed7edece5b0534e2d33037155779f0d4  jdk-2.6.24.tar.bz2
1d5def1076785a2a3097a18bdec0070fd69adff79e54fa24988da09b4457e9d363f05396016854301a1123b446d38e2c23c86cada43ae09e4fa8edf3b5d669b2  langtools-2.6.24.tar.bz2
21fe6c47b7d116662bd772ecb526b993b11033e13286bdf0257aab60ec374cce6194dfea87b78ea5a1a62d5fbe83b01e9539ce8b81c73333a9dfb6dc0bf8fec5  hotspot-2.6.24.tar.bz2
487dbd1d7f678a92924ba884a57e910ccb4fe565c554278795a8fdfc80c4e88d81ebc2ccecb5a8f353f0b2076572bb921499a2cadb064e0f44fc406a3c31da20  apache-ant-1.9.14-bin.tar.gz
1b9e8721749e81c5420a00af1e00ee0e4f48624ccb4e9aa969032114116ad50f59b254d4d16d74feff74de64157cc8b0a2ead9b555907c84b7055b796fba9a75  rhino-1.7.7.2.zip
74e38e41db0dcca6ec91d3a83330f06904342ba8e950d896c4544db72b76a3ae6665793b83d7bbeb5a0cd3896b48707c8beda92ef0eb0e7f821c15e591e2fd49  icedtea-hotspot-musl.patch
e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef  icedtea-hotspot-musl-ppc.patch
e7a2c1771bb582d427041f8d22e48c0daf8f20d7c0926cbce3549d49c4e949359ee25a35682b486e82f3e390535c950c5beee3bd8d06fb5a717b50f2d9b2a6bc  icedtea-hotspot-noagent-musl.patch
822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a  icedtea-hotspot-uclibc-fixes.patch
0391970e6a32946aa3cccf38fdef9c0fe2af26cd0df824b98aa2fcfa1bf661d4a68e339bffcfd16f386c565fc68bb28a29208a67d4bad8a0e847ad02bd8becbb  icedtea-jdk-execinfo.patch
8fadeee6ea9886c7ee3118a1abaee2fbd04931a3ba880062bc97397ad30aab114a83542c888461a5a8a1d131c4e73920872317c96620e2a8c4689620adf9e9c3  icedtea-jdk-fix-build.patch
38114b1de864539dd5ba35add8bfe0de8b85d6ebcb4d05e82cebc318ca27883737739315471855cfe0fd0cbc0a26d916aeb2304a23a75abb6a351aa51957e8a9  icedtea-jdk-fix-compile-optional.patch
9b4ad4a593672edd617c514d3d9158324762d7d91049eca0b3c7f307c668cf20c1db94ecd935ab35d149488524d23db5dd77d7d45572f2fa1a7643c26ae4a32c  icedtea-jdk-fix-gcc10.patch
48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774  icedtea-jdk-fix-ipv6-init.patch
44a35941c80f408d0607e32763b3b6ccee21e1d39886309327d3d74d2900117e4346ef59e77c663fd022fec10ee8f365eeb46c1260014d5765d226ce175ce3c5  icedtea-jdk-musl.patch
bf4b184e170f7b0ff64ab30d2162784fe2bd5460d1fa31973259f7065fd4c511c46f97724fe2bd72bb94e9006cb568d0e0c87d1a9c90819e65880f8f44830bb1  icedtea-jdk-no-soname.patch
e703e5f68e63f130e758b3fa813872363090c08eee6a6366f4784cf6a191a90a3642ec71e016bd05e48a66ad0ae56db8b0e318b101aca5d0885af8705423b770  icedtea-jdk-xattr.patch
a54c79c82afa1bc95265397b274260584c8b8c6be1651ddfb907d9523a809ea4581409e0d3fb0bbb63ef5a204e8ce29b7940e78cd640af1f490ae938c59129b6  icedtea-cpio.patch
c70fee8f1a10c155494ab9c6e55e979d8a3e23f12358ffe9de2029ae15feff361957f1aa43af43c90ecf00523f92e3333b40311a8d0c132ebd456486cb85ed8a  icedtea-jdk-disable-vfork.patch
4c874f0e9f3f54f688a1faf64fa3734e31f139f465ce77d12aac87558764ef66055de6cfac5b60efef2833c64256136c70f3cf5dc2712de62fc5dbebe3a8fbcd  fix-xattr-include.patch"