1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Frederik Schwan <freswa at archlinux dot org>
3 # Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
4 # Contributor: Boyan Ding <stu_dby@126.com>
6 pkgname=('jre8-openjdk-headless' 'jre8-openjdk' 'jdk8-openjdk' 'openjdk8-src' 'openjdk8-doc')
12 pkgver=${_majorver}.${_minorver}.u${_updatever}
15 url='https://openjdk.java.net/'
33 source=(https://github.com/openjdk/jdk${_majorver}u/archive/refs/tags/jdk${_majorver}u${_minorver}-b${_updatever}.tar.gz
35 b2sums=('35bef818f7e9f6872356672e1bed50233fc4fa094c1a6eac30395d05cc8addb59b5eb0b985d3702d78939ab0a08195f87b2b2d9a7533058516e9b4477f7ae334'
36 '9679e4dfb6027a87376081489c09810812d6849573afac4ea96abe3a3e00ca5b6af7d0ffb010c43b93cfa913f9e97fbb9f11e19fcc86a89b4548442671c32da1')
39 'x86_64') _JARCH=amd64 ; _DOC_ARCH=x86_64 ;;
40 'i686' ) _JARCH=i386 ; _DOC_ARCH=x86 ;;
44 _jvmdir=/usr/lib/jvm/java-8-openjdk
46 _imgdir="${_prefix}/jvm/openjdk-1.8.0_$(printf '%.2d' ${_minorver})"
47 _nonheadless=(bin/policytool
48 lib/${_JARCH}/libjsound.so
49 lib/${_JARCH}/libjsoundalsa.so
50 lib/${_JARCH}/libsplashscreen.so)
53 cd jdk8u-jdk${_majorver}u${_minorver}-b${_updatever}
55 # Fix build with C++17 (Fedora)
56 patch -Np1 -i "${srcdir}"/gcc11.patch
60 cd jdk8u-jdk${_majorver}u${_minorver}-b${_updatever}
63 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1346
64 export MAKEFLAGS=${MAKEFLAGS/-j*}
66 # Avoid optimization of HotSpot being lowered from O3 to O2
67 # -fno-exceptions for FS#73134
68 export CFLAGS="${CFLAGS//-O2/-O3} -Wno-error=nonnull -Wno-error=deprecated-declarations -Wno-error=stringop-overflow= -Wno-error=return-type -Wno-error=cpp -fno-lifetime-dse -fno-delete-null-pointer-checks -fcommon -fno-exceptions -Wno-error=format-overflow="
69 export CXXFLAGS="${CXXFLAGS} -fcommon -fno-exceptions"
71 install -d -m 755 "${srcdir}/${_prefix}/"
73 --prefix="${srcdir}/${_prefix}" \
74 --with-update-version="${_minorver}" \
75 --with-build-number="b${_updatever}" \
76 --with-milestone="fcs" \
77 --enable-unlimited-crypto \
78 --with-giflib=system \
80 --with-extra-cflags="${CFLAGS}" \
81 --with-extra-cxxflags="${CXXFLAGS}" \
82 --with-extra-ldflags="${LDFLAGS}"
84 # These help to debug builds: LOG=trace HOTSPOT_BUILD_JOBS=1
85 # Without 'DEBUG_BINARIES', i686 won't build: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-July/019203.html
89 # FIXME sadly 'DESTDIR' is not used here!
94 # A lot of build stuff were directly taken from
95 # http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/tree/java-1.8.0-openjdk.spec
97 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
98 find . -iname '*.jar' -exec chmod ugo+r {} \;
99 chmod ugo+r lib/ct.sym
101 # remove redundant *diz and *debuginfo files
102 find . -iname '*.diz' -exec rm {} \;
103 find . -iname '*.debuginfo' -exec rm {} \;
107 cd jdk8u-jdk${_majorver}u${_minorver}-b${_updatever}
111 package_jre8-openjdk-headless() {
112 pkgdesc='OpenJDK Java 8 headless runtime environment'
113 depends=('java-runtime-common' 'ca-certificates-utils' 'nss')
114 optdepends=('java-rhino: for some JavaScript support')
115 provides=('java-runtime-headless=8' 'java-runtime-headless-openjdk=8')
116 # Upstream config files that should go to etc and get backup
117 _backup_etc=(etc/java-8-openjdk/${_JARCH}/jvm.cfg
118 etc/java-8-openjdk/calendars.properties
119 etc/java-8-openjdk/content-types.properties
120 etc/java-8-openjdk/flavormap.properties
121 etc/java-8-openjdk/images/cursors/cursors.properties
122 etc/java-8-openjdk/logging.properties
123 etc/java-8-openjdk/management/jmxremote.access
124 etc/java-8-openjdk/management/jmxremote.password
125 etc/java-8-openjdk/management/management.properties
126 etc/java-8-openjdk/management/snmp.acl
127 etc/java-8-openjdk/net.properties
128 etc/java-8-openjdk/psfont.properties.ja
129 etc/java-8-openjdk/psfontj2d.properties
130 etc/java-8-openjdk/security/java.policy
131 etc/java-8-openjdk/security/java.security
132 etc/java-8-openjdk/sound.properties)
133 replaces=('jre8-openjdk-headless-wm')
134 backup=(${_backup_etc[@]})
135 install=install_jre8-openjdk-headless.sh
139 install -d -m 755 "${pkgdir}${_jvmdir}/jre/"
140 cp -a bin lib "${pkgdir}${_jvmdir}/jre"
142 cp ../release "${pkgdir}${_jvmdir}" # FS#52692
145 mv "${pkgdir}${_jvmdir}"/jre/lib/management/jmxremote.password{.template,}
146 mv "${pkgdir}${_jvmdir}"/jre/lib/management/snmp.acl{.template,}
148 # Remove 'non-headless' lib files
149 for f in "${_nonheadless[@]}"; do
150 rm "${pkgdir}${_jvmdir}/jre/${f}"
154 pushd "${pkgdir}${_jvmdir}/jre/bin"
155 install -d -m 755 "${pkgdir}"/usr/share/man/{,ja/}man1/
157 if [ -f "${srcdir}/${_imgdir}/man/man1/${file}.1" ]; then
158 install -m 644 "${srcdir}/${_imgdir}/man/man1/${file}.1" \
159 "${pkgdir}/usr/share/man/man1/${file}-${_jdkname}.1"
161 if [ -f "${srcdir}/${_imgdir}/man/ja/man1/${file}.1" ]; then
162 install -m 644 "${srcdir}/${_imgdir}/man/ja/man1/${file}.1" \
163 "${pkgdir}/usr/share/man/ja/man1/${file}-${_jdkname}.1"
168 # Link JKS keystore from ca-certificates-utils
169 rm -f "${pkgdir}${_jvmdir}/jre/lib/security/cacerts"
170 ln -sf /etc/ssl/certs/java/cacerts "${pkgdir}${_jvmdir}/jre/lib/security/cacerts"
173 install -d -m 755 "${pkgdir}/usr/share/licenses/${pkgbase}/"
174 install -m 644 ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README \
175 "${pkgdir}/usr/share/licenses/${pkgbase}"
176 ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
178 # Move config files that were set in _backup_etc from ./lib to /etc
179 for file in "${_backup_etc[@]}"; do
180 _filepkgpath=${_jvmdir}/jre/lib/${file#etc/java-8-openjdk/}
181 install -D -m 644 "${pkgdir}${_filepkgpath}" "${pkgdir}/${file}"
182 ln -sf /${file} "${pkgdir}${_filepkgpath}"
186 package_jre8-openjdk() {
187 pkgdesc='OpenJDK Java 8 full runtime environment'
189 "jre8-openjdk-headless=${pkgver}-${pkgrel}"
194 optdepends=('icedtea-web: web browser plugin + Java Web Start'
195 'alsa-lib: for basic sound support'
196 'gtk2: for the Gtk+ look and feel - desktop usage'
197 'java8-openjfx: for JavaFX GUI components support')
198 provides=('java-runtime=8' 'java-runtime-openjdk=8')
199 install=install_jre8-openjdk.sh
200 replaces=('jre8-openjdk-wm')
204 for f in "${_nonheadless[@]}"; do
205 install -D ${f} "${pkgdir}${_jvmdir}/jre/${f}"
209 pushd "${pkgdir}${_jvmdir}/jre/bin"
210 install -d -m 755 "${pkgdir}"/usr/share/man/{,ja/}man1/
212 install -m 644 "${srcdir}/${_imgdir}/man/man1/${file}.1" \
213 "${pkgdir}/usr/share/man/man1/${file}-${_jdkname}.1"
214 install -m 644 "${srcdir}/${_imgdir}/man/ja/man1/${file}.1" \
215 "${pkgdir}/usr/share/man/ja/man1/${file}-${_jdkname}.1"
220 install -d -m 755 "${pkgdir}/usr/share/licenses/${pkgbase}/"
221 ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
224 package_jdk8-openjdk() {
225 pkgdesc='OpenJDK Java 8 development kit'
226 depends=('java-environment-common' "jre8-openjdk=${pkgver}-${pkgrel}")
227 provides=('java-environment=8' 'java-environment-openjdk=8')
228 replaces=('jdk8-openjdk-wm')
229 install=install_jdk8-openjdk.sh
234 install -d -m 755 "${pkgdir}${_jvmdir}"
236 cp -a include lib "${pkgdir}${_jvmdir}"
241 # 'java-rmi.cgi' will be handled separately as it should not be in the PATH and has no man page
242 for b in $(ls | grep -v java-rmi.cgi); do
243 if [ -e ../jre/bin/${b} ]; then
244 # Provide a link of the jre binary in the jdk/bin/ directory
245 ln -s ../jre/bin/${b} "${pkgdir}${_jvmdir}/bin/${b}"
247 # Copy binary to jdk/bin/
248 install -D -m 755 ${b} "${pkgdir}${_jvmdir}/bin/${b}"
250 if [ -f ../man/man1/${b}.1 ]; then
251 install -D -m 644 ../man/man1/${b}.1 "${pkgdir}/usr/share/man/man1/${b}-${_jdkname}.1"
253 if [ -f ../man/ja/man1/${b}.1 ]; then
254 install -D -m 644 ../man/ja/man1/${b}.1 "${pkgdir}/usr/share/man/ja/man1/${b}-${_jdkname}.1"
260 # Handling 'java-rmi.cgi' separately
261 install -D -m 755 bin/java-rmi.cgi "${pkgdir}${_jvmdir}/bin/java-rmi.cgi"
264 install -d -m 755 "${pkgdir}/usr/share/licenses/"
265 ln -sf /usr/share/licenses/${pkgbase} "${pkgdir}/usr/share/licenses/${pkgname}"
268 package_openjdk8-src() {
269 pkgdesc='OpenJDK Java 8 sources'
271 install -D "${srcdir}/${_imgdir}/src.zip" "${pkgdir}${_jvmdir}/src.zip"
274 package_openjdk8-doc() {
275 pkgdesc='OpenJDK Java 8 documentation'
277 install -d -m 755 "${pkgdir}/usr/share/doc/${pkgbase}/"
278 cp -r "${srcdir}"/jdk8u-jdk${_majorver}u${_minorver}-b${_updatever}/build/linux-${_DOC_ARCH}-normal-server-release/docs/* \
279 "${pkgdir}/usr/share/doc/${pkgbase}/"