{ lib , stdenv , fetchFromGitHub , fetchzip , rocmUpdateScript , cmake , rocm-cmake , rocprim , clr , gfortran , git , gtest , boost , python3Packages , buildTests ? false , buildBenchmarks ? false # Seems to depend on tests , gpuTargets ? [ ] }: stdenv.mkDerivation (finalAttrs: { pname = "rocsparse"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-nTYnEHkTtq0jBeMj4HXpqkJu8LQc+Z6mpjhMP7tJAHQ="; }; nativeBuildInputs = [ cmake rocm-cmake clr gfortran ]; buildInputs = [ rocprim git ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest boost python3Packages.python python3Packages.pyyaml ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_