cudaPackages.cuda_cudart: a separate output for stub

This commit is contained in:
Someone Serge 2024-01-16 20:56:22 +00:00
parent cd51c7049c
commit b16942dfa8
No known key found for this signature in database
GPG Key ID: 7B0E3B1390D61DA4

View File

@ -44,6 +44,11 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
cuda_cudart = prev.cuda_cudart.overrideAttrs (
prevAttrs: {
# Remove once cuda-find-redist-features has a special case for libcuda
outputs =
prevAttrs.outputs
++ lists.optionals (!(builtins.elem "stubs" prevAttrs.outputs)) [ "stubs" ];
allowFHSReferences = false;
# The libcuda stub's pkg-config doesn't follow the general pattern:
@ -64,6 +69,14 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) {
ln -s libcuda.so lib/stubs/libcuda.so.1
fi
'';
postFixup =
prevAttrs.postFixup or ""
+ ''
moveToOutput lib/stubs "$stubs"
ln -s "$stubs"/lib/stubs/* "$stubs"/lib/
ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs"
'';
}
);