From b6ecc4fec128fbd001ee587eb518a014b977cc95 Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Wed, 29 Mar 2023 21:45:36 -0400 Subject: [PATCH 1/4] tracy: fix build on macos (fixes #223469) The UniformTypeIdentifiers is required for apple SDK 11+. This patch fixes the build on newwer macOS versions. --- pkgs/development/tools/tracy/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index 00e121adc718..eca65a5c46f8 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -19,6 +19,7 @@ in stdenv.mkDerivation rec { buildInputs = [ glfw capstone ] ++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ] + ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") [ darwin.apple_sdk.frameworks.UniformTypeIdentifiers ] ++ lib.optionals stdenv.isLinux [ gtk3 tbb dbus ]; env.NIX_CFLAGS_COMPILE = toString ([ ] From 24aff837bd92cd9dfc5548d712c6d46ac8727413 Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Mon, 3 Apr 2023 22:23:54 -0400 Subject: [PATCH 2/4] tracy: update from 0.9 to 0.9.1 --- pkgs/development/tools/tracy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index eca65a5c46f8..b4378eef7859 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -6,13 +6,13 @@ 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"; }; nativeBuildInputs = [ pkg-config ]; From b4fe08d2d67ab0cbefe157d640ff0ebc75c644ca Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Mon, 3 Apr 2023 22:25:04 -0400 Subject: [PATCH 3/4] tracy: Remove UniformTypeIdentifiers depending on SDK The UniformTypeIdentifiers is only required on SDK 11+. On SDK 10 (on which it is not available) we can remove it using a patch. --- .../0001-remove-unifiedtypeidentifiers-framework | 13 +++++++++++++ pkgs/development/tools/tracy/default.nix | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/development/tools/tracy/0001-remove-unifiedtypeidentifiers-framework diff --git a/pkgs/development/tools/tracy/0001-remove-unifiedtypeidentifiers-framework b/pkgs/development/tools/tracy/0001-remove-unifiedtypeidentifiers-framework new file mode 100644 index 000000000000..0dc5a7eb68f1 --- /dev/null +++ b/pkgs/development/tools/tracy/0001-remove-unifiedtypeidentifiers-framework @@ -0,0 +1,13 @@ +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 diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index b4378eef7859..bca3a9ceb1d4 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -15,6 +15,9 @@ in stdenv.mkDerivation rec { 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 ] From b508af56273c5e9fd97bd2849804e2abe1edc649 Mon Sep 17 00:00:00 2001 From: Max Ammann Date: Wed, 5 Apr 2023 18:46:24 -0400 Subject: [PATCH 4/4] tracy: Fix compilation for 0.9.1 - Compile the profiler with LEGACY=1 to link against GLFW and use X11 - Remove the gtk3 dependency and add freetype2, dbus, and hicolor-icon-theme --- pkgs/development/tools/tracy/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index bca3a9ceb1d4..a380b9fbd791 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -1,5 +1,5 @@ { 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 @@ -23,7 +23,7 @@ in stdenv.mkDerivation rec { buildInputs = [ glfw capstone ] ++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ] ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") [ darwin.apple_sdk.frameworks.UniformTypeIdentifiers ] - ++ lib.optionals stdenv.isLinux [ gtk3 tbb dbus ]; + ++ 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 @@ -36,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