aboutsummaryrefslogtreecommitdiffstats
path: root/community/openjdk7/APKBUILD
blob: 2fa4fa365f1496a9d1e1cf63e395b9f2f18bb41a (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
# 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.23
_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

	fix-xattr-include.patch
	"

# secfixes:
#   7.271.2.6.23-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="3e3d6651e196839479e843fa4926f3459d8254918f79771f51edf2db40c0a70d9ddb2066727a19177ade9ceb0b38c0dcd7d6f2074f249ade72c969bc8434c53a  icedtea-2.6.23.tar.xz
0b43d782ba2799de44422491dbe2638d04e88297e74fc13f3b3a16d6eebdfa7ce2e26cf10832b724e20b13c3a6717c116fd1d5d1b912df6dc4d1e1b678fa3ead  openjdk-2.6.23.tar.bz2
dddcda339b78536e3f04083afb8c7834cefb04955f713f4366704be8a2599590a5f7106cd4f2cefdee891110e3a4801193be1f4a44d9006e58f4e8d5fb9c5619  corba-2.6.23.tar.bz2
df8b634d71e8fbdd77923b7db68d20506ed2fd4cd63d54eb3c325e317e0cd3c2b70a2b51fe78c9da4f5f0a08e529db0fa2cd98a6272c6bff9e262c2d67ca141c  jaxp-2.6.23.tar.bz2
b37416fb7f3f93bb4c9ffc171d1bf82e4026e609fd3e944027931e79c785a8257274e9267bfdfe31c8265d4256dda8ca4434d557613329f20e9d256f40eaa7dd  jaxws-2.6.23.tar.bz2
da18adf031b557c55fd84c8ba842bef76f2908b0cb52cf93c35b5b16b8e88b5024ed9a92469bc547f72b9c7015bf8e5e2e3edba921b94716ac79bea966b93afc  jdk-2.6.23.tar.bz2
ae86c875e33406f99873492a18f656a6578532571ed4d1cd2a91c816d3066bc007d1d402853a06c8ee5a984239d5558856a7f21422d55b1e7e88fb30a5b2a275  langtools-2.6.23.tar.bz2
b5d92b312d950d90938f5769d8475539a29cb796651acdbd830742c4f36024d04d4a40fe82edb7d89b7f027bb7ef2c2675d88a5374beadbb8d326c66ad4030b7  hotspot-2.6.23.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
4c874f0e9f3f54f688a1faf64fa3734e31f139f465ce77d12aac87558764ef66055de6cfac5b60efef2833c64256136c70f3cf5dc2712de62fc5dbebe3a8fbcd  fix-xattr-include.patch"