From 2aa8307146cbb736a4b6e673a94ed7408c8b8072 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Wed, 25 Feb 2026 20:34:36 -0800 Subject: [PATCH] tt-logger: init 1.1.9 --- pkgs/by-name/tt/tt-logger/fix-install.patch | 16 ++++++ pkgs/by-name/tt/tt-logger/package.nix | 64 +++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 pkgs/by-name/tt/tt-logger/fix-install.patch create mode 100644 pkgs/by-name/tt/tt-logger/package.nix diff --git a/pkgs/by-name/tt/tt-logger/fix-install.patch b/pkgs/by-name/tt/tt-logger/fix-install.patch new file mode 100644 index 000000000000..caa7ff5ee80a --- /dev/null +++ b/pkgs/by-name/tt/tt-logger/fix-install.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b3c7ca3..927e11c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -41,8 +41,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.23) + INTERFACE + FILE_SET api + TYPE HEADERS +- BASE_DIRS ${CMAKE_INSTALL_INCLUDEDIR} +- FILES ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/tt-logger.hpp ++ BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ++ FILES ++ include/${PROJECT_NAME}/tt-logger.hpp + ) + endif() + diff --git a/pkgs/by-name/tt/tt-logger/package.nix b/pkgs/by-name/tt/tt-logger/package.nix new file mode 100644 index 000000000000..8b5600377b6a --- /dev/null +++ b/pkgs/by-name/tt/tt-logger/package.nix @@ -0,0 +1,64 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchurl, + cmake, + ninja, + pkg-config, + fmt_11, + spdlog, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "tt-logger"; + version = "1.1.9"; + __structuredAttrs = true; + strictDeps = true; + + src = fetchFromGitHub { + owner = "tenstorrent"; + repo = "tt-logger"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Vd/FwjcNZWh/FnP5CwXO4UQtKTq/6GhRSppCYJMj9d4="; + }; + + cpm = fetchurl { + url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.2/CPM.cmake"; + hash = "sha256-yM3DLAOBZTjOInge1ylk3IZLKjSjENO3EEgSpcotg10="; + }; + + patches = [ + # https://github.com/tenstorrent/tt-logger/pull/27 + ./fix-install.patch + ]; + + postPatch = '' + cp $cpm cmake/CPM.cmake + ''; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + ]; + + buildInputs = [ + fmt_11 + spdlog + ]; + + cmakeFlags = [ + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + (lib.cmakeBool "CPM_USE_LOCAL_PACKAGES_ONLY" true) + (lib.cmakeBool "CPM_LOCAL_PACKAGES_ONLY" true) + (lib.cmakeBool "TT_LOGGER_INSTALL" true) + ]; + + meta = { + description = "Flexible and performant C++ logging library for Tenstorrent projects"; + homepage = "https://github.com/tenstorrent/tt-logger"; + maintainers = with lib.maintainers; [ RossComputerGuy ]; + license = with lib.licenses; [ asl20 ]; + platforms = lib.platforms.linux; + }; +})