/[gentoo-x86]/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild
Gentoo

Contents of /dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Jan 14 10:19:19 2013 UTC (20 months ago) by jlec
Branch: MAIN
dev-util/nvidia-cuda-sdk: Version Bump; drop old

(Portage version: 2.2.0_alpha151/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6
7 inherit cuda eutils toolchain-funcs unpacker versionator
8
9 MYD=$(get_version_component_range 1)_$(get_version_component_range 2)
10 DESCRIPTION="NVIDIA CUDA Software Development Kit"
11 HOMEPAGE="http://developer.nvidia.com/cuda"
12 SRC_URI="http://developer.download.nvidia.com/compute/cuda/${MYD}/rel/sdk/gpucomputingsdk_${PV}_linux.run"
13
14 LICENSE="CUDPP"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="debug +doc +examples opencl +cuda"
18
19 RDEPEND="
20 >=dev-util/nvidia-cuda-toolkit-${PV}
21 media-libs/freeglut
22 examples? (
23 >=x11-drivers/nvidia-drivers-296
24 media-libs/glew
25 )"
26 DEPEND="${RDEPEND}"
27
28 S=${WORKDIR}
29
30 pkg_setup() {
31 if use cuda || use opencl; then
32 cuda_pkg_setup
33 fi
34 }
35
36 src_prepare() {
37 epatch "${FILESDIR}"/${P}-asneeded.patch
38 sed \
39 -e 's:-O2::g' \
40 -e 's:-O3::g' \
41 -e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
42 -e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
43 -e "/LINKFLAGS/s:=:= ${LDFLAGS} :g" \
44 -e "/CC/s:gcc:$(tc-getCC):g" \
45 -e "/CXX/s:g++:$(tc-getCXX):g" \
46 -e "/NVCCFLAGS/s|\(:=\)|\1 ${NVCCFLAGS} |g" \
47 -e "/ CFLAGS/s|\(:=\)|\1 ${CFLAGS}|g" \
48 -e "/ CXXFLAGS/s|\(:=\)|\1 ${CXXFLAGS}|g" \
49 -e 's:-Wimplicit::g' \
50 -e 's:GLEW_x86_64:GLEW:g' \
51 -i $(find sdk -type f -name "*.mk") || die
52
53 find sdk/shared/inc/GL -delete || die
54 find sdk -type f -name "*\.a" -delete || die
55 }
56
57 src_compile() {
58 use examples || return
59 local myopts verbose="verbose=1"
60 use debug && myopts+=" dbg=1"
61 cd sdk
62 use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts} ${verbose}
63 use opencl && emake -C OpenCL ${verbose}
64 }
65
66 src_install() {
67 local i j f t crap=""
68 cd sdk
69 if use doc; then
70 ebegin "Installing docs ..."
71 for i in *; do
72 if [[ -d ${i} ]]; then
73 for j in doc releaseNotesData; do
74 docinto ${i}
75 [[ -d ${i}/${j} ]] && dodoc -r ${i}/${j}
76 done
77 fi
78 done
79 dodoc -r doc
80 dohtml {.,*}/*htm*
81 eend
82 fi
83
84 crap+=" *.txt doc */doc */Samples.htm* */releaseNotesData"
85
86 if ! use examples; then
87 crap+=" */bin */tools"
88 fi
89
90 ebegin "Cleaning before installation..."
91 find ${crap} -delete || die
92 find . \( -name Makefile -o -name "*.mk" \) -delete || die
93 eend
94
95 ebegin "Moving files..."
96 for f in $(find .); do
97 local t="$(dirname ${f})"
98 if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
99 continue
100 fi
101 if [[ ! -d ${f} ]]; then
102 if [[ -x ${f} ]]; then
103 exeinto /opt/cuda/sdk/${t}
104 doexe ${f}
105 else
106 insinto /opt/cuda/sdk/${t}
107 doins ${f}
108 fi
109 fi
110 done
111 eend
112 }

  ViewVC Help
Powered by ViewVC 1.1.20