# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit versionator MY_PV="$(get_version_component_range 1-2)" MY_DATE="February2010" DESCRIPTION="NVIDIA's C graphics compiler toolkit" HOMEPAGE="http://developer.nvidia.com/object/cg_toolkit.html" SRC_URI="x86? ( http://developer.download.nvidia.com/cg/Cg_${MY_PV}/Cg-${MY_PV}_${MY_DATE}_x86.tgz ) amd64? ( http://developer.download.nvidia.com/cg/Cg_${MY_PV}/Cg-${MY_PV}_${MY_DATE}_x86_64.tgz )" LICENSE="NVIDIA" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RESTRICT="strip" RDEPEND="media-libs/freeglut x86? ( virtual/libstdc++:3.3 )" S=${WORKDIR} DEST=/opt/${PN} src_install() { into ${DEST} dobin usr/bin/* || die exeinto ${DEST}/lib if use x86 ; then doexe usr/lib/* || die elif use amd64 ; then doexe usr/lib64/* || die fi insinto ${DEST}/include/Cg doins usr/include/Cg/* dosym ${DEST}/include/Cg /usr/include/Cg insinto ${DEST}/man/man3 doins usr/share/man/man3/* insinto ${DEST} doins -r usr/local/Cg/{docs,examples,README} cat > "${T}/env" << EOF # Configures the CG Runtime environment for Bourne shell and compatible shells CG_COMPILER_EXE="${DEST}/bin/cgc" # Make sure the helper files are found PATH="${DEST}/bin" LDPATH="${DEST}/lib" MANPATH="${DEST}/man" EOF newenvd "${T}/env" 80cgc } pkg_postinst() { einfo "Starting with ${CATEGORY}/${PN}-2.1.0016, ${PN} is installed in" einfo "${DEST}. Packages might have to add something like:" einfo " append-cppflags -I${DEST}/include" einfo "Starting with ${CATEGORY}/${PN}-2.2.0006, the cgc binary isn't" einfo "symlinked to /opt/bin, but to ${DEST}/bin is but into " einfo "\$\{PATH\} environment variable." }