commit:     023b13e88213bf2247c35960b590b598a17e68ac
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 14 22:42:54 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Jul 14 22:45:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=023b13e8

dev-util/nvidia-cuda-toolkit: update EAPI 6 -> 7

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../nvidia-cuda-toolkit-9.2.88-r1.ebuild           | 26 +++++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-9.2.88-r1.ebuild 
b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-9.2.88-r1.ebuild
index bf17569c9df..1fc2740c122 100644
--- a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-9.2.88-r1.ebuild
+++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-9.2.88-r1.ebuild
@@ -1,11 +1,11 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-inherit check-reqs eutils toolchain-funcs unpacker versionator
+inherit check-reqs toolchain-funcs unpacker
 
-MYD=$(get_version_component_range 1-2)
+MYD=$(ver_cut 1-2 ${PV})
 DRIVER_PV="396.26"
 
 DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
@@ -18,8 +18,8 @@ KEYWORDS="-* ~amd64 ~amd64-linux"
 IUSE="debugger doc eclipse profiler"
 RESTRICT="bindist mirror"
 
-DEPEND=""
-RDEPEND="${DEPEND}
+BDEPEND=""
+RDEPEND="
        <sys-devel/gcc-8[cxx]
        >=x11-drivers/nvidia-drivers-${DRIVER_PV}
        debugger? (
@@ -96,7 +96,7 @@ src_install() {
        done
 
        dodir ${cudadir}
-       mv * "${ED%/}${cudadir}" || die
+       mv * "${ED}${cudadir}" || die
 
        cat > "${T}"/99cuda <<- EOF || die
                PATH=${ecudadir}/bin$(usex profiler ":${ecudadir}/libnvvp" "")
@@ -113,15 +113,19 @@ src_install() {
 
 pkg_postinst_check() {
        local a b
-       a="$(version_sort $(cuda-config -s))"; a=( $a )
-       # greatest supported version
-       b="${a[${#a[@]}-1]}"
+       a="$(${EROOT}/opt/cuda/bin/cuda-config -s)"
+       b="0.0"
+       for v in $a; do
+               if ver_test "${v}" -gt "${b}"; then
+                       b="${v}"
+               fi
+       done
 
        # if gcc and if not gcc-version is at least greatest supported
        if tc-is-gcc && \
-               ! version_is_at_least gcc-version ${b}; then
+               ver_test $(gcc-version) -gt ${b}; then
                        ewarn ""
-                       ewarn "gcc >= ${b} will not work with CUDA"
+                       ewarn "gcc > ${b} will not work with CUDA"
                        ewarn "Make sure you set an earlier version of gcc with 
gcc-config"
                        ewarn "or append --compiler-bindir= pointing to a gcc 
bindir like"
                        ewarn 
"--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}"

Reply via email to