opencv4: expose cxxdev, propagating optional cuda deps

This commit is contained in:
Someone Serge
2023-12-06 02:00:52 +00:00
parent be9c779deb
commit ada3991349
+5 -2
View File
@@ -247,8 +247,10 @@ effectiveStdenv.mkDerivation {
outputs = [
"out"
"cxxdev"
"package_tests"
];
cudaPropagateToOutput = "cxxdev";
postUnpack = lib.optionalString buildContrib ''
cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
@@ -328,7 +330,7 @@ effectiveStdenv.mkDerivation {
bzip2 AVFoundation Cocoa VideoDecodeAcceleration CoreMedia MediaToolbox Accelerate
]
++ lib.optionals enableDocs [ doxygen graphviz-nox ]
++ lib.optionals enableCuda (with cudaPackages; [
++ lib.optionals enableCuda (with cudaPackages; [
cuda_cudart
cuda_cccl # <thrust/*>
libnpp # npp.h
@@ -338,7 +340,7 @@ effectiveStdenv.mkDerivation {
cudnn # cudnn.h
] ++ lib.optionals enableCufft [
libcufft # cufft.h
]);
]);
propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy
++ lib.optionals enableCuda [ nvidia-optical-flow-sdk ];
@@ -458,6 +460,7 @@ effectiveStdenv.mkDerivation {
postInstall = ''
sed -i "s|{exec_prefix}/$out|{exec_prefix}|;s|{prefix}/$out|{prefix}|" \
"$out/lib/pkgconfig/opencv4.pc"
mkdir $cxxdev
''
# install python distribution information, so other packages can `import opencv`
+ lib.optionalString enablePython ''