From 57d1e5e1c9554873af6d02fd3478c9cef4442008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 24 Oct 2025 04:47:16 -0700 Subject: [PATCH] python3Packages.backports-zstd: fix hash The old hash was invalid because of a problem with line ending normalization in the zstd module: $ file /nix/store/3v178rjmmyxlb5s9bn0nvq5xzcixlali-source/src/c/zstd/build/VS2008/fullbench/fullbench.vcproj /nix/store/qagxczby82d2pvwsv9nancayx2ywfr51-source/src/c/zstd/build/VS2008/fullbench/fullbench.vcproj /nix/store/3v178rjmmyxlb5s9bn0nvq5xzcixlali-source/src/c/zstd/build/VS2008/fullbench/fullbench.vcproj: XML 1.0 document, ASCII text /nix/store/qagxczby82d2pvwsv9nancayx2ywfr51-source/src/c/zstd/build/VS2008/fullbench/fullbench.vcproj: XML 1.0 document, ASCII text, with CRLF line terminators We don't need that module so let's remove it from `src`. --- .../development/python-modules/backports-zstd/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/backports-zstd/default.nix b/pkgs/development/python-modules/backports-zstd/default.nix index 6050f2c4975b..412b35bcb992 100644 --- a/pkgs/development/python-modules/backports-zstd/default.nix +++ b/pkgs/development/python-modules/backports-zstd/default.nix @@ -17,10 +17,16 @@ buildPythonPackage rec { repo = "backports.zstd"; tag = "v${version}"; fetchSubmodules = true; - hash = "sha256-MRtj40vjCPtV9/RDgun/APzva4lv+TnXeBKD9RNlkII="; + postFetch = '' + rm -r "$out/src/c/zstd" + ''; + hash = "sha256-5t5ET8b65v4ArV9zrmu+kDXLG3QQRpMMZPSG+RRaCLk="; }; postPatch = '' + substituteInPlace setup.py \ + --replace-fail 'ROOT_PATH / "src" / "c" / "zstd"' 'Path("${zstd.src}")' + # need to preserve $PYTHONPATH when calling sys.executable substituteInPlace tests/test/support/script_helper.py \ --replace-fail "return __cached_interp_requires_environment" "return True"