From dcd3a3c1e80f6d77a7c27d3fb6af1979e618da70 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 1 Aug 2026 18:22:42 +0000 Subject: [PATCH] python3Packages.deep-gemm: fix build --- .../python-modules/deep-gemm/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/deep-gemm/default.nix b/pkgs/development/python-modules/deep-gemm/default.nix index 2558634a4aab..ff203dbaf8ee 100644 --- a/pkgs/development/python-modules/deep-gemm/default.nix +++ b/pkgs/development/python-modules/deep-gemm/default.nix @@ -39,6 +39,7 @@ buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: { pname = "deep-gemm"; version = "2.1.1.post3"; pyproject = true; + __structuredAttrs = true; src = fetchFromGitHub { owner = "deepseek-ai"; @@ -68,7 +69,20 @@ buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: { }) ]; - env = optionalAttrs cudaSupport { + # Upstream hardcodes `__version__ = '2.1.1'` in `deep_gemm/__init__.py`, which does not match the + # release tag and fails the metadata check. + postPatch = '' + substituteInPlace deep_gemm/__init__.py \ + --replace-fail \ + "__version__ = '2.1.1'" \ + "__version__ = '${finalAttrs.version}'" + ''; + + env = { + # Do not append a `+local` revision to the version (no git repository available) + DG_USE_LOCAL_VERSION = "0"; + } + // optionalAttrs cudaSupport { CUDA_HOME = (getBin cudaPackages.cuda_nvcc).outPath; LDFLAGS = toString [