15 , buildDocs ? false # Nothing seems to be generated, so not making the output
19 stdenv.mkDerivation (finalAttrs: {
25 ] ++ lib.optionals buildDocs [
27 ] ++ lib.optionals buildTests [
31 src = fetchFromGitHub {
34 rev = "rocm-${finalAttrs.version}";
35 hash = "sha256-P6QYyAjMRwFFWKF8AhbrYGe+mYVJXdbBW1or6vcobYU=";
41 ] ++ lib.optionals buildDocs [
49 python3Packages.python
50 python3Packages.cppheaderparser
54 "-DCMAKE_MODULE_PATH=${clr}/hip/cmake"
55 # Manually define CMAKE_INSTALL_<DIR>
56 # See: https://github.com/NixOS/nixpkgs/pull/197838
57 "-DCMAKE_INSTALL_BINDIR=bin"
58 "-DCMAKE_INSTALL_LIBDIR=lib"
59 "-DCMAKE_INSTALL_INCLUDEDIR=include"
62 env.NIX_CFLAGS_COMPILE = toString [
64 "-Wno-error=array-bounds"
68 export HIP_DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode
69 '' + lib.optionalString (!buildTests) ''
70 substituteInPlace CMakeLists.txt \
71 --replace "add_subdirectory(test)" ""
74 # Tests always fail, probably need GPU
75 # doCheck = buildTests;
77 postInstall = lib.optionalString buildDocs ''
79 '' + lib.optionalString buildTests ''
81 # Not sure why this is an install target
82 find $out/test -executable -type f -exec mv {} $test/bin \;
83 rm $test/bin/{*.sh,*.py}
84 patchelf --set-rpath $out/lib:${lib.makeLibraryPath (
85 finalAttrs.buildInputs ++ [ clr gcc-unwrapped.lib rocm-runtime ])} $test/bin/*
89 passthru.updateScript = rocmUpdateScript {
90 name = finalAttrs.pname;
91 owner = finalAttrs.src.owner;
92 repo = finalAttrs.src.repo;
96 description = "Tracer callback/activity library";
97 homepage = "https://github.com/ROCm/roctracer";
98 license = with licenses; [ mit ]; # mitx11
99 maintainers = teams.rocm.members;
100 platforms = platforms.linux;
101 broken = versions.minor finalAttrs.version != versions.minor clr.version || versionAtLeast finalAttrs.version "6.0.0";