{ 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 ? clr.localGpuTargets or clr.gpuTargets, }: stdenv.mkDerivation (finalAttrs: { pname = "rocsparse${clr.gpuArchSuffix}"; version = "6.3.3"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-6Cut5rbyqKFzHaXfJZGApyY9Mj1Zq/+U8MkXgy4X4Pw="; }; nativeBuildInputs = [ cmake # no ninja, it buffers console output and nix times out long periods of no output rocm-cmake clr gfortran ]; buildInputs = [ rocprim git ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest boost python3Packages.python python3Packages.pyyaml ]; cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" # Manually define CMAKE_INSTALL_