Gentoo Archives: gentoo-commits

From: Nicolas Bock <nicolasbock@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-util/nvidia-cuda-toolkit/, dev-util/nvidia-cuda-toolkit/files/
Date: Fri, 31 May 2013 15:31:51
Message-Id: 1370000133.6aa523e5bee13e1083cae228d88ded14fd04e787.nicolasbock@gentoo
commit:     6aa523e5bee13e1083cae228d88ded14fd04e787
Author:     Andreas Schäfer <gentryx <AT> gmx <DOT> de>
AuthorDate: Fri May 31 11:35:33 2013 +0000
Commit:     Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
CommitDate: Fri May 31 11:35:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=6aa523e5

added cuda toolkit 5.5

---
 dev-util/nvidia-cuda-toolkit/ChangeLog             | 186 +++++++++++++++++++++
 dev-util/nvidia-cuda-toolkit/files/cuda-config.in  |  28 ++++
 .../files/nvidia-cuda-toolkit-2.2-enum_fix.patch   |  42 +++++
 .../files/nvidia-cuda-toolkit-3.0-enum_fix.patch   |  54 ++++++
 .../files/nvidia-cuda-toolkit-3.1-enum_fix.patch   |  24 +++
 dev-util/nvidia-cuda-toolkit/metadata.xml          |  19 +++
 .../nvidia-cuda-toolkit-5.5.11.ebuild              | 140 ++++++++++++++++
 7 files changed, 493 insertions(+)

diff --git a/dev-util/nvidia-cuda-toolkit/ChangeLog b/dev-util/nvidia-cuda-toolkit/ChangeLog
new file mode 100644
index 0000000..5dbb67d
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/ChangeLog
@@ -0,0 +1,186 @@
+# ChangeLog for dev-util/nvidia-cuda-toolkit
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-toolkit/ChangeLog,v 1.35 2011/01/06 22:13:37 spock Exp $
+
+  06 Jan 2011; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.2.ebuild:
+  Block old NVIDIA drivers to prevent collision in /usr/include/CL (bug
+  #348920).
+
+  12 Dec 2010; Michał Januszewski <spock@g.o>
+  -nvidia-cuda-toolkit-3.0_beta1.ebuild:
+  Remove the ebuild for 3.0-beta1.
+
+  12 Dec 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild, nvidia-cuda-toolkit-3.1.ebuild,
+  nvidia-cuda-toolkit-3.2.ebuild:
+  Install a /usr/include/CL symlink for the NVIDIA OpenCL headers.
+
+*nvidia-cuda-toolkit-3.2 (01 Dec 2010)
+
+  01 Dec 2010; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-3.2.ebuild:
+  Version bump.
+
+  06 Oct 2010; Samuli Suominen <ssuominen@g.o>
+  nvidia-cuda-toolkit-3.1.ebuild:
+  Fix libpng SLOT depend wrt #339796 by "MaratIK".
+
+  23 Sep 2010; Diego E. Pettenò <flameeyes@g.o>
+  nvidia-cuda-toolkit-2.2-r3.ebuild, nvidia-cuda-toolkit-2.3.ebuild,
+  nvidia-cuda-toolkit-3.0_beta1.ebuild, nvidia-cuda-toolkit-3.0.ebuild,
+  nvidia-cuda-toolkit-3.1.ebuild:
+  Remove wrong restrictions. Use the proper QA_* variables, not blanket
+  restrictions.
+
+  05 Jul 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild, nvidia-cuda-toolkit-3.1.ebuild:
+  Add env-update calls so that the CUDA libraries are picked up by other
+  ebuilds and apps (bug #320853).
+
+*nvidia-cuda-toolkit-3.1 (03 Jul 2010)
+
+  03 Jul 2010; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-3.1.ebuild,
+  +files/nvidia-cuda-toolkit-3.1-enum_fix.patch:
+  Version bump (bug #325831). Thanks to Clemens Rabe for the updated ebuild.
+
+  24 Jun 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild:
+  Add desktop entries for cudaprof and openclprof (no icons so far, as
+  NVIDIA does not provide any) (bug #323995).
+
+  24 Jun 2010; Michał Januszewski <spock@g.o>
+  -nvidia-cuda-toolkit-2.0.ebuild, -nvidia-cuda-toolkit-2.1.ebuild,
+  -nvidia-cuda-toolkit-2.2-r2.ebuild:
+  Remove old ebuilds.
+
+  24 Jun 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild:
+  Add a missing dependency on libpng-1.2 (bug #323985).
+
+  23 May 2010; Pacho Ramos <pacho@g.o>
+  nvidia-cuda-toolkit-2.3.ebuild:
+  stable amd64, bug 313067
+
+  10 May 2010; Pawel Hajdan jr <phajdan.jr@g.o>
+  nvidia-cuda-toolkit-2.3.ebuild:
+  x86 stable wrt bug #313067
+
+  01 Apr 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild,
+  +files/nvidia-cuda-toolkit-3.0-enum_fix.patch:
+  Add an enum fix for gcc pedantic mode (bug #311657), fix a typo in
+  src_install.
+
+  25 Mar 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0.ebuild:
+  Add a dep on >=sys-devel/binutils-2.20 (bug #279523).
+
+*nvidia-cuda-toolkit-3.0 (21 Mar 2010)
+
+  21 Mar 2010; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-3.0.ebuild, metadata.xml:
+  Version bump.
+
+  20 Jan 2010; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-3.0_beta1.ebuild:
+  Update the info about the required version of nvidia-drivers (bug
+  #301101).
+
+*nvidia-cuda-toolkit-3.0_beta1 (08 Jan 2010)
+
+  08 Jan 2010; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-3.0_beta1.ebuild:
+  Version bump (bug #298914).
+
+  01 Dec 2009; Christian Faulhammer <fauli@g.o>
+  nvidia-cuda-toolkit-2.2-r2.ebuild:
+  stable x86, bug 293641
+
+  25 Sep 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.1.ebuild:
+  Add a note that 2.1 should never become stable.
+
+*nvidia-cuda-toolkit-2.2-r3 (09 Aug 2009)
+
+  09 Aug 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.2-r3.ebuild:
+  Use older binaries to maintain compatiblity with gcc3 (bug #279523).
+
+  09 Aug 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.3.ebuild:
+  Add a dep on gcc4 (required for ABI compatibility).
+
+  07 Aug 2009; <chainsaw@g.o> nvidia-cuda-toolkit-2.0.ebuild:
+  Marked stable as requested by Michal "Spock" Januszewski
+  <spock@g.o> in bug #276538. Arch-tested by Víctor "VQuicksilver"
+  Enríquez using K3d & cuda-profiler.
+
+  29 Jul 2009; Michał Januszewski <spock@g.o>
+  -nvidia-cuda-toolkit-2.2.ebuild, -nvidia-cuda-toolkit-2.2-r1.ebuild:
+  Remove old ebuilds.
+
+*nvidia-cuda-toolkit-2.3 (29 Jul 2009)
+
+  29 Jul 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.3.ebuild:
+  Version bump.
+
+  19 Jul 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.0.ebuild, nvidia-cuda-toolkit-2.1.ebuild,
+  nvidia-cuda-toolkit-2.2.ebuild, nvidia-cuda-toolkit-2.2-r1.ebuild,
+  nvidia-cuda-toolkit-2.2-r2.ebuild:
+  Add a warning about gcc-4.4 not being supported by the NVIDIA CUDA
+  compiler (bug #278210)
+
+  08 Jul 2009; Christian Faulhammer <fauli@g.o>
+  nvidia-cuda-toolkit-2.0.ebuild:
+  stable x86, bug 276538
+
+*nvidia-cuda-toolkit-2.2-r2 (05 Jul 2009)
+
+  05 Jul 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.2-r2.ebuild, metadata.xml:
+  Add support for the CUDA debugger (bug #274100).
+
+  05 Jul 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.2-r1.ebuild:
+  Use system Qt4 libraries on x86. Restrict binchecks as this is a binary
+  package.
+
+*nvidia-cuda-toolkit-2.2-r1 (19 Jun 2009)
+
+  19 Jun 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.2-r1.ebuild,
+  +files/nvidia-cuda-toolkit-2.2-enum_fix.patch, metadata.xml:
+  Add support for the CUDA visual profiler (bug #274095).
+
+*nvidia-cuda-toolkit-2.2 (16 May 2009)
+
+  16 May 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.2.ebuild:
+  Version bump (bug #269894).
+
+  06 May 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.1.ebuild:
+  Add a temporary workaround for bug #266069.
+
+  13 Apr 2009; Michał Januszewski <spock@g.o>
+  nvidia-cuda-toolkit-2.1.ebuild:
+  Properly override the lib directory (bug #265722, patch by Georgi
+  Georgiev).
+
+*nvidia-cuda-toolkit-2.1 (21 Jan 2009)
+
+  21 Jan 2009; Michał Januszewski <spock@g.o>
+  +nvidia-cuda-toolkit-2.1.ebuild:
+  Version bump (bug #255128).
+
+*nvidia-cuda-toolkit-2.0 (18 Oct 2008)
+
+  18 Oct 2008; Michał Januszewski <spock@g.o> +metadata.xml,
+  +nvidia-cuda-toolkit-2.0.ebuild:
+  Initial commit. Thanks to everyone participating in bug #167685 for the
+  previous versions of the ebuild.
+

diff --git a/dev-util/nvidia-cuda-toolkit/files/cuda-config.in b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in
new file mode 100644
index 0000000..ca0d1d7
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/cuda-config.in
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+SUPPORT_GCC_VERSIONS_BY_CUDA="CUDA_SUPPORTED_GCC"
+
+_print_help() {
+	cat <<- EOF
+	Usage:
+		$(basename $0) [options]
+	
+		-s | --supported   Returns by current CUDA supported gcc versions
+		-h | --help        Shows this help
+	EOF
+}
+
+case ${1} in
+	-s|--supported)
+		echo "${SUPPORT_GCC_VERSIONS_BY_CUDA}"
+		exit 0
+		;;
+	-h|--help)
+		_print_help
+		exit -1
+		;;
+	*)
+		_print_help
+		exit 1
+		;;
+esac

diff --git a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-2.2-enum_fix.patch b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-2.2-enum_fix.patch
new file mode 100644
index 0000000..2155672
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-2.2-enum_fix.patch
@@ -0,0 +1,42 @@
+diff -Naurp cudatoolkit_orig/include/cuda.h cudatoolkit/include/cuda.h
+--- cudatoolkit_orig/include/cuda.h	2009-04-13 10:39:12.000000000 +0200
++++ cudatoolkit/include/cuda.h	2009-05-09 17:28:25.000000000 +0200
+@@ -86,7 +86,7 @@ typedef enum CUctx_flags_enum {
+     CU_CTX_SCHED_MASK  = 0x3,
+     CU_CTX_BLOCKING_SYNC = 4,   ///< Use blocking synchronization
+     CU_CTX_MAP_HOST = 8,        ///< Support mapped pinned allocations
+-    CU_CTX_FLAGS_MASK  = 0xf,
++    CU_CTX_FLAGS_MASK  = 0xf
+ } CUctx_flags;
+ 
+ /**
+@@ -94,7 +94,7 @@ typedef enum CUctx_flags_enum {
+  */
+ typedef enum CUevent_flags_enum {
+     CU_EVENT_DEFAULT       = 0, ///< Default event flag
+-    CU_EVENT_BLOCKING_SYNC = 1, ///< Event uses blocking synchronization
++    CU_EVENT_BLOCKING_SYNC = 1  ///< Event uses blocking synchronization
+ } CUevent_flags;
+ 
+ /**
+@@ -117,7 +117,7 @@ typedef enum CUarray_format_enum {
+ typedef enum CUaddress_mode_enum {
+     CU_TR_ADDRESS_MODE_WRAP = 0,    ///< Wrapping address mode
+     CU_TR_ADDRESS_MODE_CLAMP = 1,   ///< Clamp to edge address mode
+-    CU_TR_ADDRESS_MODE_MIRROR = 2,  ///< Mirror address mode
++    CU_TR_ADDRESS_MODE_MIRROR = 2   ///< Mirror address mode
+ } CUaddress_mode;
+ 
+ /**
+diff -Naurp cudatoolkit_orig/include/driver_types.h cudatoolkit/include/driver_types.h
+--- cudatoolkit_orig/include/driver_types.h	2009-04-13 10:39:06.000000000 +0200
++++ cudatoolkit/include/driver_types.h	2009-05-09 17:31:17.000000000 +0200
+@@ -140,7 +140,7 @@ enum cudaChannelFormatKind
+   cudaChannelFormatKindSigned           =   0,      ///< Signed channel format
+   cudaChannelFormatKindUnsigned         =   1,      ///< Unsigned channel format
+   cudaChannelFormatKindFloat            =   2,      ///< Float channel format
+-  cudaChannelFormatKindNone             =   3,      ///< No channel format
++  cudaChannelFormatKindNone             =   3       ///< No channel format
+ };
+ 
+ /**

diff --git a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.0-enum_fix.patch b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.0-enum_fix.patch
new file mode 100644
index 0000000..ce11b49
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.0-enum_fix.patch
@@ -0,0 +1,54 @@
+diff -Naur cuda.orig/include/cudaGL.h cuda/include/cudaGL.h
+--- cuda.orig/include/cudaGL.h	2010-03-21 13:19:57.000000000 +0100
++++ cuda/include/cudaGL.h	2010-03-21 13:46:29.000000000 +0100
+@@ -59,7 +59,7 @@
+ typedef enum CUGLmap_flags_enum {
+     CU_GL_MAP_RESOURCE_FLAGS_NONE          = 0x00,
+     CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY     = 0x01,
+-    CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,    
++    CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02
+ } CUGLmap_flags;
+ 
+ CUresult CUDAAPI cuGLInit(void);
+diff -Naur cuda.orig/include/cuda_gl_interop.h cuda/include/cuda_gl_interop.h
+--- cuda.orig/include/cuda_gl_interop.h	2010-03-21 13:19:57.000000000 +0100
++++ cuda/include/cuda_gl_interop.h	2010-03-21 13:28:07.000000000 +0100
+@@ -82,7 +82,7 @@
+ {
+   cudaGLMapFlagsNone         = 0,  ///< Default; Assume resource can be read/written
+   cudaGLMapFlagsReadOnly     = 1,  ///< CUDA kernels will not write to this resource
+-  cudaGLMapFlagsWriteDiscard = 2,  ///< CUDA kernels will only write to and will not read from this resource
++  cudaGLMapFlagsWriteDiscard = 2   ///< CUDA kernels will only write to and will not read from this resource
+ };
+ 
+ extern __host__ cudaError_t CUDARTAPI cudaGLRegisterBufferObject(GLuint bufObj);
+diff -Naur cuda.orig/include/driver_types.h cuda/include/driver_types.h
+--- cuda.orig/include/driver_types.h	2010-03-21 13:19:57.000000000 +0100
++++ cuda/include/driver_types.h	2010-03-21 13:26:09.000000000 +0100
+@@ -244,7 +244,7 @@
+ /*DEVICE_BUILTIN*/ 
+ enum cudaGraphicsRegisterFlags
+ {
+-  cudaGraphicsRegisterFlagsNone  = 0,  ///< Default
++  cudaGraphicsRegisterFlagsNone  = 0  ///< Default
+ };
+ 
+ /**
+@@ -255,7 +255,7 @@
+ {
+   cudaGraphicsMapFlagsNone         = 0,  ///< Default; Assume resource can be read/written
+   cudaGraphicsMapFlagsReadOnly     = 1,  ///< CUDA will not write to this resource
+-  cudaGraphicsMapFlagsWriteDiscard = 2,  ///< CUDA will only write to and will not read from this resource
++  cudaGraphicsMapFlagsWriteDiscard = 2   ///< CUDA will only write to and will not read from this resource
+ };
+ 
+ /**
+@@ -268,7 +268,7 @@
+   cudaGraphicsCubeFacePositiveY = 0x02, ///< Positive Y face of cubemap
+   cudaGraphicsCubeFaceNegativeY = 0x03, ///< Negative Y face of cubemap
+   cudaGraphicsCubeFacePositiveZ = 0x04, ///< Positive Z face of cubemap
+-  cudaGraphicsCubeFaceNegativeZ = 0x05, ///< Negative Z face of cubemap
++  cudaGraphicsCubeFaceNegativeZ = 0x05  ///< Negative Z face of cubemap
+ };
+ 
+ /**

diff --git a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.1-enum_fix.patch b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.1-enum_fix.patch
new file mode 100644
index 0000000..698d2c7
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-3.1-enum_fix.patch
@@ -0,0 +1,24 @@
+diff -Naur include.orig/cudaGL.h include/cudaGL.h
+--- include.orig/cudaGL.h	2010-04-28 09:31:16.000000000 +0200
++++ include/cudaGL.h	2010-05-21 00:04:47.000000000 +0200
+@@ -59,7 +59,7 @@
+ typedef enum CUGLmap_flags_enum {
+     CU_GL_MAP_RESOURCE_FLAGS_NONE          = 0x00,
+     CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY     = 0x01,
+-    CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,    
++    CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02
+ } CUGLmap_flags;
+ 
+ CUresult CUDAAPI cuGLInit(void);
+diff -Naur include.orig/cuda_gl_interop.h include/cuda_gl_interop.h
+--- include.orig/cuda_gl_interop.h	2010-04-28 09:30:46.000000000 +0200
++++ include/cuda_gl_interop.h	2010-05-21 00:05:08.000000000 +0200
+@@ -83,7 +83,7 @@
+ {
+   cudaGLMapFlagsNone         = 0,  ///< Default; Assume resource can be read/written
+   cudaGLMapFlagsReadOnly     = 1,  ///< CUDA kernels will not write to this resource
+-  cudaGLMapFlagsWriteDiscard = 2,  ///< CUDA kernels will only write to and will not read from this resource
++  cudaGLMapFlagsWriteDiscard = 2   ///< CUDA kernels will only write to and will not read from this resource
+ };
+ 
+ extern __host__ cudaError_t CUDARTAPI cudaGLRegisterBufferObject(GLuint bufObj);

diff --git a/dev-util/nvidia-cuda-toolkit/metadata.xml b/dev-util/nvidia-cuda-toolkit/metadata.xml
new file mode 100644
index 0000000..77d82a5
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<herd>cluster</herd>
+	<maintainer>
+		<email>spock@g.o</email>
+		<name>Michał Januszewski</name>
+	</maintainer>
+	<use>
+		<flag name='profiler'>
+			Installs the NVIDIA CUDA visual profiler.
+		</flag>
+		<flag name="debugger">
+			Installs the CUDA debugger.
+		</flag>
+		<flag name="eclipse">Install the <pkg>dev-util/eclipse-sdk</pkg> plugins</flag>
+	</use>
+</pkgmetadata>
+

diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-5.5.11.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-5.5.11.ebuild
new file mode 100644
index 0000000..aab15a1
--- /dev/null
+++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-5.5.11.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-5.0.35-r4.ebuild,v 1.1 2013/04/20 15:04:03 zerochaos Exp $
+
+EAPI=5
+
+inherit cuda unpacker versionator
+
+MYD=$(get_version_component_range 1)_$(get_version_component_range 2)
+
+DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
+HOMEPAGE="http://developer.nvidia.com/cuda"
+CURI="http://developer.download.nvidia.com/compute/cuda/${MYD}/rel-update-1/installers/"
+SRC_URI=""
+SRC_URI="
+	amd64? ( ${CURI}/cuda-${PV}_linux_64.run )
+	x86? ( ${CURI}/cuda-${PV}-linux_32.run )"
+
+SLOT="0/${PV}"
+LICENSE="NVIDIA-r1"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="debugger doc eclipse profiler"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+	sys-devel/gcc:4.6[cxx]
+	!<=x11-drivers/nvidia-drivers-270.41
+	debugger? (
+		sys-libs/libtermcap-compat
+		sys-libs/ncurses[tinfo]
+		)
+	eclipse? ( >=virtual/jre-1.6 )
+	profiler? ( >=virtual/jre-1.6 )"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="opt/cuda/*"
+
+pkg_nofetch() {
+	einfo "NVIDIA doesn't provide direct download links yet. If you're a"
+	einfo "registered developer, then please download ${ARCHIVE} from"
+	einfo "https://developer.nvidia.com/rdp/cuda-55-release-candidate-installers"
+}
+
+pkg_setup() {
+	# We don't like to run cuda_pkg_setup as it depends on us
+	:
+}
+
+src_unpack() {
+	unpacker
+	unpacker run_files/cuda*run
+}
+
+src_prepare() {
+	local cuda_supported_gcc
+
+	cuda_supported_gcc="4.6"
+
+	sed \
+		-e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \
+		"${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die
+
+}
+
+src_install() {
+	local i j
+	local remove="doc jre run_files install-linux.pl "
+	local cudadir=/opt/cuda
+	local ecudadir="${EPREFIX}"${cudadir}
+
+	# dodoc doc/*txt
+	if use doc; then
+		dodoc doc/pdf/*
+		dohtml -r doc/html/*
+	fi
+
+	use debugger || remove+=" bin/cuda-gdb extras/Debugger"
+	( use profiler || use eclipse ) || remove+=" libnsight"
+	use amd64 || remove+=" cuda-installer.pl"
+
+	if use profiler; then
+		# hack found in install-linux.pl
+		for j in nvvp nsight; do
+			cat > bin/${j} <<- EOF
+				#!${EPREFIX}/bin/sh
+				LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ecudadir}/lib:${ecudadir}/lib64 \
+					UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 \
+					${ecudadir}/lib${j}/${j} -vm ${EPREFIX}/usr/bin/java
+			EOF
+			chmod a+x bin/${j}
+		done
+	else
+		use eclipse || remove+=" libnvvp"
+		remove+=" extras/CUPTI"
+	fi
+
+	for i in ${remove}; do
+	ebegin "Cleaning ${i}..."
+		if [[ -e ${i} ]]; then
+			find ${i} -delete || die
+			eend
+		else
+			eend $1
+		fi
+	done
+
+	dodir ${cudadir}
+	mv * "${ED}"${cudadir}
+
+	cat > "${T}"/99cuda <<- EOF
+		PATH=${ecudadir}/bin:${ecudadir}/libnvvp
+		ROOTPATH=${ecudadir}/bin
+		LDPATH=${ecudadir}/lib$(use amd64 && echo "64:${ecudadir}/lib")
+	EOF
+	doenvd "${T}"/99cuda
+
+	make_wrapper nvprof "${EPREFIX}"${cudadir}/bin/nvprof "." ${ecudadir}/lib$(use amd64 && echo "64:${ecudadir}/lib")
+
+	dobin "${T}"/cuda-config
+}
+
+pkg_postinst() {
+	local a b
+	a="$(version_sort $(cuda-config -s))"; a=( $a )
+	# greatest supported version
+	b=${a[${#a[@]}-1]}
+
+	# if gcc and if not gcc-version is at least greatesst supported
+	if [[ $(tc-getCC) == *gcc* ]] && \
+		! version_is_at_least $(gcc-version) ${b}; then
+			echo
+			ewarn "gcc >= ${b} will not work with CUDA"
+			ewarn "Make sure you set an earlier version of gcc with gcc-config"
+			ewarn "or append --compiler-bindir= pointing to a gcc bindir like"
+			ewarn "--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}"
+			ewarn "to the nvcc compiler flags"
+			echo
+	fi
+}