Diff nvidia-cuda-toolkit-11.1.1-r2 with a nvidia-cuda-toolkit-11.2.0-r3

/usr/portage/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.2.0-r3.ebuild 2021-04-29 12:39:00.000000000 +0300
5 5

  
6 6
inherit check-reqs cuda toolchain-funcs unpacker
7 7

  
8
DRIVER_PV="455.32.00"
8
DRIVER_PV="460.27.04"
9 9

  
10 10
DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
11 11
HOMEPAGE="https://developer.nvidia.com/cuda-zone"
......
34 34
S="${WORKDIR}"
35 35

  
36 36
QA_PREBUILT="opt/cuda/*"
37

  
38 37
CHECKREQS_DISK_BUILD="6800M"
39 38

  
39
PATCHES=( "${FILESDIR}"/${P}-nsight-systems-launcher.patch )
40

  
40 41
pkg_setup() {
41 42
	# We don't like to run cuda_pkg_setup as it depends on us
42 43
	check-reqs_pkg_setup
......
58 59
src_install() {
59 60
	local cudadir=/opt/cuda
60 61
	local ecudadir="${EPREFIX}${cudadir}"
62
	local pathextradirs ldpathextradirs
61 63
	dodir ${cudadir}
62 64
	into ${cudadir}
63 65

  
......
70 72
		$(usex debugger "builds/cuda_gdb" "")
71 73
	)
72 74

  
73
	local d
75
	local d f
74 76
	for d in "${builddirs[@]}"; do
75 77
		ebegin "Installing ${d}"
76 78
		[[ -d ${d} ]] || die "Directory does not exist: ${d}"
77 79

  
78 80
		if [[ -d ${d}/bin ]]; then
79
			local f
80 81
			for f in ${d}/bin/*; do
81 82
				if [[ -f ${f} ]]; then
82 83
					dobin "${f}"
......
105 106
	# nvml and nvvm need special handling
106 107
	ebegin "Installing nvvm"
107 108
	doins -r builds/cuda_nvcc/nvvm
108
	exeinto ${cudadir}/nvvm/bin
109
	doexe builds/cuda_nvcc/nvvm/bin/cicc
109
	fperms +x ${cudadir}/nvvm/bin/cicc
110 110
	eend
111 111

  
112 112
	ebegin "Installing nvml"
......
116 116
	if use sanitizer; then
117 117
		ebegin "Installing sanitizer"
118 118
		dobin builds/integration/Sanitizer/compute-sanitizer
119
		doins -r builds/cuda_sanitizer_api/Sanitizer
119
		doins -r builds/cuda_sanitizer_api/compute-sanitizer
120 120
		# special handling for the executable
121
		exeinto ${cudadir}/Sanitizer
122
		doexe builds/cuda_sanitizer_api/Sanitizer/compute-sanitizer
121
		fperms +x ${cudadir}/compute-sanitizer/compute-sanitizer
123 122
		eend
124 123
	fi
125 124

  
125
	use profiler && ldpathextradirs+=":${ecudadir}/extras/CUPTI/lib64"
126

  
126 127
	if use vis-profiler; then
127 128
		ebegin "Installing libnvvp"
128 129
		doins -r builds/cuda_nvvp/libnvvp
129 130
		# special handling for the executable
130
		exeinto ${cudadir}/libnvvp
131
		doexe builds/cuda_nvvp/libnvvp/nvvp
131
		fperms +x ${cudadir}/libnvvp/nvvp
132 132
		eend
133
		pathextradirs+=":${ecudadir}/libnvvp"
133 134
	fi
134 135

  
135 136
	if use nsight; then
......
138 139
		mv builds/nsight_compute builds/${ncu_dir} || die
139 140
		doins -r builds/${ncu_dir}
140 141

  
141
		exeinto ${cudadir}/${ncu_dir}
142
		doexe builds/${ncu_dir}/{ncu,ncu-ui,nv-nsight-cu,nv-nsight-cu-cli}
142
		# check this list on every bump
143
		local exes=(
144
			${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/libexec/QtWebEngineProcess
145
			${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/CrashReporter
146
			${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/ncu-ui
147
			${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/ncu-ui.bin
148
			${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/TreeLauncherTargetLdPreloadHelper
149
			${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/TreeLauncherSubreaper
150
			${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/ncu
151
		)
143 152

  
144
		exeinto ${cudadir}/${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64
145
		doexe builds/${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/{ncu-ui,ncu-ui.bin,CrashReporter}
146 153
		dobin builds/integration/nsight-compute/{ncu,ncu-ui,nv-nsight-cu,nv-nsight-cu-cli}
147 154
		eend
148 155

  
......
150 157
		ebegin "Installing ${nsys_dir}"
151 158
		mv builds/nsight_systems builds/${nsys_dir} || die
152 159
		doins -r builds/${nsys_dir}
153
		exeinto ${cudadir}/${nsys_dir}/target-linux-x64
154
		doexe builds/${nsys_dir}/target-linux-x64/nsys
155 160

  
156
		exeinto ${cudadir}/${nsys_dir}/host-linux-x64
157
		doexe builds/${nsys_dir}/host-linux-x64/{nsight-sys,nsight-sys.bin,nsys-ui,CrashReporter,ImportNvtxt,QdstrmImporter,ResolveSymbols}
161
		# check this list on every bump
162
		exes+=(
163
			${nsys_dir}/host-linux-x64/nsys-ui
164
			${nsys_dir}/host-linux-x64/nsys-ui.bin
165
			${nsys_dir}/host-linux-x64/ResolveSymbols
166
			${nsys_dir}/host-linux-x64/ImportNvtxt
167
			${nsys_dir}/host-linux-x64/CrashReporter
168
			${nsys_dir}/host-linux-x64/QdstrmImporter
169
			${nsys_dir}/host-linux-x64/libexec/QtWebEngineProcess
170
			${nsys_dir}/target-linux-x64/nsys
171
			${nsys_dir}/target-linux-x64/launcher
172
			${nsys_dir}/target-linux-x64/nvgpucs
173
			${nsys_dir}/target-linux-x64/nsys-launcher
174
			${nsys_dir}/target-linux-x64/sqlite3
175
			${nsys_dir}/target-linux-x64/python/bin/python
176
		)
177

  
158 178
		dobin builds/integration/nsight-systems/{nsight-sys,nsys,nsys-exporter,nsys-ui}
159 179
		eend
180

  
181
		# nsight scripts and binaries need to have their executable bit set, #691284
182
		for f in "${exes[@]}"; do
183
			fperms +x ${cudadir}/${f}
184
		done
185

  
186
		# remove foreign archs (triggers SONAME warning, #749903)
187
		rm -r "${ED}"/${cudadir}/${ncu_dir}/target/linux-desktop-glibc_2_19_0-ppc64le || die
188
		rm -r "${ED}"/${cudadir}/${ncu_dir}/target/linux-desktop-t210-a64 || die
189
		rm -r "${ED}"/${cudadir}/${nsys_dir}/target-linux-armv8 || die
190

  
160 191
		# TODO: unbundle qt5
161 192
		# TODO: unbundle boost
162 193
		# TODO: unbundle icu
......
170 201
	fi
171 202

  
172 203
	# Add include and lib symlinks
173
	dosym "targets/x86_64-linux/include" ${cudadir}/include
174
	dosym "targets/x86_64-linux/lib" ${cudadir}/lib64
204
	dosym targets/x86_64-linux/include ${cudadir}/include
205
	dosym targets/x86_64-linux/lib ${cudadir}/lib64
175 206

  
176 207
	newenvd - 99cuda <<-EOF
177
		PATH=${ecudadir}/bin$(usex vis-profiler ":${ecudadir}/libnvvp" "")
208
		PATH=${ecudadir}/bin${pathextradirs}
178 209
		ROOTPATH=${ecudadir}/bin
179
		LDPATH=${ecudadir}/lib64:${ecudadir}/nvvm/lib64$(usex profiler ":${ecudadir}/extras/CUPTI/lib64" "")
210
		LDPATH=${ecudadir}/lib64:${ecudadir}/nvvm/lib64${ldpathextradirs}
180 211
	EOF
181 212

  
182 213
	# Cuda prepackages libraries, don't revdep-build on them
......
184 215
	newins - 80${PN} <<-EOF
185 216
		SEARCH_DIRS_MASK="${ecudadir}"
186 217
	EOF
187
	# TODO: Find a better way to add +x permission to installed executables
188 218
	# TODO: Add pkgconfig files for installed libraries
189 219
}
190 220

  
Thank you!