# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 README_GENTOO_SUFFIX="-r1" inherit autotools eutils multilib readme.gentoo-r1 java-pkg-2 xdg-utils DESCRIPTION="FOSS Java browser plugin and Web Start implementation" HOMEPAGE="http://icedtea.classpath.org" SHA="fcb841380712" #SRC_URI="http://icedtea.classpath.org/download/source/${P}.tar.gz" #SRC_URI="http://icedtea.classpath.org/hg/release/icedtea-web-1.7/archive/${SHA}.tar.gz" SRC_URI="https://github.com/AdoptOpenJDK/IcedTea-Web/archive/${PF}.tar.gz" S="${WORKDIR}/IcedTea-Web-${PF}" LICENSE="GPL-2 GPL-2-with-linking-exception LGPL-2" SLOT="8" KEYWORDS="amd64 ~arm ~arm64 ppc64 x86" IUSE="doc javascript nsplugin tagsoup test" RESTRICT="test" CDEPEND="javascript? ( dev-java/rhino:1.6 ) nsplugin? ( >=dev-libs/glib-2.16:2= ) tagsoup? ( dev-java/tagsoup:0 )" DEPEND="${CDEPEND} app-arch/zip virtual/jdk:1.8 virtual/pkgconfig nsplugin? ( net-misc/npapi-sdk ) test? ( >=dev-java/junit-4.8:4 )" RDEPEND="${CDEPEND} >=app-eselect/eselect-java-0.2.0 virtual/jre:1.8 nsplugin? ( !dev-java/oracle-jdk-bin[nsplugin] !dev-java/oracle-jre-bin[nsplugin] )" #RESTRICT=network-sandbox # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2855 PATCHES=( "${FILESDIR}"/${PN}-1.6-respect-ldflags.patch #"${FILESDIR}"/jdk11.patch ) pkg_setup() { JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" JAVA_PKG_WANT_SOURCE="${SLOT}" JAVA_PKG_WANT_TARGET="${SLOT}" # The nastiness below is necessary while the gentoo-vm USE flag is # masked. First we call java-pkg-2_pkg_setup if it looks like the # flag was unmasked against one of the possible build VMs. If not, # we try finding one of them in their expected locations. This would # have been slightly less messy if openjdk-bin had been installed to # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env # file but disable it so that it would not normally be selectable. local vm for vm in ${JAVA_PKG_WANT_BUILD_VM}; do if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then java-pkg-2_pkg_setup return fi done if has_version --host-root dev-java/openjdk:${SLOT}; then export JAVA_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} export JDK_HOME="${JAVA_HOME}" export ANT_RESPECT_JAVA_HOME=ture else if [[ ${MERGE_TYPE} != "binary" ]]; then JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) [[ -n ${JDK_HOME} ]] || die "Build VM not found!" JDK_HOME=${JDK_HOME#*/} JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} export JDK_HOME export JAVA_HOME="${JDK_HOME}" export ANT_RESPECT_JAVA_HOME=ture fi fi } src_prepare() { default if java-pkg_is-vm-version-ge "1.8" ; then sed -i 's/JAVADOC_OPTS=/\0-Xdoclint:none /g' Makefile.am || die fi #rm Windows dep sed -i '/dunce/d' "${S}"/rust-launcher/Cargo.toml || die "dunce" eautoreconf } src_configure() { local tagsoup use tagsoup && tagsoup="$(java-pkg_getjars tagsoup)" local config=( # Rename javaws to itweb-javaws as eselect java-vm manages # javaws to prevent a clash with Oracle's implementation. --program-transform-name='s/^javaws$/itweb-javaws/' --libdir="${EPREFIX}"/usr/$(get_libdir)/nsbrowser/plugins --with-java="${EPREFIX}"/usr/bin/java --with-jdk-home="${JAVA_HOME}" ##--with-itw-libs=BUNDLED --with-itw-libs=DISTRIBUTION --enable-shell-launchers --with-browser-tests=no --with-junit=no $(use_enable doc docs) $(use_enable nsplugin native-plugin) $(use_with javascript rhino) $(use_with tagsoup tagsoup "${tagsoup}") ) # See bug #573060. xdg_environment_reset # Rely on the --with-jdk-home option given above. #unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS econf "${config[@]}" } src_compile() { emake -j1 } src_install() { default rm -r ${D}/usr/share/bash-completion || die "rm bash completions" readme.gentoo_create_doc } pkg_postinst() { readme.gentoo_print_elog }