diff --git a/pkgs/development/python-modules/pyahocorasick/default.nix b/pkgs/development/python-modules/pyahocorasick/default.nix index 7bb2f7c988a9..56e5636622b8 100644 --- a/pkgs/development/python-modules/pyahocorasick/default.nix +++ b/pkgs/development/python-modules/pyahocorasick/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchFromGitHub +, fetchpatch , pytestCheckHook }: @@ -15,10 +16,13 @@ buildPythonPackage rec { sha256 = "13x3718if28l50474xrz1b9709kvnvdg3nzm6y8bh7mc9a4zyss5"; }; - postPatch = '' - substituteInPlace unittests.py \ - --replace '(tmp, "test.dat")' "(\"$TMPDIR\", \"test.dat\")" - ''; + patches = [ + # Use proper temporary directory on Hydra + (fetchpatch { + url = "https://github.com/WojciechMula/pyahocorasick/commit/b6549e06f3cced7ffdf4d1b587cd7de12041f495.patch"; + sha256 = "sha256-v3J/0aIPOnBhLlJ18r/l7O0MckqLOCtcmqIS9ZegaSI="; + }) + ]; checkInputs = [ pytestCheckHook ];