Unverified Commit 25628a6e authored by Austin Horstman's avatar Austin Horstman Committed by GitHub
Browse files

python3Packages.{consonance,yowsup}: fix build; refactor (#354690)

parents 05eff5c6 83d18d4d
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  setuptools,
  dissononce,
  python-axolotl-curve25519,
  transitions,
@@ -14,14 +15,14 @@
buildPythonPackage rec {
  pname = "consonance";
  version = "0.1.5";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "tgalal";
    repo = "consonance";
    rev = version;
    rev = "refs/tags/${version}";
    hash = "sha256-BhgxLxjKZ4dSL7DqkaoS+wBPCd1SYZomRKrtDLdGmYQ=";
  };

@@ -34,7 +35,15 @@ buildPythonPackage rec {
    })
  ];

  propagatedBuildInputs = [
  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
@@ -47,10 +56,10 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "consonance" ];

  meta = with lib; {
  meta = {
    description = "WhatsApp's handshake implementation using Noise Protocol";
    homepage = "https://github.com/tgalal/consonance";
    license = licenses.gpl3Plus;
    license = lib.licenses.gpl3Plus;
    maintainers = [ ];
  };
}
+9 −3
Original line number Diff line number Diff line
@@ -26,13 +26,19 @@ buildPythonPackage rec {
  src = fetchFromGitHub {
    owner = "tgalal";
    repo = "yowsup";
    rev = "v${version}";
    rev = "refs/tags/v${version}";
    sha256 = "1pz0r1gif15lhzdsam8gg3jm6zsskiv2yiwlhaif5rl7lv3p0v7q";
  };

  pythonRelaxDeps = true;
  pythonRemoveDeps = [ "argparse" ];

  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 ];

  nativeCheckInputs = [ pytestCheckHook ];
@@ -45,11 +51,11 @@ buildPythonPackage rec {
    six
  ] ++ lib.optionals (!pythonOlder "3.12") [ pyasyncore ];

  meta = with lib; {
  meta = {
    homepage = "https://github.com/tgalal/yowsup";
    description = "Python WhatsApp library";
    mainProgram = "yowsup-cli";
    license = licenses.gpl3Plus;
    license = lib.licenses.gpl3Plus;
    maintainers = [ ];
  };
}