diff --git a/pkgs/by-name/te/termbench-pro/dont-fetchcontent.diff b/pkgs/by-name/te/termbench-pro/dont-fetchcontent.diff new file mode 100644 index 000000000000..80a1ccf7724e --- /dev/null +++ b/pkgs/by-name/te/termbench-pro/dont-fetchcontent.diff @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6948010..1ee264f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,14 +14,15 @@ if(NOT WIN32 AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo) + endif() + +-include(FetchContent) +-FetchContent_Declare( +- glaze +- GIT_REPOSITORY https://github.com/stephenberry/glaze.git +- GIT_TAG v3.4.2 +- GIT_SHALLOW TRUE +-) +-FetchContent_MakeAvailable(glaze) ++#include(FetchContent) ++#FetchContent_Declare( ++ #glaze ++ #GIT_REPOSITORY https://github.com/stephenberry/glaze.git ++ #GIT_TAG v3.4.2 ++ # GIT_SHALLOW TRUE ++ #) ++#FetchContent_MakeAvailable(glaze) ++#add() + + set(MASTER_PROJECT OFF) + if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) +diff --git a/libtermbench/CMakeLists.txt b/libtermbench/CMakeLists.txt +index f0ddc75..93f63ed 100644 +--- a/libtermbench/CMakeLists.txt ++++ b/libtermbench/CMakeLists.txt +@@ -25,6 +25,8 @@ set_target_properties(termbench PROPERTIES + + target_include_directories(termbench PUBLIC $ + $) ++ ++find_package(glaze REQUIRED) + target_link_libraries(termbench PUBLIC glaze::glaze) + + install(TARGETS termbench diff --git a/pkgs/development/libraries/termbench-pro/default.nix b/pkgs/by-name/te/termbench-pro/package.nix similarity index 53% rename from pkgs/development/libraries/termbench-pro/default.nix rename to pkgs/by-name/te/termbench-pro/package.nix index 5291536f695f..b5139a1af97e 100644 --- a/pkgs/development/libraries/termbench-pro/default.nix +++ b/pkgs/by-name/te/termbench-pro/package.nix @@ -1,33 +1,46 @@ -{ lib, stdenv, fetchFromGitHub, cmake, fmt }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + fmt, + glaze, +}: stdenv.mkDerivation { pname = "termbench-pro"; - version = "unstable-2023-01-26"; + version = "unstable-2024-10-05"; src = fetchFromGitHub { owner = "contour-terminal"; repo = "termbench-pro"; - rev = "a4feadd3a698e4fe2d9dd5b03d5f941534a25a91"; - hash = "sha256-/zpJY9Mecalk7dneYZYzmFOroopFGklWw62a+LbiUVs="; + rev = "22a0c42f78dc2e522eb1089bf9976a9ff0ecdcad"; + hash = "sha256-Yyvlu/yx/yGc9Ci9Pn098YfTdywLZEaowQZeLM4WGjQ"; }; + # don't fetch glaze from CMakeLists.txt + patches = [ ./dont-fetchcontent.diff ]; + nativeBuildInputs = [ cmake ]; - buildInputs = [ fmt ]; + buildInputs = [ + fmt + glaze + ]; installPhase = '' runHook preInstall mkdir -p $out/bin mkdir -p $out/lib - mv termbenchpro/tbp $out/bin - mv libtermbench/libtermbench.a $out/lib + mv tb/tb $out/bin + mv libtermbench/libtermbench.* $out/lib runHook postInstall ''; meta = with lib; { description = "Terminal Benchmarking as CLI and library"; - mainProgram = "tbp"; + mainProgram = "tb"; license = licenses.asl20; platforms = platforms.unix; maintainers = with maintainers; [ moni ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e81ba52744c8..7ce0162af77a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11216,7 +11216,9 @@ with pkgs; harfbuzz = harfbuzzFull; }; - termbench-pro = callPackage ../development/libraries/termbench-pro { fmt = fmt_8; }; + termbench-pro = callPackage ../by-name/te/termbench-pro/package.nix { + stdenv = if stdenv.hostPlatform.isDarwin then llvmPackages_17.stdenv else stdenv; + }; texpresso = callPackage ../tools/typesetting/tex/texpresso { texpresso-tectonic = callPackage ../tools/typesetting/tex/texpresso/tectonic.nix { };