{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-smi , rocm-runtime , libcap , grpc , protobuf , openssl , doxygen , graphviz , texlive , gtest , buildDocs ? true , buildTests ? false }: let latex = lib.optionalAttrs buildDocs texlive.combine { inherit (texlive) scheme-small changepage latexmk varwidth multirow hanging adjustbox collectbox stackengine enumitem alphalph wasysym sectsty tocloft newunicodechar etoc helvetic wasy courier; }; in stdenv.mkDerivation (finalAttrs: { pname = "rdc"; version = "5.4.2"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "RadeonOpenCompute"; repo = "rdc"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-dYacqkRp+zVejo/4dME1K6EN8t/1EBtIynEQ+AQ4JZo="; }; nativeBuildInputs = [ cmake protobuf ] ++ lib.optionals buildDocs [ doxygen graphviz latex ]; buildInputs = [ rocm-smi rocm-runtime libcap grpc openssl ] ++ lib.optionals buildTests [ gtest ]; cmakeFlags = [ "-DCMAKE_VERBOSE_MAKEFILE=OFF" "-DRDC_INSTALL_PREFIX=${placeholder "out"}" "-DBUILD_ROCRTEST=ON" "-DRSMI_INC_DIR=${rocm-smi}/include" "-DRSMI_LIB_DIR=${rocm-smi}/lib" "-DGRPC_ROOT=${grpc}" # Manually define CMAKE_INSTALL_