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

Contents of /dev-util/nvidia-cuda-sdk/nvidia-cuda-sdk-5.0.35.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Jan 23 07:15:32 2013 UTC (18 months, 1 week ago) by jlec
Branch: MAIN
Changes since 1.3: +2 -2 lines
dev-util/nvidia-cuda-sdk: Fix last bit of bad deletion practise

(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-5.0.35.ebuild,v 1.3 2013/01/21 13:30:08 jlec Exp $
4
5 EAPI=4
6
7 inherit cuda eutils flag-o-matic toolchain-funcs unpacker versionator
8
9 MYD=$(get_version_component_range 1)_$(get_version_component_range 2)
10 DISTRO=fedora16-1
11
12 DESCRIPTION="NVIDIA CUDA Software Development Kit"
13 HOMEPAGE="http://developer.nvidia.com/cuda"
14 CURI="http://developer.download.nvidia.com/compute/cuda/${MYD}/rel-update-1/installers/"
15 SRC_URI="
16 http://dev.gentoo.org/~jlec/distfiles/${P}-asneeded.patch.xz
17 amd64? ( ${CURI}/cuda_${PV}_linux_64_${DISTRO}.run )
18 x86? ( ${CURI}/cuda_${PV}_linux_32_${DISTRO}.run )"
19
20 LICENSE="CUDPP"
21 SLOT="0"
22 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
23 IUSE="debug +doc +examples opencl +cuda"
24
25 RDEPEND="
26 >=dev-util/nvidia-cuda-toolkit-${PV}
27 media-libs/freeglut
28 examples? (
29 media-libs/freeimage
30 media-libs/glew
31 virtual/mpi
32 >=x11-drivers/nvidia-drivers-304.54
33 )"
34 DEPEND="${RDEPEND}"
35
36 S=${WORKDIR}/sdk
37
38 # nvcc doesn't support LDFLAGS
39 QA_FLAGS_IGNORED=(
40 opt/cuda/sdk/0_Simple/simpleMPI/simpleMPI
41 opt/cuda/sdk/0_Simple/cdpSimplePrint/cdpSimplePrint
42 opt/cuda/sdk/0_Simple/cdpSimpleQuicksort/cdpSimpleQuicksort
43 opt/cuda/sdk/6_Advanced/cdpAdvancedQuicksort/cdpAdvancedQuicksort
44 opt/cuda/sdk/6_Advanced/cdpLUDecomposition/cdpLUDecomposition
45 opt/cuda/sdk/6_Advanced/cdpQuadtree/cdpQuadtree
46 opt/cuda/sdk/bin/linux/release/cdpLUDecomposition
47 opt/cuda/sdk/bin/linux/release/cdpSimpleQuicksort
48 opt/cuda/sdk/bin/linux/release/simpleMPI
49 opt/cuda/sdk/bin/linux/release/cdpAdvancedQuicksort
50 opt/cuda/sdk/bin/linux/release/cdpQuadtree
51 opt/cuda/sdk/bin/linux/release/cdpSimplePrint
52 )
53
54 src_unpack() {
55 unpacker
56 unpacker run_files/cuda-samples*run
57 }
58
59 pkg_setup() {
60 if use cuda || use opencl; then
61 cuda_pkg_setup
62 fi
63 }
64
65 src_prepare() {
66 epatch "${WORKDIR}"/${P}-asneeded.patch
67 sed \
68 -e 's:-O2::g' \
69 -e 's:-O3::g' \
70 -e "/LINK/s:gcc:$(tc-getCC) ${LDFLAGS}:g" \
71 -e "/LINK/s:g++:$(tc-getCXX) ${LDFLAGS}:g" \
72 -e "/LINKFLAGS/s:=:= ${LDFLAGS} :g" \
73 -e "/CC/s:gcc:$(tc-getCC):g" \
74 -e "/GCC/s:g++:$(tc-getCXX):g" \
75 -e "/NVCCFLAGS/s|\(:=\)|\1 ${NVCCFLAGS} |g" \
76 -e "/ CFLAGS/s|\(:=\)|\1 ${CFLAGS}|g" \
77 -e "/ CXXFLAGS/s|\(:=\)|\1 ${CXXFLAGS}|g" \
78 -e 's:-Wimplicit::g' \
79 -e "s|../../common/lib/linux/\$(OS_ARCH)/libGLEW.a|$(pkg-config --libs glew)|g" \
80 -e "s|../../common/lib/\$(OSLOWER)/libGLEW.a|$(pkg-config --libs glew)|g" \
81 -e "s|../../common/lib/\$(OSLOWER)/\$(OS_ARCH)/libGLEW.a|$(pkg-config --libs glew)|g" \
82 -i $(find . -type f -name "Makefile") || die
83
84 export RAWLDFLAGS="$(raw-ldflags)"
85
86 find common/inc/GL -delete || die
87 find . -type f -name "*\.a" -delete || die
88 }
89
90 src_compile() {
91 use examples || return
92 local myopts verbose="verbose=1"
93 use debug && myopts+=" dbg=1"
94 emake \
95 cuda-install="${EPREFIX}/opt/cuda" \
96 CUDA_PATH="${EPREFIX}/opt/cuda/" \
97 ${myopts} ${verbose}
98 }
99
100 src_install() {
101 local i j f t crap=""
102 if use doc; then
103 ebegin "Installing docs ..."
104 dodoc -r doc releaseNotesData
105 dohtml *htm*
106 eend
107 fi
108
109 crap+=" *.txt doc Samples.htm* releaseNotesData"
110
111 ebegin "Cleaning before installation..."
112 for i in ${crap}; do
113 if [[ -e ${i} ]]; then
114 find ${i} -delete || die
115 fi
116 done
117 find . \( -name Makefile -o -name "*.mk" \) -delete || die
118 eend
119
120 ebegin "Moving files..."
121 for f in $(find .); do
122 local t="$(dirname ${f})"
123 if [[ ${t/obj\/} != ${t} || ${t##*.} == a ]]; then
124 continue
125 fi
126 if [[ ! -d ${f} ]]; then
127 if [[ -x ${f} ]]; then
128 exeinto /opt/cuda/sdk/${t}
129 doexe ${f}
130 else
131 insinto /opt/cuda/sdk/${t}
132 doins ${f}
133 fi
134 fi
135 done
136 eend
137 }

  ViewVC Help
Powered by ViewVC 1.1.20