Commit 67779da0 authored by Fabian Affolter's avatar Fabian Affolter
Browse files

python312Packages.johnnycanencrypt: refactor

parent 43980887
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  buildPythonPackage,
  rustPlatform,
  pkg-config,
  pcsclite,
  nettle,
  fetchFromGitHub,
  httpx,
  libiconv,
  nettle,
  PCSC,
  pcsclite,
  pkg-config,
  pytestCheckHook,
  pythonOlder,
  rustPlatform,
  vcrpy,
  PCSC,
  libiconv,
}:

buildPythonPackage rec {
  pname = "johnnycanencrypt";
  version = "0.15.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "kushaldas";
    repo = "johnnycanencrypt";
    rev = "v${version}";
    rev = "refs/tags/v${version}";
    hash = "sha256-tbHW3x+vwFz0nqFGWvgxjhw8XH6/YKz1uagU339SZyk=";
  };

@@ -33,9 +35,11 @@ buildPythonPackage rec {
    hash = "sha256-vDlMdzZgmaRkviEk8IjIN+Q5x95gnpQiW5c8fT+dats=";
  };

  format = "pyproject";

  propagatedBuildInputs = [ httpx ];
  build-system = with rustPlatform; [
    bindgenHook
    cargoSetupHook
    maturinBuildHook
  ];

  nativeBuildInputs =
    [ pkg-config ]
@@ -53,6 +57,8 @@ buildPythonPackage rec {
      libiconv
    ];

  dependencies = [ httpx ];

  nativeCheckInputs = [
    pytestCheckHook
    vcrpy
@@ -66,9 +72,9 @@ buildPythonPackage rec {
  pythonImportsCheck = [ "johnnycanencrypt" ];

  meta = with lib; {
    description = "Python module for OpenPGP written in Rust";
    homepage = "https://github.com/kushaldas/johnnycanencrypt";
    changelog = "https://github.com/kushaldas/johnnycanencrypt/blob/v${version}/changelog.md";
    description = "Python module for OpenPGP written in Rust";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ _0x4A6F ];
  };