You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.2 KiB
93 lines
2.2 KiB
2 years ago
|
# Copyright 1999-2023 Gentoo Authors
|
||
8 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
2 years ago
|
EAPI=8
|
||
8 years ago
|
|
||
|
inherit flag-o-matic toolchain-funcs
|
||
|
|
||
|
DESCRIPTION="Tcl bindings to OpenGL and other 3D libraries"
|
||
|
HOMEPAGE="http://www.tcl3d.org"
|
||
|
SRC_URI="http://www.tcl3d.org/download/${P}.distrib/${PN}-src-${PV}.zip"
|
||
|
|
||
|
LICENSE="BSD"
|
||
|
SLOT="0"
|
||
5 years ago
|
KEYWORDS="amd64 x86"
|
||
6 years ago
|
IUSE="debug ode osg sdl truetype"
|
||
8 years ago
|
|
||
6 years ago
|
RDEPEND="dev-lang/tcl:0=
|
||
8 years ago
|
dev-lang/tk:0=
|
||
6 years ago
|
x11-libs/libXi
|
||
8 years ago
|
x11-libs/libXmu
|
||
6 years ago
|
virtual/opengl
|
||
|
virtual/glu
|
||
|
ode? ( dev-games/ode )
|
||
|
osg? ( dev-games/openscenegraph )
|
||
|
truetype? ( media-libs/ftgl )
|
||
|
sdl? ( media-libs/libsdl )"
|
||
|
DEPEND="${RDEPEND}
|
||
5 years ago
|
>=dev-lang/swig-1.3.38:0=
|
||
|
app-arch/unzip"
|
||
8 years ago
|
|
||
|
S="${WORKDIR}/${PN}"
|
||
2 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}/${P}-include-tk-dir-and-permissive.patch"
|
||
|
"${FILESDIR}/${P}-implicit.patch"
|
||
|
)
|
||
8 years ago
|
|
||
3 years ago
|
src_prepare() {
|
||
|
sed -i \
|
||
|
-e '/\..$(DSEP)pkgIndex.tcl/d' \
|
||
|
tcl3d*/Makefile \
|
||
|
|| die
|
||
|
|
||
|
default
|
||
|
}
|
||
|
|
||
6 years ago
|
src_configure() {
|
||
8 years ago
|
local _TCL_V=( $(echo 'puts [info tclversion]' | tclsh | tr '.' ' ') )
|
||
|
local _TCL_FV="${_TCL_V[0]}.${_TCL_V[1]}"
|
||
|
|
||
|
einfo "Configuring for Tcl ${_TCL_FV}"
|
||
|
sed -i \
|
||
|
-e 's:^\(TCLMAJOR\) *=\(.*\)$:\1 = '${_TCL_V[0]}':' \
|
||
|
-e 's:^\(TCLMINOR\) *=\(.*\)$:\1 = '${_TCL_V[1]}':' \
|
||
2 years ago
|
-e "s:lib64:$(get_libdir):" \
|
||
8 years ago
|
config_Linux* || die
|
||
|
|
||
|
# Fix libSDL link
|
||
|
sed -i -e 's:-lSDL-1\.2:-lSDL:g' tcl3dSDL/Makefile || die
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
append-flags -fPIC
|
||
|
use debug || append-flags -DNDEBUG
|
||
|
|
||
6 years ago
|
# 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="
|
||
|
|
||
8 years ago
|
# 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.
|
||
|
emake \
|
||
|
-j1 \
|
||
|
INSTDIR="/usr" \
|
||
|
OPT="${CFLAGS}" \
|
||
|
CC="$(tc-getCC) -c" \
|
||
|
CXX="$(tc-getCXX) -c" \
|
||
|
LD="$(tc-getLD)" \
|
||
4 years ago
|
LDOUT="${LDFLAGS} -o" \
|
||
4 years ago
|
SHLIB_LD="$(tc-getCC) -shared" \
|
||
|
SHLIB_LDXX="$(tc-getCXX) -shared" \
|
||
6 years ago
|
${CONFIG_PLUGIN}
|
||
8 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
emake INSTDIR="${D}/usr" DESTDIR="${D}" INSTLIB="${D}/usr/$(get_libdir)" install
|
||
3 years ago
|
insinto /usr/$(get_libdir)/${PN}${PV}
|
||
|
doins pkgIndex.tcl
|
||
8 years ago
|
}
|