# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit nsplugins eutils perl-module toolchain-funcs IUSE="nsplugin" DESCRIPTION="VRML2 and X3D compliant browser" SRC_URI="mirror://sourceforge/freewrl/${P}.tar.gz" HOMEPAGE="http://freewrl.sourceforge.net/" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" DEPEND="virtual/x11 virtual/opengl virtual/jdk media-libs/libpng media-libs/jpeg >=media-libs/freetype-2 >=dev-lang/perl-5.8.2 perl-core/ExtUtils-MakeMaker dev-perl/XML-Parser" RDEPEND="media-gfx/imagemagick media-sound/sox net-misc/wget ${DEPEND}" src_unpack() { unpack ${A} cd ${S} if use nsplugin; then # FIXME - need to use platform specific patch here # this patch works on Gentoo Linux x86 epatch "${FILESDIR}/enable-plugin.patch" else # disable plugin so that 'emake install' doesn't compile/install plugin epatch "${FILESDIR}/disable-plugin.patch" fi epatch "${FILESDIR}/plugin-install.patch" epatch "${FILESDIR}/use-java-home.patch" # enable this for 1.16 and above # epatch "${FILESDIR}/disable-rpm.patch" } src_compile() { cd ${S} perl Makefile.PL emake || die "make failed" if use nsplugin; then cd ${S}/Plugin # build plugin with -fPIC emake OPTIMIZER="$CFLAGS -DPIC -fPIC" || die "make failed" fi } src_install() { cd ${S} if use nsplugin; then # create plugins dir *before* emake install, so that plugin will get installed insinto /usr/$(get_libdir)/${PLUGINS_DIR} fi emake DESTDIR=${D} install || die "make install failed" if use nsplugin; then doins java/classes/vrml.jar fi }