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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jan 23 09:24:30 2013 UTC (19 months, 3 weeks ago) by jlec
Branch: MAIN
dev-util/nvidia-cuda-sdk: Correct installatoion path of cuda in common.mk, #413137

(Portage version: 2.2.0_alpha159/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-4.2.9-r1.ebuild,v 1.1 2013/01/14 10:19:19 jlec Exp $
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 sed \
54 -e "s:/usr/local/cuda:${EPREFIX}/opt/cuda:g" \
55 -i sdk/shared/common.mk sdk/C/common/common.mk || die
56
57 find sdk/shared/inc/GL -delete || die
58 find sdk -type f -name "*\.a" -delete || die
59 }
60
61 src_compile() {
62 use examples || return
63 local myopts verbose="verbose=1"
64 use debug && myopts+=" dbg=1"
65 cd sdk
66 use cuda && emake -C C cuda-install="${EPREFIX}/opt/cuda" ${myopts} ${verbose}
67 use opencl && emake -C OpenCL ${verbose}
68 }
69
70 src_install() {
71 local i j f t crap=""
72 cd sdk
73 if use doc; then
74 ebegin "Installing docs ..."
75 for i in *; do
76 if [[ -d ${i} ]]; then
77 for j in doc releaseNotesData; do
78 docinto ${i}
79 [[ -d ${i}/${j} ]] && dodoc -r ${i}/${j}
80 done
81 fi
82 done
83 dodoc -r doc
84 dohtml {.,*}/*htm*
85 eend
86 fi
87
88 crap+=" *.txt doc */doc */Samples.htm* */releaseNotesData"
89
90 if ! use examples; then
91 crap+=" */bin */tools"
92 fi
93
94 ebegin "Cleaning before installation..."
95 find ${crap} -delete || die
96 find . \( -name Makefile -o -name "*.mk" \) -delete || die
97 eend
98
99 ebegin "Moving files..."
100 for f in $(find .); do
101 local t="$(dirname ${f})"
102 if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
103 continue
104 fi
105 if [[ ! -d ${f} ]]; then
106 if [[ -x ${f} ]]; then
107 exeinto /opt/cuda/sdk/${t}
108 doexe ${f}
109 else
110 insinto /opt/cuda/sdk/${t}
111 doins ${f}
112 fi
113 fi
114 done
115 eend
116 }

  ViewVC Help
Powered by ViewVC 1.1.20