···585 mkdir -p "$cxxdev/nix-support"
586 echo "''${!outputDev}" >> "$cxxdev/nix-support/propagated-build-inputs"
587 ''
0588 # remove the requirement that the exact same version of CUDA is used in packages
589- # consuming OpenCV's CMakes files
590 + optionalString enableCuda ''
000591 substituteInPlace "$out/lib/cmake/opencv4/OpenCVConfig.cmake" \
592 --replace-fail \
593 'find_host_package(CUDA ''${OpenCV_CUDA_VERSION} EXACT REQUIRED)' \
···585 mkdir -p "$cxxdev/nix-support"
586 echo "''${!outputDev}" >> "$cxxdev/nix-support/propagated-build-inputs"
587 ''
588+ # hard-wire CUDA_TOOLKIT_ROOT_DIR so FindCUDA sees the toolkit
589 # remove the requirement that the exact same version of CUDA is used in packages
590+ # consuming OpenCV's CMakes files
591 + optionalString enableCuda ''
592+ sed -i '1s;^;set(CUDA_TOOLKIT_ROOT_DIR ${cudaPackages.cudatoolkit})\n;' \
593+ "$out/lib/cmake/opencv4/OpenCVConfig.cmake"
594+595 substituteInPlace "$out/lib/cmake/opencv4/OpenCVConfig.cmake" \
596 --replace-fail \
597 'find_host_package(CUDA ''${OpenCV_CUDA_VERSION} EXACT REQUIRED)' \