1 { stdenv, lib, darwin, fetchFromGitHub
2 , tbb, gtk3, glfw, pkg-config, freetype, Carbon, AppKit, capstone, dbus
6 disableLTO = stdenv.cc.isClang && stdenv.isDarwin; # workaround issue #19098
7 in stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
15 sha256 = "sha256-SVzNy0JP/JrUYgelypBn8SPO+Ksm1rq2yGnxk1hCLkQ=";
18 nativeBuildInputs = [ pkg-config ];
20 buildInputs = [ glfw capstone ]
21 ++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ]
22 ++ lib.optionals stdenv.isLinux [ gtk3 tbb dbus ];
24 NIX_CFLAGS_COMPILE = [ ]
25 # Apple's compiler finds a format string security error on
26 # ../../../server/TracyView.cpp:649:34, preventing building.
27 ++ lib.optional stdenv.isDarwin "-Wno-format-security"
28 ++ lib.optional stdenv.isLinux "-ltbb"
29 ++ lib.optional stdenv.cc.isClang "-faligned-allocation"
30 ++ lib.optional disableLTO "-fno-lto";
32 NIX_CFLAGS_LINK = lib.optional disableLTO "-fno-lto";
35 make -j $NIX_BUILD_CORES -C profiler/build/unix release
36 make -j $NIX_BUILD_CORES -C import-chrome/build/unix/ release
37 make -j $NIX_BUILD_CORES -C capture/build/unix/ release
38 make -j $NIX_BUILD_CORES -C update/build/unix/ release
42 install -D ./profiler/build/unix/Tracy-release $out/bin/Tracy
43 install -D ./import-chrome/build/unix/import-chrome-release $out/bin/import-chrome
44 install -D ./capture/build/unix/capture-release $out/bin/capture
45 install -D ./update/build/unix/update-release $out/bin/update
48 postFixup = lib.optionalString stdenv.isDarwin ''
49 install_name_tool -change libcapstone.4.dylib ${capstone}/lib/libcapstone.4.dylib $out/bin/Tracy
53 description = "A real time, nanosecond resolution, remote telemetry frame profiler for games and other applications";
54 homepage = "https://github.com/wolfpld/tracy";
55 platforms = platforms.linux ++ platforms.darwin;
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ mpickering nagisa ];