diff --git a/pkgs/development/python-modules/pikepdf/default.nix b/pkgs/development/python-modules/pikepdf/default.nix index 2b0b9bc4999a..ab78f2262445 100644 --- a/pkgs/development/python-modules/pikepdf/default.nix +++ b/pkgs/development/python-modules/pikepdf/default.nix @@ -2,7 +2,7 @@ , attrs , buildPythonPackage , defusedxml -, fetchPypi +, fetchFromGitHub , hypothesis , isPy3k , jbig2dec @@ -27,9 +27,17 @@ buildPythonPackage rec { version = "3.2.0"; disabled = ! isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "a0582f00440668c07edb8403e82724961c7812c8e6c30655e34825b2645f15cd"; + src = fetchFromGitHub { + owner = "pikepdf"; + repo = "pikepdf"; + rev = "v${version}"; + # The content of .git_archival.txt is substituted upon tarball creation, + # which creates indeterminism if master no longer points to the tag. + # See https://github.com/jbarlow83/OCRmyPDF/issues/841 + extraPostFetch = '' + rm "$out/.git_archival.txt" + ''; + sha256 = "03c7ihd6rf6kdfc3cpgxy5pi6cj4zwscz8nyxmmp15fmdk3hkw4g"; }; patches = [ @@ -40,6 +48,8 @@ buildPythonPackage rec { }) ]; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + buildInputs = [ pybind11 qpdf