From ada3991349beb5880e3994f25c65a0cf68941b83 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 30 Nov 2023 00:44:50 +0000 Subject: [PATCH] opencv4: expose cxxdev, propagating optional cuda deps --- pkgs/development/libraries/opencv/4.x.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index 4c1b13d1309e..8cfb169a0bac 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -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 # 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 ''