Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/openjdk-bin/
Date: Wed, 08 May 2019 21:10:51
Message-Id: 1557349801.07d47a6c7fef21486a444fd2b308656953a9939e.gyakovlev@gentoo
1 commit: 07d47a6c7fef21486a444fd2b308656953a9939e
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 8 20:57:01 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed May 8 21:10:01 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07d47a6c
7
8 dev-java/openjdk-bin: restrict stipping of binaries
9
10 otherwise tools like jmap do not work
11 Caused by: java.lang.RuntimeException:
12 unknown CollectedHeap type : class sun.jvm.hotspot.gc_interface.CollectedHeap
13
14 Package-Manager: Portage-2.3.66, Repoman-2.3.12
15 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
16
17 .../openjdk-bin/openjdk-bin-8.212_p03-r1.ebuild | 102 +++++++++++++++++++++
18 1 file changed, 102 insertions(+)
19
20 diff --git a/dev-java/openjdk-bin/openjdk-bin-8.212_p03-r1.ebuild b/dev-java/openjdk-bin/openjdk-bin-8.212_p03-r1.ebuild
21 new file mode 100644
22 index 00000000000..1d7e990563f
23 --- /dev/null
24 +++ b/dev-java/openjdk-bin/openjdk-bin-8.212_p03-r1.ebuild
25 @@ -0,0 +1,102 @@
26 +# Copyright 1999-2019 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=6
30 +
31 +inherit eapi7-ver java-vm-2
32 +
33 +abi_uri() {
34 + echo "${2-$1}? (
35 + https://github.com/AdoptOpenJDK/openjdk${SLOT}-binaries/releases/download/jdk${MY_PV}/OpenJDK8U-jdk_${1}_linux_hotspot_${MY_PV/-/}.tar.gz
36 + )"
37 +}
38 +
39 +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b})
40 +SLOT="$(ver_cut 1)"
41 +
42 +DESCRIPTION="Prebuilt Java JDK binaries provided by AdoptOpenJDK"
43 +HOMEPAGE="https://adoptopenjdk.net"
44 +SRC_URI="
45 + $(abi_uri x64 amd64)
46 + $(abi_uri ppc64le ppc64)
47 +"
48 +
49 +LICENSE="GPL-2-with-classpath-exception"
50 +KEYWORDS="~amd64 ~ppc64"
51 +
52 +IUSE="alsa cups doc examples +gentoo-vm headless-awt nsplugin selinux source +webstart"
53 +
54 +RDEPEND="
55 + media-libs/fontconfig:1.0
56 + media-libs/freetype:2
57 + >=sys-libs/glibc-2.2.5:*
58 + sys-libs/zlib
59 + alsa? ( media-libs/alsa-lib )
60 + cups? ( net-print/cups )
61 + doc? ( dev-java/java-sdk-docs:1.${SLOT} )
62 + selinux? ( sec-policy/selinux-java )
63 + !headless-awt? (
64 + x11-libs/libX11
65 + x11-libs/libXext
66 + x11-libs/libXi
67 + x11-libs/libXrender
68 + x11-libs/libXtst
69 + )"
70 +
71 +PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
72 + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
73 +
74 +RESTRICT="preserve-libs strip"
75 +QA_PREBUILT="*"
76 +
77 +S="${WORKDIR}/jdk${MY_PV}"
78 +
79 +src_install() {
80 + local dest="/opt/${P}"
81 + local ddest="${ED}${dest#/}"
82 +
83 + rm ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README || die
84 +
85 + # this does not exist on arm64 hence -f
86 + rm -fv jre/lib/*/libfreetype.so* || die
87 +
88 + if ! use alsa ; then
89 + rm -v jre/lib/*/libjsoundalsa.so* || die
90 + fi
91 +
92 + if ! use examples ; then
93 + rm -vr sample || die
94 + fi
95 +
96 + if use headless-awt ; then
97 + rm -fvr */jre/lib/*/lib*{[jx]awt,splashscreen}* \
98 + {,jre/}bin/policytool bin/appletviewer || die
99 + fi
100 +
101 + if ! use source ; then
102 + rm -v src.zip || die
103 + fi
104 +
105 + dodir "${dest}"
106 + cp -pPR * "${ddest}" || die
107 +
108 + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
109 + java-vm_set-pax-markings "${ddest}"
110 + java-vm_revdep-mask
111 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
112 +}
113 +
114 +pkg_postinst() {
115 + java-vm-2_pkg_postinst
116 +
117 + if use gentoo-vm ; then
118 + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
119 + ewarn "recognised by the system. This will almost certainly break things."
120 + else
121 + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
122 + ewarn "will not be recognised by the system. For example, simply calling"
123 + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
124 + ewarn "fully supports OpenJDK 8. This JDK must therefore be invoked using its"
125 + ewarn "absolute location under ${EPREFIX}/opt/${P}."
126 + fi
127 +}