public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: dev-util/nvidia-cuda-sdk/
Date: Mon, 26 Nov 2012 22:02:02 +0000 (UTC)	[thread overview]
Message-ID: <1353940868.1eaeeab8444bf3da8e09d76f0178e5516c82cc99.jlec@gentoo> (raw)

commit:     1eaeeab8444bf3da8e09d76f0178e5516c82cc99
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 16 15:18:58 2012 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Nov 26 14:41:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=1eaeeab8

dev-util/nvidia-cuda-sdk: Reverted changes to bicatalis commit; Moving to cuda.eclass

Package-Manager: portage-2.2.0_alpha142

---
 dev-util/nvidia-cuda-sdk/ChangeLog                 |    6 ++
 dev-util/nvidia-cuda-sdk/metadata.xml              |   13 ++--
 ....2.9.ebuild => nvidia-cuda-sdk-4.2.9-r1.ebuild} |   70 ++++++++++++--------
 .../nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild   |   20 ++++--
 4 files changed, 68 insertions(+), 41 deletions(-)

diff --git a/dev-util/nvidia-cuda-sdk/ChangeLog b/dev-util/nvidia-cuda-sdk/ChangeLog
index 5e92775..09af82d 100644
--- a/dev-util/nvidia-cuda-sdk/ChangeLog
+++ b/dev-util/nvidia-cuda-sdk/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-sdk/ChangeLog,v 1.30 2012/02/05 16:39:02 spock Exp $
 
+*nvidia-cuda-sdk-4.2.9-r1 (16 Nov 2012)
+
+  16 Nov 2012; Justin Lecher <jlec@gentoo.org> nvidia-cuda-sdk-4.2.9.ebuild,
+  +nvidia-cuda-sdk-4.2.9-r1.ebuild, metadata.xml:
+  Reverted changes to bicatalis commit; Moving to cuda.eclass
+
   11 Jul 2012; Honza Macháček <Hloupy.Honza@centrum.cz>
   nvidia-cuda-sdk-4.2.9.ebuild:
   Corrected OpenCL spelling in `emake -C OpenCL`

diff --git a/dev-util/nvidia-cuda-sdk/metadata.xml b/dev-util/nvidia-cuda-sdk/metadata.xml
index 23cb88d..1411995 100644
--- a/dev-util/nvidia-cuda-sdk/metadata.xml
+++ b/dev-util/nvidia-cuda-sdk/metadata.xml
@@ -1,15 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<herd>sci</herd>
-<longdescription lang='en'>
+	<herd>sci</herd>
+	<longdescription lang="en">
   The NVIDIA GPU Computing SDK provides hundreds of code samples,
   white papers, to help getting started on the path of writing
   software with CUDA C/C++ or DirectCompute.
 </longdescription>
-<use>
-  <flag name='opencl'>Build OpenCL binaries</flag>
-  <flag name='cuda'>Build CUDA binaries</flag>
-</use>
+	<use>
+		<flag name="opencl">Build OpenCL binaries</flag>
+		<flag name="cuda">Build CUDA binaries</flag>
+	</use>
 </pkgmetadata>
-

diff --git a/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild
similarity index 64%
copy from dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild
copy to dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild
index de89788..f42f58b 100644
--- a/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild
+++ b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild
@@ -27,40 +27,26 @@ DEPEND="${RDEPEND}"
 
 S=${WORKDIR}
 
-gcc_supported_installed() {
-	local gcc_bindir _ver
-	for _ver in $*; do
-		has_version sys-devel/gcc:${_ver} && \
-			gcc_bindir="$(ls -d ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${_ver}* | tail -n 1)" && \
-			break
-	done
-	if [[ -n ${gcc_bindir} ]]; then
-		echo "${gcc_bindir}"
-		return 0
-	else
-		eerror "Only gcc version(s) $* are supported"
-		die "Only gcc version(s) $* are supported"
-		return 1
+pkg_setup() {
+	if use cuda || use opencl; then
+		cuda_pkg_setup
 	fi
 }
 
 src_prepare() {
-	local nvcc_bindir
-
-	if use cuda || use opencl && [[ $(tc-getCXX) == *g++* ]]; then
-		nvcc_bindir="--compiler-bindir=\"$(gcc_supported_installed 4.6 4.5 4.4)\""
-	fi
-
 	epatch "${FILESDIR}"/${P}-asneeded.patch
-
 	sed \
+		-e 's:-O2::g' \
+		-e 's:-O3::g' \
 		-e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
 		-e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
+		-e "/LINKFLAGS/s:=:= ${LDFLAGS} :g" \
 		-e "/CC/s:gcc:$(tc-getCC):g" \
 		-e "/CX/s:g++:$(tc-getCXX):g" \
-		-e "/NVCCFLAGS/s|\(:=\)|\1 ${nvcc_bindir} |g" \
+		-e "/NVCCFLAGS/s|\(:=\)|\1 ${NVCCFLAGS} |g" \
+		-e "/ CFLAGS/s|\(:=\)|\1 ${CFLAGS}|g" \
+		-e "/ CXXFLAGS/s|\(:=\)|\1 ${CXXFLAGS}|g" \
 		-e 's:-Wimplicit::g' \
-		-e 's:-O2::g' \
 		-e 's:GLEW_x86_64:GLEW:g' \
 		-i $(find sdk -type f -name "*.mk") || die
 
@@ -70,18 +56,43 @@ src_prepare() {
 
 src_compile() {
 	use examples || return
-	local myopts="verbose=1"
+	local myopts verbose="verbose=1"
 	use debug && myopts+=" dbg=1"
 	cd sdk
-	use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts}
-	use opencl && emake -C OpenCL
+	use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts} ${verbose}
+	use opencl && emake -C OpenCL ${verbose}
 }
 
 src_install() {
+	local i j f t crap=""
 	cd sdk
-	use doc || rm -rf *.txt doc */doc */Samples.htm */releaseNotesData
-	use examples || rm -rf bin */bin */tools
-	local f
+	if use doc; then
+		ebegin "Installing docs ..."
+		for i in *; do
+			if [[ -d ${i} ]]; then
+				for j in doc releaseNotesData; do
+					docinto ${i}
+					[[ -d ${i}/${j} ]] && dodoc -r ${i}/${j}
+				done
+			fi
+		done
+		dodoc -r doc
+		dohtml {.,*}/*htm*
+		eend
+	fi
+
+	crap+=" *.txt doc */doc */Samples.htm* */releaseNotesData"
+
+	if ! use examples; then
+		crap+=" */bin */tools"
+	fi
+
+	ebegin "Cleaning before installation..."
+	find ${crap} -delete || die
+	find . \( -name Makefile -o -name "*.mk" \) -delete || die
+	eend
+
+	ebegin "Moving files..."
 	for f in $(find .); do
 		local t="$(dirname ${f})"
 		if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
@@ -97,4 +108,5 @@ src_install() {
 			fi
 		fi
 	done
+	eend
 }

diff --git a/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild
index de89788..514f943 100644
--- a/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild
+++ b/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=4
 
-inherit cuda eutils unpacker toolchain-funcs versionator
+inherit eutils unpacker toolchain-funcs versionator
 
 MYD=$(get_version_component_range 1)_$(get_version_component_range 2)
 DESCRIPTION="NVIDIA CUDA Software Development Kit"
@@ -27,11 +27,20 @@ DEPEND="${RDEPEND}"
 
 S=${WORKDIR}
 
+pkg_setup() {
+	if use cuda || use opencl && [[ $(tc-getCXX) == *gcc* ]] && \
+		! version_is_at_least 4.5 "$(gcc-version)"; then
+		eerror "This package requires >=sys-devel/gcc-4.5 to build sucessfully"
+		eerror "Please use gcc-config to switch to a compatible GCC version"
+		die ">=sys-devel/gcc-4.4 required"
+	fi
+}
+
 gcc_supported_installed() {
 	local gcc_bindir _ver
 	for _ver in $*; do
 		has_version sys-devel/gcc:${_ver} && \
-			gcc_bindir="$(ls -d ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${_ver}* | tail -n 1)" && \
+			gcc_bindir="$(ls -d "${EPREFIX}"/usr/*pc-linux-gnu/gcc-bin/${_ver}* | tail -n 1)" && \
 			break
 	done
 	if [[ -n ${gcc_bindir} ]]; then
@@ -56,6 +65,7 @@ src_prepare() {
 	sed \
 		-e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
 		-e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
+		-e "/LINKFLAGS/s:=:= ${LDFLAGS} :g" \
 		-e "/CC/s:gcc:$(tc-getCC):g" \
 		-e "/CX/s:g++:$(tc-getCXX):g" \
 		-e "/NVCCFLAGS/s|\(:=\)|\1 ${nvcc_bindir} |g" \
@@ -70,11 +80,11 @@ src_prepare() {
 
 src_compile() {
 	use examples || return
-	local myopts="verbose=1"
+	local myopts verbose="verbose=1"
 	use debug && myopts+=" dbg=1"
 	cd sdk
-	use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts}
-	use opencl && emake -C OpenCL
+	use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts} ${verbose}
+	use opencl && emake -C OpenCL ${verbose}
 }
 
 src_install() {


             reply	other threads:[~2012-11-26 22:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 22:02 Justin Lecher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-30 15:47 [gentoo-commits] proj/sci:master commit in: dev-util/nvidia-cuda-sdk/ Justin Lecher
2016-09-15 14:18 Marius Brehler
2016-05-30  8:52 Marius Brehler
2015-09-09  8:11 Justin Lecher
2015-07-10  3:59 Nicolas Bock
2015-03-20  4:31 Christoph Junghans
2015-01-18  2:16 Christoph Junghans
2015-01-18  2:16 Christoph Junghans
2014-11-17  7:12 Justin Lecher
2014-08-21  8:32 Justin Lecher
2014-07-10  8:53 Justin Lecher
2014-07-10  8:53 Justin Lecher
2012-11-26 22:02 Justin Lecher
2012-07-11  9:09 Honza Macháček
2012-07-04 18:51 Sebastien Fabbro
2012-07-03 17:30 Sebastien Fabbro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353940868.1eaeeab8444bf3da8e09d76f0178e5516c82cc99.jlec@gentoo \
    --to=jlec@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox