dev-java/icedtea-bin: ppc64 stable wrt bug #720690
[gentoo.git] / dev-java / icedtea-bin / icedtea-bin-3.16.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit java-vm-2 multilib-build toolchain-funcs
7
8 abi_uri() {
9         echo "${2-$1}? (
10                         ${BASE_URI}/${PN}-core-${PV}${3+-r${3}}-${1}.tar.xz
11                         examples? ( ${BASE_URI}/${PN}-examples-${PV}${3+-r${3}}-${1}.tar.xz )
12                 )"
13 }
14
15 BASE_URI="https://dev.gentoo.org/~gyakovlev/distfiles"
16 SRC_URI="
17         doc? ( ${BASE_URI}/${PN}-doc-${PV}.tar.xz )
18         source? ( ${BASE_URI}/${PN}-src-${PV}.tar.xz )
19         big-endian? ( $(abi_uri ppc64) )
20         !big-endian? ( $(abi_uri ppc64le ppc64) )
21         $(abi_uri amd64)
22         $(abi_uri arm)
23         $(abi_uri arm64)
24         $(abi_uri x86)
25 "
26
27 DESCRIPTION="A Gentoo-made binary build of the IcedTea JDK"
28 HOMEPAGE="http://icedtea.classpath.org"
29
30 LICENSE="GPL-2-with-classpath-exception"
31 SLOT="8"
32 KEYWORDS="-* amd64 ~arm arm64 ppc64 x86"
33 IUSE="+alsa big-endian cups doc examples +gtk headless-awt nsplugin pulseaudio selinux source webstart"
34
35 REQUIRED_USE="
36         gtk? ( !headless-awt )
37         nsplugin? ( !headless-awt )
38 "
39
40 RESTRICT="preserve-libs strip"
41 QA_PREBUILT="opt/.*"
42
43 DEPEND="app-arch/xz-utils"
44
45 RDEPEND="
46         >=dev-libs/glib-2.60.7:2
47         >=media-libs/fontconfig-2.13:1.0
48         >=media-libs/freetype-2.9.1:2
49         >=media-libs/lcms-2.9:2
50         >=sys-apps/baselayout-java-0.1.0-r1
51         >=sys-libs/zlib-1.2.11-r2
52         virtual/jpeg-compat:62
53         alsa? ( >=media-libs/alsa-lib-1.2 )
54         cups? ( >=net-print/cups-2.0 )
55         gtk? (
56                 >=dev-libs/atk-2.32.0
57                 >=x11-libs/cairo-1.16.0
58                 x11-libs/gdk-pixbuf:2
59                 >=x11-libs/gtk+-2.24:2
60                 >=x11-libs/pango-1.42
61         )
62         selinux? ( sec-policy/selinux-java )
63         virtual/ttf-fonts
64         !headless-awt? (
65                 media-libs/giflib:0/7
66                 =media-libs/libpng-1.6*
67                 >=x11-libs/libX11-1.6
68                 >=x11-libs/libXcomposite-0.4
69                 >=x11-libs/libXext-1.3
70                 >=x11-libs/libXi-1.7
71                 >=x11-libs/libXrender-0.9.10
72                 >=x11-libs/libXtst-1.2
73         )
74 "
75
76 PDEPEND="
77         webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
78         nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )
79         pulseaudio? ( dev-java/icedtea-sound )
80 "
81
82 S="${WORKDIR}"
83
84 pkg_pretend() {
85         if [[ "$(tc-is-softfloat)" != "no" ]]; then
86                 die "These binaries require a hardfloat system."
87         fi
88 }
89
90 src_prepare() {
91         default
92
93         # I wouldn't normally use -f below but symlinks in the arm files
94         # make this fail otherwise and any other approach would be tedious.
95
96         if ! use alsa; then
97                 rm -fv */jre/lib/*/libjsoundalsa.* || die
98         fi
99
100         if use headless-awt; then
101                 rm -fvr */jre/lib/*/lib*{[jx]awt,splashscreen}* \
102                    */{,jre/}bin/policytool */bin/appletviewer || die
103         fi
104 }
105
106 src_install() {
107         local dest="/opt/${P}"
108         local ddest="${ED}${dest#/}"
109         dodir "${dest}"
110
111         dodoc ${P}-${ABI}/doc/{ASSEMBLY_EXCEPTION,AUTHORS,NEWS,README,THIRD_PARTY_README}
112         use doc && dodoc -r ${P}/doc/html
113
114         # doins doesn't preserve executable bits.
115         cp -pRP ${P}-${ABI}/{bin,include,jre,lib,man} "${ddest}" || die
116
117         if use examples; then
118                 cp -pRP ${P}-${ABI}/{demo,sample} "${ddest}" || die
119         fi
120
121         if use source; then
122                 cp ${P}/src.zip "${ddest}" || die
123         fi
124
125         # use system-wide cacert store
126         rm "${ddest}"/jre/lib/security/cacerts || die
127         dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/jre/lib/security/cacerts
128
129         java-vm_install-env "${FILESDIR}/icedtea-bin.env.sh"
130
131         # Both icedtea itself and the icedtea ebuild set PAX markings but we
132         # disable them for the icedtea-bin build because the line below will
133         # respect end-user settings when icedtea-bin is actually installed.
134         java-vm_set-pax-markings "${ddest}"
135
136         # Each invocation appends to the config.
137         java-vm_revdep-mask "${EPREFIX}${dest}"
138         java-vm_sandbox-predict /proc/self/coredump_filter
139 }