cudaPackages.cudart: stubs: add the libcuda.so.1 soname
This commit is contained in:
parent
5391c840e7
commit
c7d0840286
1 changed files with 19 additions and 9 deletions
|
@ -47,15 +47,25 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
|
||||||
allowFHSReferences = false;
|
allowFHSReferences = false;
|
||||||
|
|
||||||
# The libcuda stub's pkg-config doesn't follow the general pattern:
|
# The libcuda stub's pkg-config doesn't follow the general pattern:
|
||||||
postPatch = prevAttrs.postPatch or "" + ''
|
postPatch =
|
||||||
|
prevAttrs.postPatch or ""
|
||||||
|
+ ''
|
||||||
while IFS= read -r -d $'\0' path ; do
|
while IFS= read -r -d $'\0' path ; do
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputLib}/lib/stubs|" \
|
-e "s|^libdir\s*=.*/lib\$|libdir=''${!outputLib}/lib/stubs|" \
|
||||||
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
-e "s|^Libs\s*:\(.*\)\$|Libs: \1 -Wl,-rpath,${addDriverRunpath.driverLink}/lib|" \
|
||||||
"$path"
|
"$path"
|
||||||
done < <(find -iname 'cuda-*.pc' -print0)
|
done < <(find -iname 'cuda-*.pc' -print0)
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
|
# Namelink may not be enough, add a soname.
|
||||||
|
# Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/25536
|
||||||
|
if [[ -f lib/stubs/libcuda.so && ! -f lib/stubs/libcuda.so.1 ]] ; then
|
||||||
|
ln -s libcuda.so lib/stubs/libcuda.so.1
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
cuda_compat = prev.cuda_compat.overrideAttrs (
|
cuda_compat = prev.cuda_compat.overrideAttrs (
|
||||||
prevAttrs: {
|
prevAttrs: {
|
||||||
|
|
Loading…
Reference in a new issue