Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/oracle-jre-bin/
Date: Fri, 01 Jan 2016 22:50:12
Message-Id: 1451688554.87fe654ed20b0cd6043341d99670a053029d8d0c.chewi@gentoo
1 commit: 87fe654ed20b0cd6043341d99670a053029d8d0c
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 1 22:44:22 2016 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 1 22:49:14 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87fe654e
7
8 dev-java/oracle-jre-bin: awt flag, nsplugin
9
10 * Change awt USE flag to !headless-awt
11 * Install nsplugin to /usr/lib/nsbrowser/plugins in line with
12 eselect-java and icedtea-web changes
13
14 Sorry for changing the X/awt flag again but icedtea upstream preferred
15 the term headless, which is technically more accurate than awt, so I
16 compromised and went with headless-awt. This isn't icedtea but
17 consistency is king and I may apply this flag to virtual/jre one day.
18
19 Package-Manager: portage-2.2.26
20
21 dev-java/oracle-jre-bin/metadata.xml | 1 +
22 .../oracle-jre-bin-1.8.0.66-r1.ebuild | 239 +++++++++++++++++++++
23 2 files changed, 240 insertions(+)
24
25 diff --git a/dev-java/oracle-jre-bin/metadata.xml b/dev-java/oracle-jre-bin/metadata.xml
26 index e93f517..223ad67 100644
27 --- a/dev-java/oracle-jre-bin/metadata.xml
28 +++ b/dev-java/oracle-jre-bin/metadata.xml
29 @@ -5,6 +5,7 @@
30 <longdescription>Oracle Java SE Runtime Environment, Official Binary Distribution</longdescription>
31 <use>
32 <flag name="awt">Install non-headless AWT libraries, needed by some GUIs (used to be X flag)</flag>
33 + <flag name="headless-awt">Don't install the X backend for AWT, needed by some GUIs (used to be X flag)</flag>
34 <flag name="javafx">Install JavaFX libraries</flag>
35 <flag name="jce">Install Java Cryptographic Extension Unlimited Strength Jurisdiction Policy Files</flag>
36 <flag name="pax_kernel">Use paxctl to mark the JVM binaries</flag>
37
38 diff --git a/dev-java/oracle-jre-bin/oracle-jre-bin-1.8.0.66-r1.ebuild b/dev-java/oracle-jre-bin/oracle-jre-bin-1.8.0.66-r1.ebuild
39 new file mode 100644
40 index 0000000..526e032
41 --- /dev/null
42 +++ b/dev-java/oracle-jre-bin/oracle-jre-bin-1.8.0.66-r1.ebuild
43 @@ -0,0 +1,239 @@
44 +# Copyright 1999-2016 Gentoo Foundation
45 +# Distributed under the terms of the GNU General Public License v2
46 +# $Id$
47 +
48 +EAPI="5"
49 +
50 +inherit eutils java-vm-2 prefix versionator
51 +
52 +# This URIs need updating when bumping!
53 +JRE_URI="http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html"
54 +JCE_URI="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"
55 +
56 +if [[ "$(get_version_component_range 4)" == 0 ]] ; then
57 + S_PV="$(get_version_component_range 1-3)"
58 +else
59 + MY_PV_EXT="u$(get_version_component_range 4)"
60 + S_PV="$(get_version_component_range 1-4)"
61 +fi
62 +
63 +MY_PV="$(get_version_component_range 2)${MY_PV_EXT}"
64 +
65 +AT_amd64="jre-${MY_PV}-linux-x64.tar.gz"
66 +AT_x86="jre-${MY_PV}-linux-i586.tar.gz"
67 +
68 +JCE_DIR="UnlimitedJCEPolicyJDK8"
69 +JCE_FILE="jce_policy-8.zip"
70 +
71 +DESCRIPTION="Oracle's Java SE Runtime Environment"
72 +HOMEPAGE="http://www.oracle.com/technetwork/java/javase/"
73 +SRC_URI="
74 + amd64? ( ${AT_amd64} )
75 + x86? ( ${AT_x86} )
76 + jce? ( ${JCE_FILE} )"
77 +
78 +LICENSE="Oracle-BCLA-JavaSE"
79 +SLOT="1.8"
80 +KEYWORDS="~amd64 ~x86"
81 +IUSE="alsa cups +fontconfig headless-awt javafx jce nsplugin pax_kernel selinux"
82 +
83 +RESTRICT="fetch preserve-libs strip"
84 +QA_PREBUILT="*"
85 +
86 +# NOTES:
87 +#
88 +# * cups is dlopened.
89 +#
90 +# * libpng is also dlopened but only by libsplashscreen, which isn't
91 +# important, so we can exclude that.
92 +#
93 +# * We still need to work out the exact AWT and JavaFX dependencies
94 +# under MacOS. It doesn't appear to use many, if any, of the
95 +# dependencies below.
96 +#
97 +RDEPEND="!x64-macos? (
98 + !headless-awt? (
99 + x11-libs/libX11
100 + x11-libs/libXext
101 + x11-libs/libXi
102 + x11-libs/libXrender
103 + )
104 + javafx? (
105 + dev-libs/glib:2
106 + dev-libs/libxml2:2
107 + dev-libs/libxslt
108 + media-libs/freetype:2
109 + x11-libs/cairo
110 + x11-libs/gtk+:2
111 + x11-libs/libX11
112 + x11-libs/libXtst
113 + x11-libs/libXxf86vm
114 + x11-libs/pango
115 + virtual/opengl
116 + )
117 + )
118 + alsa? ( media-libs/alsa-lib )
119 + cups? ( net-print/cups )
120 + fontconfig? ( media-libs/fontconfig:1.0 )
121 + !prefix? ( sys-libs/glibc:* )
122 + selinux? ( sec-policy/selinux-java )"
123 +
124 +# A PaX header isn't created by scanelf so depend on paxctl to avoid
125 +# fallback marking. See bug #427642.
126 +DEPEND="app-arch/zip
127 + jce? ( app-arch/unzip )
128 + pax_kernel? ( sys-apps/paxctl )"
129 +
130 +S="${WORKDIR}/jre"
131 +
132 +pkg_nofetch() {
133 + local AT_ARCH="AT_${ARCH}"
134 + local AT="${!AT_ARCH}"
135 +
136 + einfo "Please download '${AT}' from:"
137 + einfo "'${JRE_URI}'"
138 + einfo "and move it to '${DISTDIR}'"
139 +
140 + if use jce; then
141 + einfo "Also download '${JCE_FILE}' from:"
142 + einfo "'${JCE_URI}'"
143 + einfo "and move it to '${DISTDIR}'"
144 + fi
145 +
146 + einfo
147 + einfo "If the above mentioned urls do not point to the correct version anymore,"
148 + einfo "please download the files from Oracle's java download archive:"
149 + einfo
150 + einfo " http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html#jre-${MY_PV}-oth-JPR"
151 + einfo
152 +
153 +}
154 +
155 +src_unpack() {
156 + default
157 +
158 + # Upstream is changing their versioning scheme every release around 1.8.0.*;
159 + # to stop having to change it over and over again, just wildcard match and
160 + # live a happy life instead of trying to get this new jre1.8.0_05 to work.
161 + mv "${WORKDIR}"/jre* "${S}" || die
162 +}
163 +
164 +src_prepare() {
165 + if use jce ; then
166 + mv "${WORKDIR}"/${JCE_DIR} lib/security/ || die
167 + fi
168 +
169 + # Remove the hook that calls Oracle's evil usage tracker. Not just
170 + # because it's evil but because it breaks the sandbox during builds
171 + # and we can't find any other feasible way to disable it or make it
172 + # write somewhere else. See bug #559936 for details.
173 + zip -d lib/rt.jar sun/misc/PostVMInitHook.class || die
174 +}
175 +
176 +src_install() {
177 + local dest="/opt/${P}"
178 + local ddest="${ED}${dest#/}"
179 +
180 + # Create files used as storage for system preferences.
181 + mkdir .systemPrefs || die
182 + touch .systemPrefs/.system.lock || die
183 + touch .systemPrefs/.systemRootModFile || die
184 +
185 + if ! use alsa ; then
186 + rm -vf lib/*/libjsoundalsa.* || die
187 + fi
188 +
189 + if use headless-awt ; then
190 + rm -vf lib/*/lib*{[jx]awt,splashscreen}* \
191 + bin/{javaws,policytool} || die
192 + fi
193 +
194 + if ! use javafx ; then
195 + rm -vf lib/*/lib*{decora,fx,glass,prism}* \
196 + lib/*/libgstreamer-lite.* lib/{,ext/}*fx* || die
197 + fi
198 +
199 + if ! use nsplugin ; then
200 + rm -vf lib/*/libnpjp2.* || die
201 + else
202 + local nsplugin=$(echo lib/*/libnpjp2.*)
203 + fi
204 +
205 + # Even though plugins linked against multiple ffmpeg versions are
206 + # provided, they generally lag behind what Gentoo has available.
207 + rm -vf lib/*/libavplugin* || die
208 +
209 + dodoc COPYRIGHT
210 + dodir "${dest}"
211 + cp -pPR bin lib man "${ddest}" || die
212 +
213 + if use jce ; then
214 + dodir ${dest}/lib/security/strong-jce
215 + mv "${ddest}"/lib/security/US_export_policy.jar \
216 + "${ddest}"/lib/security/strong-jce || die
217 + mv "${ddest}"/lib/security/local_policy.jar \
218 + "${ddest}"/lib/security/strong-jce || die
219 + dosym "${dest}"/lib/security/${JCE_DIR}/US_export_policy.jar \
220 + "${dest}"/lib/security/US_export_policy.jar
221 + dosym "${dest}"/lib/security/${JCE_DIR}/local_policy.jar \
222 + "${dest}"/lib/security/local_policy.jar
223 + fi
224 +
225 + if use nsplugin ; then
226 + local nsplugin_link=${nsplugin##*/}
227 + nsplugin_link=${nsplugin_link/./-${PN}-${SLOT}.}
228 + dosym "${dest}/${nsplugin}" "/usr/$(get_libdir)/nsbrowser/plugins/${nsplugin_link}"
229 + fi
230 +
231 + # Install desktop file for the Java Control Panel.
232 + # Using ${PN}-${SLOT} to prevent file collision with jre and or other slots.
233 + # make_desktop_entry can't be used as ${P} would end up in filename.
234 + newicon lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png \
235 + sun-jcontrol-${PN}-${SLOT}.png || die
236 + sed -e "s#Name=.*#Name=Java Control Panel for Oracle JRE ${SLOT}#" \
237 + -e "s#Exec=.*#Exec=/opt/${P}/bin/jcontrol#" \
238 + -e "s#Icon=.*#Icon=sun-jcontrol-${PN}-${SLOT}#" \
239 + -e "s#Application;##" \
240 + -e "/Encoding/d" \
241 + lib/desktop/applications/sun_java.desktop > \
242 + "${T}"/jcontrol-${PN}-${SLOT}.desktop || die
243 + domenu "${T}"/jcontrol-${PN}-${SLOT}.desktop
244 +
245 + # Prune all fontconfig files so libfontconfig will be used and only install
246 + # a Gentoo specific one if fontconfig is disabled.
247 + # http://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html
248 + rm "${ddest}"/lib/fontconfig.* || die
249 + if ! use fontconfig ; then
250 + cp "${FILESDIR}"/fontconfig.Gentoo.properties "${T}"/fontconfig.properties || die
251 + eprefixify "${T}"/fontconfig.properties
252 + insinto "${dest}"/lib/
253 + doins "${T}"/fontconfig.properties
254 + fi
255 +
256 + # This needs to be done before CDS - #215225
257 + java-vm_set-pax-markings "${ddest}"
258 +
259 + # see bug #207282
260 + einfo "Creating the Class Data Sharing archives"
261 + case ${ARCH} in
262 + arm|ia64)
263 + ${ddest}/bin/java -client -Xshare:dump || die
264 + ;;
265 + x86)
266 + ${ddest}/bin/java -client -Xshare:dump || die
267 + # limit heap size for large memory on x86 #467518
268 + # this is a workaround and shouldn't be needed.
269 + ${ddest}/bin/java -server -Xms64m -Xmx64m -Xshare:dump || die
270 + ;;
271 + *)
272 + ${ddest}/bin/java -server -Xshare:dump || die
273 + ;;
274 + esac
275 +
276 + # Remove empty dirs we might have copied.
277 + find "${D}" -type d -empty -exec rmdir -v {} + || die
278 +
279 + set_java_env
280 + java-vm_revdep-mask
281 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
282 +}