| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-gfx/freewrl/freewrl-1.22.13.ebuild,v 1.5 2012/08/29 14:25:19 axs Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit autotools nsplugins eutils flag-o-matic java-pkg-opt-2 multilib
|
| 8 |
|
| 9 |
DESCRIPTION="VRML97 and X3D compliant browser, library, and web-browser plugin"
|
| 10 |
HOMEPAGE="http://freewrl.sourceforge.net/"
|
| 11 |
SRC_URI="mirror://sourceforge/freewrl/${P}.1.tar.bz2"
|
| 12 |
|
| 13 |
LICENSE="GPL-3"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="~amd64 ~x86"
|
| 16 |
IUSE="curl debug +glew java libeai motif +nsplugin osc +sox static-libs"
|
| 17 |
|
| 18 |
COMMONDEPEND="x11-libs/libXau
|
| 19 |
x11-libs/libXdmcp
|
| 20 |
x11-libs/libXext
|
| 21 |
x11-libs/libX11
|
| 22 |
motif? ( x11-libs/openmotif )
|
| 23 |
!motif? ( x11-libs/libXaw )
|
| 24 |
media-libs/mesa
|
| 25 |
glew? ( media-libs/glew )
|
| 26 |
virtual/opengl
|
| 27 |
media-libs/libpng
|
| 28 |
virtual/jpeg
|
| 29 |
media-libs/imlib2
|
| 30 |
>=media-libs/freetype-2
|
| 31 |
media-libs/fontconfig
|
| 32 |
curl? ( net-misc/curl )
|
| 33 |
osc? ( media-libs/liblo )
|
| 34 |
dev-lang/spidermonkey"
|
| 35 |
DEPEND="${COMMONDEPEND}
|
| 36 |
virtual/pkgconfig
|
| 37 |
java? ( >=virtual/jdk-1.4 )
|
| 38 |
nsplugin? ( net-misc/npapi-sdk )"
|
| 39 |
RDEPEND="${COMMONDEPEND}
|
| 40 |
media-fonts/dejavu
|
| 41 |
|| ( media-gfx/imagemagick
|
| 42 |
media-gfx/graphicsmagick[imagemagick] )
|
| 43 |
app-arch/unzip
|
| 44 |
java? ( >=virtual/jre-1.4 )
|
| 45 |
sox? ( media-sound/sox )"
|
| 46 |
|
| 47 |
src_prepare() {
|
| 48 |
epatch "${FILESDIR}"/${P}-fontconfig-match.patch
|
| 49 |
if has_version ">=dev-lang/spidermonkey-1.8.7" ; then
|
| 50 |
epatch "${FILESDIR}"/${P}-mozjs187-config.patch
|
| 51 |
eautoreconf
|
| 52 |
fi
|
| 53 |
}
|
| 54 |
|
| 55 |
src_configure() {
|
| 56 |
local myconf="--enable-fontconfig
|
| 57 |
--without-expat
|
| 58 |
--with-x
|
| 59 |
--with-imageconvert=/usr/bin/convert
|
| 60 |
--with-unzip=/usr/bin/unzip"
|
| 61 |
if use motif; then
|
| 62 |
myconf+=" --with-target=motif --with-statusbar=standard"
|
| 63 |
else
|
| 64 |
myconf+=" --with-target=x11 --with-statusbar=hud"
|
| 65 |
fi
|
| 66 |
if use nsplugin; then
|
| 67 |
myconf+=" --with-plugindir=/usr/$(get_libdir)/${PLUGINS_DIR}"
|
| 68 |
myconf+=" --disable-mozilla-plugin --disable-xulrunner-plugin"
|
| 69 |
fi
|
| 70 |
if use sox; then
|
| 71 |
myconf+=" --with-soundconv=/usr/bin/sox"
|
| 72 |
fi
|
| 73 |
# disable the checks for other js libs, in case they are installed
|
| 74 |
if has_version ">=dev-lang/spidermonkey-1.8.5" ; then
|
| 75 |
# spidermonkey-1.8.5 provides a .pc to pkg-config, it should be findable via mozjs185
|
| 76 |
for x in mozilla-js xulrunner-js firefox-js firefox2-js seamonkey-js; do
|
| 77 |
myconf+=" --disable-${x}"
|
| 78 |
done
|
| 79 |
else
|
| 80 |
for x in mozjs187 mozjs185 mozilla-js xulrunner-js firefox-js seamonkey-js; do
|
| 81 |
myconf+=" --disable-${x}"
|
| 82 |
done
|
| 83 |
# spidermonkey pre-1.8.5 has no pkg-config, so override ./configure
|
| 84 |
JAVASCRIPT_ENGINE_CFLAGS="-I/usr/include/js -DXP_UNIX"
|
| 85 |
if has_version ">=dev-lang/spidermonkey-1.8" ; then
|
| 86 |
# spidermonkey-1.8 changed the name of the lib
|
| 87 |
JAVASCRIPT_ENGINE_LIBS="-lmozjs"
|
| 88 |
else
|
| 89 |
JAVASCRIPT_ENGINE_LIBS="-ljs"
|
| 90 |
fi
|
| 91 |
if has_version dev-lang/spidermonkey[threadsafe] ; then
|
| 92 |
JAVASCRIPT_ENGINE_CFLAGS+=" -DJS_THREADSAFE $(pkg-config --cflags nspr)"
|
| 93 |
JAVASCRIPT_ENGINE_LIBS="$(pkg-config --libs nspr) ${JAVASCRIPT_ENGINE_LIBS}"
|
| 94 |
fi
|
| 95 |
export JAVASCRIPT_ENGINE_CFLAGS
|
| 96 |
export JAVASCRIPT_ENGINE_LIBS
|
| 97 |
fi
|
| 98 |
econf ${myconf} \
|
| 99 |
$(use_enable curl libcurl) \
|
| 100 |
$(use_with glew) \
|
| 101 |
$(use_enable debug) $(use_enable debug thread_colorized) \
|
| 102 |
$(use_enable libeai) \
|
| 103 |
$(use_enable java) \
|
| 104 |
$(use_enable nsplugin plugin) \
|
| 105 |
$(use_enable osc) \
|
| 106 |
$(use_enable static-libs static) \
|
| 107 |
$(use_enable sox sound)
|
| 108 |
}
|
| 109 |
|
| 110 |
src_install() {
|
| 111 |
emake DESTDIR="${D}" install
|
| 112 |
|
| 113 |
if use java; then
|
| 114 |
insinto /usr/share/${PN}/lib
|
| 115 |
doins src/java/java.policy
|
| 116 |
java-pkg_regjar src/java/vrml.jar
|
| 117 |
# install vrml.jar as a JRE extension
|
| 118 |
dodir /usr/java/packages/lib/ext
|
| 119 |
dosym /usr/share/${PN}/lib/vrml.jar /usr/java/packages/lib/ext/vrml.jar
|
| 120 |
elog "Because vrml.jar requires access to sockets, you will need to incorporate the"
|
| 121 |
elog "contents of /usr/share/${PN}/lib/java.policy into your system or user's default"
|
| 122 |
elog "java policy:"
|
| 123 |
elog " cat /usr/share/${PN}/lib/java.policy >>~/.java.policy"
|
| 124 |
fi
|
| 125 |
|
| 126 |
# remove unneeded .la files (as per Flameeyes' rant)
|
| 127 |
cd "${D}"
|
| 128 |
rm "usr/$(get_libdir)"/*.la "usr/$(get_libdir)/${PLUGINS_DIR}"/*.la
|
| 129 |
}
|
| 130 |
|
| 131 |
pkg_postinst() {
|
| 132 |
elog "By default, FreeWRL expects to find the 'firefox' binary in your include"
|
| 133 |
elog "path. If you do not have firefox installed or you wish to use a different"
|
| 134 |
elog "web browser to open links that are within VRML / X3D files, please be sure to"
|
| 135 |
elog "specify the command via your BROWSER environment variable."
|
| 136 |
}
|