{ 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 = "5.7.1"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-30q9bqgZJUaNrkMXTAG+Z34yjsQ5DpJP+WBcCiEmF58="; }; 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_