# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 inherit cuda eutils flag-o-matic portability toolchain-funcs unpacker versionator MYD=$(get_version_component_range 1)_$(get_version_component_range 2) DESCRIPTION="NVIDIA CUDA Software Development Kit" HOMEPAGE="http://developer.nvidia.com/cuda" CURI="http://developer.download.nvidia.com/compute/cuda/${MYD}/rel/installers" SRC_URI=" amd64? ( ${CURI}/cuda_${PV}_linux_64.run ) x86? ( ${CURI}/cuda_${PV}_linux_32.run )" LICENSE="CUDPP" SLOT="0" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" IUSE="debug +doc +examples opencl +cuda" RDEPEND=" ~dev-util/nvidia-cuda-toolkit-${PV} media-libs/freeglut examples? ( media-libs/freeimage media-libs/glew:0= virtual/mpi >=x11-drivers/nvidia-drivers-340.32[uvm] x86? ( /dev/null for _subdir in *; do emake -C ${_subdir} run done popd > /dev/null done } src_install() { local i j f t crap="" if use doc; then ebegin "Installing docs ..." treecopy $(find -type f \( -name readme.txt -o -name "*.pdf" \)) "${ED}"/usr/share/doc/${PF}/ docompress -x $(find "${ED}"/usr/share/doc/${PF}/ -type f -name readme.txt | sed -e "s:${ED}::") eend fi crap+=" *.txt Samples.htm*" ebegin "Cleaning before installation..." for i in ${crap}; do if [[ -e ${i} ]]; then find ${i} -delete || die fi done find -type f \( -name "*.o" -o -name "*.pdf" -o -name "readme.txt" \) -delete || die eend ebegin "Moving files..." for f in $(find .); do local t="$(dirname ${f})" if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then continue fi if [[ ! -d ${f} ]]; then if [[ -x ${f} ]]; then exeinto /opt/cuda/sdk/${t} doexe ${f} else insinto /opt/cuda/sdk/${t} doins ${f} fi fi done eend }