spicedb: 1.39.1 -> 1.40.0
[NixPkgs.git] / pkgs / development / python-modules / johnnycanencrypt / default.nix
blobda1b52bdd2244163939fb1ee91b1188a383420de
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   httpx,
7   libiconv,
8   nettle,
9   PCSC,
10   pcsclite,
11   pkg-config,
12   pytestCheckHook,
13   pythonOlder,
14   rustPlatform,
15   vcrpy,
18 buildPythonPackage rec {
19   pname = "johnnycanencrypt";
20   version = "0.15.0";
21   pyproject = true;
23   disabled = pythonOlder "3.8";
25   src = fetchFromGitHub {
26     owner = "kushaldas";
27     repo = "johnnycanencrypt";
28     tag = "v${version}";
29     hash = "sha256-tbHW3x+vwFz0nqFGWvgxjhw8XH6/YKz1uagU339SZyk=";
30   };
32   cargoDeps = rustPlatform.fetchCargoTarball {
33     inherit src;
34     name = "${pname}-${version}";
35     hash = "sha256-vDlMdzZgmaRkviEk8IjIN+Q5x95gnpQiW5c8fT+dats=";
36   };
38   build-system = with rustPlatform; [
39     bindgenHook
40     cargoSetupHook
41     maturinBuildHook
42   ];
44   nativeBuildInputs =
45     [ pkg-config ]
46     ++ (with rustPlatform; [
47       bindgenHook
48       cargoSetupHook
49       maturinBuildHook
50     ]);
52   buildInputs =
53     [ nettle ]
54     ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ]
55     ++ lib.optionals stdenv.hostPlatform.isDarwin [
56       PCSC
57       libiconv
58     ];
60   dependencies = [ httpx ];
62   nativeCheckInputs = [
63     pytestCheckHook
64     vcrpy
65   ];
67   preCheck = ''
68     # import from $out
69     rm -r johnnycanencrypt
70   '';
72   pythonImportsCheck = [ "johnnycanencrypt" ];
74   meta = with lib; {
75     description = "Python module for OpenPGP written in Rust";
76     homepage = "https://github.com/kushaldas/johnnycanencrypt";
77     changelog = "https://github.com/kushaldas/johnnycanencrypt/blob/v${version}/changelog.md";
78     license = licenses.lgpl3Plus;
79     maintainers = with maintainers; [ _0x4A6F ];
80   };