openjdk11-11.0.4.11.recipe revision 0a2b1f39
1SUMMARY="An open-source implementation of the Java Platform, SE"
2DESCRIPTION="OpenJDK (Open Java Development Kit) is a free and open source \
3implementation of the Java Platform, Standard Edition (Java SE). It is the \
4result of an effort Sun Microsystems began in 2006.
5
6The implementation is licensed under the GNU General Public License (GNU GPL) \
7with a linking exception. Were it not for the GPL linking exception, components \
8that linked to the Java class library would be subject to the terms of the GPL \
9license. OpenJDK is the official Java SE 8 reference implementation."
10HOMEPAGE="https://openjdk.java.net/"
11COPYRIGHT="2007-2019 Oracle and/or its affiliates."
12LICENSE="GNU GPL v2"
13REVISION="1"
14jdkBuild="jdk-${portVersion%.*}+${portVersion##*.}"
15srcGitRev="64f0e660164562ce3560e8ebf9a4facf880c4be3"
16SOURCE_URI="https://github.com/korli/haiku-jdk11u/archive/$srcGitRev.tar.gz"
17CHECKSUM_SHA256="bf8e28d051bf8f0de189589c5eaf4909d13d3c4c56e1527db9227e93683cae7a"
18SOURCE_DIR="haiku-jdk11u-$srcGitRev"
19SOURCE_FILENAME="jdk11u-$jdkBuild-$srcGitRev.tar.gz"
20SOURCE_URI_2="https://ftp.osuosl.org/pub/blfs/conglomeration/openjdk/jtreg-4.2-b13-433.tar.gz"
21CHECKSUM_SHA256_2="ddf76660d4f519302b9c6310febcde3ff45313c435fff4e157854d1ff50785b1"
22SOURCE_DIR_2="jtreg"
23SOURCE_URI_3="https://web.cs.ucla.edu/~eggert/tz/release/2019a/tzdata2019a-rearguard.tar.gz"
24CHECKSUM_SHA256_3="9469c3f911c8c19376578a74254171abe8e539a6d4fd8a3deffef999ab4b7f61"
25SOURCE_DIR_3=""
26ADDITIONAL_FILES="
27	elf.h
28	"
29
30ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
31SECONDARY_ARCHITECTURES="x86"
32
33DISABLE_SOURCE_PACKAGE="yes"
34	# at least as long as Ant and a complete SDK image are part of the "sources" package
35
36PROVIDES="
37	openjdk11$secondaryArchSuffix = $portVersion compat >= 11
38	java:environment = 11
39	"
40REQUIRES="
41	openjdk11${secondaryArchSuffix}_jre == $portVersion
42	"
43
44PROVIDES_default="
45	openjdk11${secondaryArchSuffix}_default = $portVersion
46	cmd:jar = $portVersion compat>= 11
47	cmd:jarsigner = $portVersion compat>= 11
48	cmd:java = $portVersion compat>= 11
49	cmd:javac = $portVersion compat>= 11
50	cmd:javadoc = $portVersion compat>= 11
51	cmd:javah = $portVersion compat>= 11
52	cmd:javap = $portVersion compat>= 11
53	cmd:jcmd = $portVersion compat>= 11
54	cmd:jconsole = $portVersion compat>= 11
55	cmd:jdb = $portVersion compat>= 11
56	cmd:jinfo = $portVersion compat>= 11
57	cmd:jmap = $portVersion compat>= 11
58	cmd:jps = $portVersion compat>= 11
59	cmd:jstack = $portVersion compat>= 11
60	cmd:jstat = $portVersion compat>= 11
61	cmd:jstatd = $portVersion compat>= 11
62	cmd:keytool = $portVersion compat>= 11
63	cmd:pack200 = $portVersion compat>= 11
64	cmd:rmic = $portVersion compat>= 11
65	cmd:rmid = $portVersion compat>= 11
66	cmd:rmiregistry = $portVersion compat>= 11
67	cmd:serialver = $portVersion compat>= 11
68	cmd:unpack200 = $portVersion compat>= 11
69	"
70REQUIRES_default="
71	openjdk11${secondaryArchSuffix} == $portVersion
72	"
73CONFLICTS_default="
74	openjdk8${secondaryArchSuffix}_default
75	openjdk9${secondaryArchSuffix}_default
76	openjdk10${secondaryArchSuffix}_default
77	"
78
79PROVIDES_jre="
80	openjdk11${secondaryArchSuffix}_jre = $portVersion compat>= 11
81	java:runtime = 11
82	"
83REQUIRES_jre="
84	haiku$secondaryArchSuffix
85	lib:libfreetype$secondaryArchSuffix
86	lib:libiconv$secondaryArchSuffix
87	lib:libjpeg$secondaryArchSuffix
88	lib:libz$secondaryArchSuffix
89	ca_root_certificates_java
90	"
91
92SUMMARY_sources="JDK source files, demos and examples"
93PROVIDES_sources="
94	openjdk11${secondaryArchSuffix}_sources = $portVersion compat>= 11
95	"
96REQUIRES_sources="
97	openjdk11$secondaryArchSuffix
98	"
99
100BUILD_REQUIRES="
101	haiku${secondaryArchSuffix}_devel
102	java:environment == 10
103	ca_root_certificates
104	devel:libfontconfig$secondaryArchSuffix
105	devel:libfreetype$secondaryArchSuffix
106	devel:libiconv$secondaryArchSuffix
107	devel:libjpeg$secondaryArchSuffix
108	devel:libz$secondaryArchSuffix
109	"
110BUILD_PREREQUIRES="
111	cmd:cpio
112	cmd:make
113	cmd:gcc$secondaryArchSuffix
114	cmd:ld$secondaryArchSuffix
115	cmd:sed
116	cmd:tar
117	cmd:zip
118	cmd:awk
119	cmd:hostname
120	cmd:find
121	cmd:unzip
122	cmd:unzipsfx
123	cmd:head
124	cmd:file
125	cmd:which
126	cmd:autoconf
127	cmd:pkg_config$secondaryArchSuffix
128	"
129
130TEST_REQUIRES="
131	cmd:true
132	"
133
134BUILD()
135{
136	source /system/data/profile.d/openjdk10.sh
137	export PATH=$JDK10_HOME/bin:$PATH
138	export COMPANY=HaikuPorts
139
140	ln -sfn $sourceDir2 jtreg
141
142	cp $portDir/additional-files/elf.h src/hotspot/share/utilities
143	cp -f $sourceDir3/* make/data/tzdata/
144
145	# If ASLR is enabled, the JVM can fail to find a large enough area for
146	# the heap.
147	export DISABLE_ASLR=1
148
149	# Verify that we can allocate a large enough heap before starting.
150	java -XX:ThreadStackSize=1536 -Xmx1024M -version
151
152	freeTypeHeaders=$(finddir B_SYSTEM_HEADERS_DIRECTORY)$secondaryArchSubDir/freetype2
153	freeTypeLib=$(finddir B_SYSTEM_DEVELOP_DIRECTORY)/lib$secondaryArchSubDir
154
155	#OpenJDK has an internal limitation of 256 characters in a path. And with the default src dir we go past it.
156	cd ..
157	mv $sourceDir src
158	cd src
159	ln -s src $sourceDir
160
161	bash ./configure --with-boot-jdk-jvmargs="-XX:CompressedClassSpaceSize=512m" \
162					--with-freetype-include="${freeTypeHeaders}" \
163					--with-freetype-lib="${freeTypeLib}" \
164					--with-jtreg=./jtreg \
165					--with-version-build="${portVersion//*.}" \
166					--with-version-pre="" \
167					--with-version-opt="" \
168					--with-num-cores=1 \
169					--disable-javac-server
170
171	make images LOG=info
172}
173
174INSTALL()
175{
176	# install the generated SDK image dir
177	jdkDir=$libDir/openjdk11
178
179	mkdir -p $jdkDir
180	cp -a build/haiku-*/images/jdk/* $jdkDir
181
182	# set up the cacerts link
183	ln -sf $dataDir/ssl/java/cacerts $jdkDir/conf/security/
184
185	# symlink the executables to binDir
186	mkdir -p $prefix/bin
187	bins="jar jarsigner javac javadoc javah javap jcmd jconsole jdb jinfo \
188		jmap jps jstack jstat jstatd rmic serialver"
189	bins_runtime="java keytool pack200 rmid rmiregistry unpack200"
190	man_runtime=""
191	for b in $bins $bins_runtime; do
192		symlinkRelative -s $jdkDir/bin/$b $prefix/bin
193	done
194	for b in $bins_runtime; do
195		man_runtime+=" $jdkDir/man/man1/$b.1 $jdkDir/man/ja_JP.UTF-8/man1/$b.1"
196	done
197
198	mkdir -p $dataDir/profile.d
199
200	# create a profile.d file that sets up JAVA_HOME
201	jdkProfile=$dataDir/profile.d/openjdk.sh
202	echo "JAVA_HOME=$jdkDir" > $jdkProfile
203	echo "export JAVA_HOME" >> $jdkProfile
204
205	# create a profile.d file that sets up JDK11_HOME
206	jdk11Profile=$dataDir/profile.d/openjdk11.sh
207	echo "JDK11_HOME=$jdkDir" > $jdk11Profile
208	echo "export JDK11_HOME" >> $jdk11Profile
209
210	# create a profile.d file that sets up JRE11_HOME
211	jre11Profile=$dataDir/profile.d/openjre11.sh
212	echo "JRE11_HOME=$(getPackagePrefix jre)/$relativeLibDir/openjdk11" > $jre11Profile
213	echo "export JRE11_HOME" >> $jre11Profile
214
215	find $jdkDir -name '*.diz' -o -name '*.debuginfo' -delete
216	# not for jre
217	mv $jdkDir/lib/libattach.so $jdkDir/lib/ct.sym $prefix
218
219	packageEntries sources \
220		$jdkDir/lib/src.zip \
221		$jdkDir/demo
222
223	packageEntries jre \
224		$jdkDir/bin/java \
225		$jdkDir/bin/jjs \
226		$jdkDir/bin/jrunscript \
227		$jdkDir/bin/keytool \
228		$jdkDir/bin/pack200 \
229		$jdkDir/bin/rmid \
230		$jdkDir/bin/rmiregistry \
231		$jdkDir/bin/unpack200 \
232		$jdkDir/conf \
233		$jdkDir/legal \
234		$jdkDir/lib \
235		$jdkDir/release \
236		$dataDir/profile.d/openjre11.sh \
237		$man_runtime \
238		$jdkDir/man/ja \
239
240	mkdir -p $jdkDir/lib
241	mv $prefix/libattach.so $prefix/ct.sym $jdkDir/lib/
242
243	packageEntries default \
244		$prefix/bin \
245		$dataDir/profile.d/openjdk.sh
246}
247
248TEST()
249{
250	export DISABLE_ASLR=1
251	cd ../src
252	make test-only JOBS=1 TEST=langtools_jtreg
253	make test-only JOBS=1 TEST=jdk_lang
254	make test-only JOBS=1 TEST=jdk_util
255	make test-only JOBS=1 TEST=jdk_math
256	make test-only JOBS=1 TEST=jdk_io
257	make test-only JOBS=1 TEST=jdk_nio
258	make test-only JOBS=1 TEST=jdk_net
259	make test-only JOBS=1 TEST=jdk_time
260	make test-only JOBS=1 TEST=jdk_rmi
261	make test-only JOBS=1 TEST=jdk_security
262	make test-only JOBS=1 TEST=jdk_text
263	make test-only JOBS=1 TEST=jdk_management
264	make test-only JOBS=1 TEST=jdk_instrument
265	make test-only JOBS=1 TEST=jdk_jmx
266	make test-only JOBS=1 TEST=jdk_jdi
267}
268