1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
63 lines
1.4 KiB
Nix
63 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
setuptools,
|
|
dissononce,
|
|
python-axolotl-curve25519,
|
|
transitions,
|
|
protobuf,
|
|
pytestCheckHook,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "consonance";
|
|
version = "0.1.5";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tgalal";
|
|
repo = "consonance";
|
|
tag = version;
|
|
hash = "sha256-BhgxLxjKZ4dSL7DqkaoS+wBPCd1SYZomRKrtDLdGmYQ=";
|
|
};
|
|
|
|
patches = [
|
|
# https://github.com/tgalal/consonance/pull/9
|
|
(fetchpatch {
|
|
name = "fix-type-error.patch";
|
|
url = "https://github.com/tgalal/consonance/pull/9/commits/92fb78af98a18f0533ec8a286136968174fb0baf.patch";
|
|
hash = "sha256-wVUGxZ4W2zPyrcQPQTc85LcRUtsLbTBVzS10NEolpQY=";
|
|
})
|
|
];
|
|
|
|
env = {
|
|
# make protobuf compatible with old versions
|
|
# https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
|
|
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
dissononce
|
|
python-axolotl-curve25519
|
|
transitions
|
|
protobuf
|
|
];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
enabledTestPaths = [ "tests/test_handshakes_offline.py" ];
|
|
|
|
pythonImportsCheck = [ "consonance" ];
|
|
|
|
meta = {
|
|
description = "WhatsApp's handshake implementation using Noise Protocol";
|
|
homepage = "https://github.com/tgalal/consonance";
|
|
license = lib.licenses.gpl3Plus;
|
|
maintainers = [ ];
|
|
};
|
|
}
|