diff --git a/pkgs/development/python-modules/signedjson/default.nix b/pkgs/development/python-modules/signedjson/default.nix index 10de67ba0ef..8409d9702e7 100644 --- a/pkgs/development/python-modules/signedjson/default.nix +++ b/pkgs/development/python-modules/signedjson/default.nix @@ -1,24 +1,36 @@ { lib , buildPythonPackage -, fetchFromGitHub +, fetchPypi +, fetchpatch , canonicaljson , unpaddedbase64 , pynacl , typing-extensions +, setuptools-scm +, importlib-metadata +, pythonOlder }: buildPythonPackage rec { pname = "signedjson"; version = "1.1.1"; - src = fetchFromGitHub { - owner = "matrix-org"; - repo = "python-${pname}"; - rev = "v${version}"; - sha256 = "0y5c9v4vx9hqpnca892gc9b4xgs4gp5xk6l1wma5ciz8zswp9yfs"; + src = fetchPypi { + inherit pname version; + sha256 = "0280f8zyycsmd7iy65bs438flm7m8ffs1kcxfbvhi8hbazkqc19m"; }; - propagatedBuildInputs = [ canonicaljson unpaddedbase64 pynacl typing-extensions ]; + patches = [ + # Do not require importlib_metadata on python 3.8 + (fetchpatch { + url = "https://github.com/matrix-org/python-signedjson/commit/c40c83f844fee3c1c7b0c5d1508f87052334b4e5.patch"; + sha256 = "109f135zn9azg5h1ljw3v94kpvnzmlqz1aiknpl5hsqfa3imjca1"; + }) + ]; + + nativeBuildInputs = [ setuptools-scm ]; + propagatedBuildInputs = [ canonicaljson unpaddedbase64 pynacl typing-extensions ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; meta = with lib; { homepage = "https://pypi.org/project/signedjson/";