# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-gfx/freewrl/freewrl-1.19.1.ebuild,v 1.2 2007/07/22 10:02:16 dberkholz Exp $ EAPI=2 inherit nsplugins eutils flag-o-matic DESCRIPTION="VRML2 and X3D compliant browser" SRC_URI="mirror://sourceforge/freewrl/${P}.tar.bz2" HOMEPAGE="http://freewrl.sourceforge.net/" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug libeai +motif +nsplugin +sox spidermonkey static xulrunner" DEPEND="x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext x11-libs/libX11 motif? ( x11-libs/openmotif ) media-libs/mesa virtual/opengl media-libs/libpng media-libs/jpeg >=media-libs/freetype-2 || ( xulrunner? ( net-libs/xulrunner ) spidermonkey? ( dev-lang/spidermonkey ) >=www-client/mozilla-firefox-2.0 ) nsplugin? ( || ( xulrunner? ( net-libs/xulrunner ) >=www-client/mozilla-firefox-2.0 ) ) >=dev-util/pkgconfig-0.23" RDEPEND="${DEPEND} media-fonts/ttf-bitstream-vera media-gfx/imagemagick app-arch/unzip sox? ( media-sound/sox )" src_configure() { myconf="$(use_enable nsplugin plugin) $(use_enable debug) $(use_enable static) $(use_enable sox sound) $(use_enable libeai)" myconf="${myconf} --with-fontsdir=/usr/share/fonts/ttf-bitstream-vera" myconf="${myconf} --with-imageconvert=/usr/bin/convert" myconf="${myconf} --with-unzip=/usr/bin/unzip" if use sox; then myconf="${myconf} --with-soundconv=/usr/bin/sox" fi if use motif; then myconf="${myconf} --with-x --with-target=motif" else myconf="${myconf} --with-x --with-target=x11" fi if use nsplugin; then myconf="${myconf} --with-plugindir=/usr/$(get_libdir)/${PLUGINS_DIR}" fi if use xulrunner; then if use spidermonkey; then eerror "Please choose only one of xulrunner or spidermonkey." die "Cannot USE both spidermonkey and xulrunner" fi if has_version "=net-libs/xulrunner-1.9*" ; then # fix missing library path to xulrunner-1.9 libraries append-ldflags "-R/usr/$(get_libdir)/xulrunner-1.9/lib" fi elif use spidermonkey; then # spidermonkey has no pkg-config, so override ./configure JAVASCRIPT_ENGINE_CFLAGS="-I/usr/include/js -DXP_UNIX" JAVASCRIPT_ENGINE_LIBS="-ljs" if built_with_use dev-lang/spidermonkey threadsafe ; then JAVASCRIPT_ENGINE_CFLAGS="${JAVASCRIPT_ENGINE_CFLAGS} -DJS_THREADSAFE $(pkg-config --cflags nspr)" JAVASCRIPT_ENGINE_LIBS="$(pkg-config --libs nspr) ${JAVASCRIPT_ENGINE_LIBS}" fi export JAVASCRIPT_ENGINE_CFLAGS export JAVASCRIPT_ENGINE_LIBS else # not using xulrunner, so ./configure grabs js directly from firefox/mozilla/thunderbird/wherever if has_version "=www-client/mozilla-firefox-3*" ; then # override ./configure for firefox-3 as pkg-config doesn't detect the right settings export MOZILLA_PLUGIN_CFLAGS="-I/usr/include/mozilla-firefox/stable $(pkg-config --cflags nspr)" export MOZILLA_PLUGIN_LIBS=" " export JAVASCRIPT_ENGINE_CFLAGS="-DXP_UNIX -DJS_THREADSAFE -DMOZILLA_JS_UNSTABLE_INCLUDES ${MOZILLA_PLUGIN_CFLAGS}" export JAVASCRIPT_ENGINE_LIBS="$(pkg-config --libs nspr) -L/usr/$(get_libdir)/mozilla-firefox -lmozjs" append-ldflags "-R/usr/$(get_libdir)/mozilla-firefox" fi fi econf ${myconf} || die "econf failed" } src_install() { MAKEOPTS="-j1" # make install does not like to work in parallel emake DESTDIR="${D}" install || die "emake install failed" }