commit:     57873ee92cd02014079d597b28c57b1054281ede
Author:     Tupone Alfredo <tupone <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 09:35:13 2018 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 09:35:13 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57873ee9

dev-tcltk/tcl3d: Fix missing RDEPEND and modularize

Closes: https://bugs.gentoo.org/619410
Package-Manager: Portage-2.3.49, Repoman-2.3.10

 dev-tcltk/tcl3d/metadata.xml       |  8 ++++++++
 dev-tcltk/tcl3d/tcl3d-0.5.0.ebuild | 39 ++++++++++++++++++++------------------
 2 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/dev-tcltk/tcl3d/metadata.xml b/dev-tcltk/tcl3d/metadata.xml
index 851c8cbb058..2b1fbebe51e 100644
--- a/dev-tcltk/tcl3d/metadata.xml
+++ b/dev-tcltk/tcl3d/metadata.xml
@@ -5,6 +5,14 @@
        <email>tc...@gentoo.org</email>
        <name>Gentoo Tcltk Project</name>
 </maintainer>
+<use>
+       <flag name="ode">
+               Enable support for physics engine from <pkg>dev-games/ode</pkg>
+       </flag>
+       <flag name="osg">
+               Enable support for 3D toolkit from 
<pkg>dev-games/openscenegraph</pkg>
+       </flag>
+</use>
 <longdescription>
 Tcl3D offers the 3D functionality of OpenGL and other 3D libraries at the Tcl 
scripting level.
 The Tcl3D package currently consists of the following modules:

diff --git a/dev-tcltk/tcl3d/tcl3d-0.5.0.ebuild 
b/dev-tcltk/tcl3d/tcl3d-0.5.0.ebuild
index e9a64f8be86..1b077585124 100644
--- a/dev-tcltk/tcl3d/tcl3d-0.5.0.ebuild
+++ b/dev-tcltk/tcl3d/tcl3d-0.5.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -12,26 +12,25 @@ 
SRC_URI="http://www.tcl3d.org/download/${P}.distrib/${PN}-src-${PV}.zip";
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="debug"
+IUSE="debug ode osg sdl truetype"
 
-DEPEND="
-       >=dev-lang/swig-1.3.38:0=
+RDEPEND="dev-lang/tcl:0=
        dev-lang/tk:0=
-       dev-lang/tcl:0=
-       dev-games/ode
-       dev-games/openscenegraph
-       media-libs/libsdl
-       media-libs/ftgl
-       virtual/opengl
+       x11-libs/libXi
        x11-libs/libXmu
-"
+       virtual/opengl
+       virtual/glu
+       ode? ( dev-games/ode )
+       osg? ( dev-games/openscenegraph )
+       truetype? ( media-libs/ftgl )
+       sdl? ( media-libs/libsdl )"
+DEPEND="${RDEPEND}
+       >=dev-lang/swig-1.3.38:0="
 
 S="${WORKDIR}/${PN}"
 PATCHES=( "${FILESDIR}/${P}-include-tk-dir-and-permissive.patch" )
 
-src_prepare() {
-       default
-
+src_configure() {
        local _TCL_V=( $(echo 'puts [info tclversion]' | tclsh | tr '.' ' ') )
        local _TCL_FV="${_TCL_V[0]}.${_TCL_V[1]}"
 
@@ -49,6 +48,13 @@ src_compile() {
        append-flags -fPIC
        use debug || append-flags -DNDEBUG
 
+       # Configure wrapper
+       local CONFIG_PLUGIN="WRAP_GL2PS="
+       use truetype || CONFIG_PLUGIN+=" WRAP_FTGL="
+       use ode || CONFIG_PLUGIN+=" WRAP_ODE="
+       use osg || CONFIG_PLUGIN+=" WRAP_OSG="
+       use sdl || CONFIG_PLUGIN+=" WRAP_SDL="
+
        # Restricting build to -j1 since it seems that if we build it in 
parallel,
        # it fails with the "tcl3dOsg" project attempting to import glewdefs.i,
        # and not finding it.
@@ -59,10 +65,7 @@ src_compile() {
                CC="$(tc-getCC) -c" \
                CXX="$(tc-getCXX) -c" \
                LD="$(tc-getLD)" \
-               WRAP_FTGL=1 \
-               WRAP_SDL=1 \
-               WRAP_GL2PS=0 \
-               WRAP_ODE=1
+               ${CONFIG_PLUGIN}
 }
 
 src_install() {

Reply via email to