From 9e6df3560c44e76a3b4de4712688c8906eae183d Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Thu, 6 Aug 2026 12:05:26 +0530 Subject: [PATCH] python3Packages.tokenspeed-triton: patch CMakeLists to fix build failure nanobind >= 2.13 also requires the `Python::Interpreter` target, which upstream's `find_package(Python3)` -> `find_package(Python)` bridge misses: https://github.com/wjakob/nanobind/commit/706131bef6771ad3634b1d772f029f65b7ea8bd2 --- .../python-modules/tokenspeed-triton/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/python-modules/tokenspeed-triton/default.nix b/pkgs/development/python-modules/tokenspeed-triton/default.nix index f63b1973cee8..25c767a3bea0 100644 --- a/pkgs/development/python-modules/tokenspeed-triton/default.nix +++ b/pkgs/development/python-modules/tokenspeed-triton/default.nix @@ -40,6 +40,20 @@ buildPythonPackage (finalAttrs: { substituteInPlace pyproject.toml \ --replace-fail "cmake>=3.20,<4.0" "cmake>=3.20" \ --replace-fail "nanobind==2.10.2" "nanobind>=2.10.2" + '' + + # nanobind >= 2.13 also requires the `Python::Interpreter` + # target, which upstream's `find_package(Python3)` -> + # `find_package(Python)` bridge misses: + # https://github.com/wjakob/nanobind/commit/706131bef6771ad3634b1d772f029f65b7ea8bd2 + + '' + substituteInPlace CMakeLists.txt \ + --replace-fail \ + 'if(NOT TARGET Python::Module)' \ + 'if(NOT TARGET Python::Interpreter) + add_executable(Python::Interpreter ALIAS Python3::Interpreter) + endif() + if(NOT TARGET Python::Module)' ''; build-system = [