1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit java-vm-2 multilib prefix toolchain-funcs versionator
9 dist="https://dev.gentoo.org/~chewi/distfiles"
10 TARBALL_VERSION="${PV}"
12 DESCRIPTION="A Gentoo-made binary build of the IcedTea JDK"
13 HOMEPAGE="http://icedtea.classpath.org"
14 SRC_URI="doc? ( ${dist}/${PN}-doc-${TARBALL_VERSION}.tar.xz )
15 source? ( ${dist}/${PN}-src-${TARBALL_VERSION}.tar.xz )"
17 for arch in amd64 arm ppc x86; do
20 ${dist}/${PN}-core-${TARBALL_VERSION}-${arch}.tar.xz
21 examples? ( ${dist}/${PN}-examples-${TARBALL_VERSION}-${arch}.tar.xz )
25 LICENSE="GPL-2-with-linking-exception"
27 KEYWORDS="-* ~amd64 ~arm ~ppc ~x86"
29 IUSE="+X +alsa cjk +cups doc examples nsplugin pulseaudio selinux source webstart"
30 REQUIRED_USE="nsplugin? ( X )"
37 >=media-libs/alsa-lib-1.0"
42 >=dev-libs/glib-2.40:2
43 >=media-libs/fontconfig-2.11:1.0
44 >=media-libs/freetype-2.5.3:2
47 >=x11-libs/gtk+-2.24:2
49 >=x11-libs/libXext-1.3
51 >=x11-libs/libXrender-0.9.4
52 >=x11-libs/libXtst-1.2
53 >=x11-libs/pango-1.36"
56 >=media-libs/giflib-4.1.6-r1
57 >=media-libs/lcms-2.6:2
58 media-libs/libpng:0/16
61 >=sys-libs/zlib-1.2.3-r1
64 # cups is needed for X. #390945 #390975
65 # gsettings-desktop-schemas is needed for native proxy support. #431972
66 RDEPEND="${COMMON_DEP}
72 media-fonts/arphicfonts
73 media-fonts/baekmuk-fonts
75 media-fonts/lohit-fonts
79 alsa? ( ${ALSA_COMMON_DEP} )
80 cups? ( ${CUPS_COMMON_DEP} )
81 selinux? ( sec-policy/selinux-java )
82 >=gnome-base/gsettings-desktop-schemas-3.12.2"
84 DEPEND="!arm? ( dev-util/patchelf )"
86 PDEPEND="webstart? ( dev-java/icedtea-web:0[icedtea7] )
87 nsplugin? ( dev-java/icedtea-web:0[icedtea7,nsplugin] )
88 pulseaudio? ( dev-java/icedtea-sound )"
91 if [[ "$(tc-is-softfloat)" != "no" ]]; then
92 die "These binaries require a hardfloat system."
97 # Ensures HeadlessGraphicsEnvironment is used.
99 rm -r jre/lib/$(get_system_arch)/xawt || die
102 # Reprefixify because prefix may be different.
103 sed -i 's:=/:=@GENTOO_PORTAGE_EPREFIX@/:' jre/lib/fontconfig.Gentoo.properties || die
104 eprefixify jre/lib/fontconfig.Gentoo.properties
106 # Fix the RPATHs, except on arm.
107 # https://bugs.gentoo.org/show_bug.cgi?id=543658#c3
108 # https://github.com/NixOS/patchelf/issues/8
110 ewarn "The RPATHs on these binaries are normally modified to avoid"
111 ewarn "conflicts with an icedtea installation built from source. This"
112 ewarn "is currently not possible on ARM so please refrain from"
113 ewarn "installing dev-java/icedtea on the same system."
115 local old="/usr/$(get_libdir)/icedtea${SLOT}"
116 local new="${EPREFIX}/opt/${P}"
119 for elf in $(find -type f -executable ! -name "*.cgi" || die); do
120 rpath=$(patchelf --print-rpath "${elf}" || die "patchelf ${elf}")
122 if [[ -n "${rpath}" ]]; then
123 patchelf --set-rpath "${rpath//${old}/${new}}" "${elf}" || die "patchelf ${elf}"
130 local dest="/opt/${P}"
131 local ddest="${ED}${dest#/}"
134 # doins doesn't preserve executable bits.
135 cp -pRP bin include jre lib man "${ddest}" || die
137 dodoc doc/{ASSEMBLY_EXCEPTION,AUTHORS,NEWS,README,THIRD_PARTY_README}
138 use doc && dodoc -r doc/html
140 if use examples; then
141 cp -pRP demo sample "${ddest}" || die
145 cp src.zip "${ddest}" || die
148 if use webstart || use nsplugin; then
149 dosym /usr/libexec/icedtea-web/itweb-settings "${dest}/bin/itweb-settings"
150 dosym /usr/libexec/icedtea-web/itweb-settings "${dest}/jre/bin/itweb-settings"
152 if use webstart; then
153 dosym /usr/libexec/icedtea-web/javaws "${dest}/bin/javaws"
154 dosym /usr/libexec/icedtea-web/javaws "${dest}/jre/bin/javaws"
157 # Both icedtea itself and the icedtea ebuild set PAX markings but we
158 # disable them for the icedtea-bin build because the line below will
159 # respect end-user settings when icedtea-bin is actually installed.
160 java-vm_set-pax-markings "${ddest}"
163 java-vm_revdep-mask "${dest}"
164 java-vm_sandbox-predict /proc/self/coredump_filter
168 if use nsplugin; then
169 if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 7.2.4.3 ${REPLACING_VERSIONS} ]]; then
170 elog "The nsplugin for icedtea-bin is now provided by the icedtea-web package"
171 elog "If you had icedtea-bin-7 nsplugin selected, you may see a related error below"
172 elog "The switch should complete properly during the subsequent installation of icedtea-web"
173 elog "Afterwards you may verify the output of 'eselect java-nsplugin list' and adjust accordingly'"
177 # Set as default VM if none exists
178 java-vm-2_pkg_postinst