Unverified Commit 0a5c42df authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #223835 from maxammann/fix-tracy-macos

tracy: fix build on macos (fixes #223469)
parents bd573376 b508af56
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
diff --git a/profiler/build/unix/legacy.mk b/profiler/build/unix/legacy.mk
index 24765f1a..8baffb68 100644
--- a/profiler/build/unix/legacy.mk
+++ b/profiler/build/unix/legacy.mk
@@ -16,7 +16,7 @@ else
 	UNAME := $(shell uname -s)
 	ifeq ($(UNAME),Darwin)
 		SRC3 += ../../../nfd/nfd_cocoa.m
-		LIBS +=  -framework CoreFoundation -framework AppKit -framework UniformTypeIdentifiers
+		LIBS +=  -framework CoreFoundation -framework AppKit
 	else
 		ifdef TRACY_GTK_FILESELECTOR
 			SRC += ../../../nfd/nfd_gtk.cpp
+9 −5
Original line number Diff line number Diff line
{ stdenv, lib, darwin, fetchFromGitHub
, tbb, gtk3, glfw, pkg-config, freetype, Carbon, AppKit, capstone, dbus
, tbb, glfw, pkg-config, freetype, Carbon, AppKit, capstone, dbus, hicolor-icon-theme
}:

let
  disableLTO = stdenv.cc.isClang && stdenv.isDarwin;  # workaround issue #19098
in stdenv.mkDerivation rec {
  pname = "tracy";
  version = "0.9";
  version = "0.9.1";

  src = fetchFromGitHub {
    owner = "wolfpld";
    repo = "tracy";
    rev = "v${version}";
    sha256 = "sha256-cdVkY1dSag37JdbsoJp2/0QHO5G+zsftqwBVqRpMiew=";
    sha256 = "sha256-K1lQNRS8+ju9HyKNVXtHqslrPWcPgazzTitvwkIO3P4";
  };

  patches = [ ]
    ++ lib.optionals (stdenv.isDarwin && !(lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11")) [ ./0001-remove-unifiedtypeidentifiers-framework ];

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ glfw capstone ]
    ++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ]
    ++ lib.optionals stdenv.isLinux [ gtk3 tbb dbus ];
    ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") [ darwin.apple_sdk.frameworks.UniformTypeIdentifiers ]
    ++ lib.optionals stdenv.isLinux [ tbb dbus hicolor-icon-theme freetype ];

  env.NIX_CFLAGS_COMPILE = toString ([ ]
    # Apple's compiler finds a format string security error on
@@ -32,7 +36,7 @@ in stdenv.mkDerivation rec {
  NIX_CFLAGS_LINK = lib.optional disableLTO "-fno-lto";

  buildPhase = ''
    make -j $NIX_BUILD_CORES -C profiler/build/unix release
    make -j $NIX_BUILD_CORES -C profiler/build/unix release LEGACY=1
    make -j $NIX_BUILD_CORES -C import-chrome/build/unix/ release
    make -j $NIX_BUILD_CORES -C capture/build/unix/ release
    make -j $NIX_BUILD_CORES -C update/build/unix/ release