# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils autotools cvs flag-o-matic multilib DESCRIPTION="Powerful Constructive Solid Geometry modeling system." HOMEPAGE="http://brlcad.org/" ECVS_SERVER="brlcad.cvs.sf.net:/cvsroot/${PN}" ECVS_MODULE="${PN}" ECVS_UP_OPTS="-dP ${PN}" S="${WORKDIR}/${PN}" LICENSE="GPL-2 LGPL-2 GFDL BSD" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="debug" brlcadprefix="/usr/brlcad" DEPEND="media-libs/libpng sys-libs/zlib dev-tcltk/itcl dev-tcltk/itk dev-tcltk/blt dev-tcltk/iwidgets media-libs/urt" RDEPEND="${DEPEND}" src_compile() { local myconf cd "${S}" epatch ${FILESDIR}/usr-local.patch #--as-needed causes compiling errors filter-ldflags "-Wl,--as-needed" sh autogen.sh myconf="${myconf} --prefix=${brlcadprefix} \ --libdir=${brlcadprefix}/$(get_libdir) \ --enable-optimized --enable-tcl-build --enable-tk-build \ --enable-opennurbs-build=yes --with-pic \ --with-tag " use debug && myconf="${myconf} --enable-debug" || myconf="${myconf} --disable-debug --enable-optimized" econf $myconf || die "configure failed" emake || die "emake failed" } src_install() { einfo install emake DESTDIR="${D}" install || die "emake install failed" #fix broken symlink cd ${D}/${brlcadprefix}/$(get_libdir) rm librtserver.so ln -s librt.so.19.0.1 librtserver.so } pkg_postinst() { einfo "setting up /etc/env.d/99brlcad" dodir /etc/env.d || die echo "PATH=${brlcadprefix}/bin" > "${D}"/etc/env.d/99brlcad || die echo "LDPATH=${brlcadprefix}/$(get_libdir)" >> "${D}"/etc/env.d/99brlcad || die echo "MANPATH=${brlcadprefix}/man" >> "${D}"/etc/env.d/99brlcad || die echo "ITK_LIBRARY=$(find ${brlcadprefix}/$(get_libdir) -maxdepth 1 -type d -name 'itk*' -print)" >> "${D}"/etc/env.d/99brlcad || die echo "ITCL_LIBRARY=$(find ${brlcadprefix}/$(get_libdir) -maxdepth 1 -type d -name 'itcl*' -print)" >> "${D}"/etc/env.d/99brlcad || die einfo "The standard starting point for BRL-CAD is the mged" einfo "command. Examples are available in ${brlcadprefix}/db." einfo "To run an example, try:" einfo "${brlcadprefix}/bin/mged ${brlcadprefix}/db/havoc.g" einfo "In the mged terminal window, type 'draw havoc' to see" einfo "the wireframe in the visualization window." }