1{ lib
2, buildPythonPackage
3, fetchPypi
4, pkg-config
5, rustPlatform
6, cargo
7, rustc
8, bzip2
9, nettle
10, openssl
11, pcsclite
12, stdenv
13, darwin
14, libiconv
15}:
16
17buildPythonPackage rec {
18 pname = "pysequoia";
19 version = "0.1.20";
20 format = "pyproject";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-KavsLp17e4ckX11B0pefiQ1Hma/O9x0VY/uVPiJm4Fs=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoTarball {
28 inherit src;
29 name = "${pname}-${version}";
30 hash = "sha256-7Lw6gR6o2HJ/zyG4b0wz4nmU2AIIAhyK9zaQ6w+/RgE=";
31 };
32
33 nativeBuildInputs = [
34 pkg-config
35 rustPlatform.bindgenHook
36 rustPlatform.cargoSetupHook
37 rustPlatform.maturinBuildHook
38 cargo
39 rustc
40 ];
41
42 buildInputs = [
43 bzip2
44 nettle
45 openssl
46 pcsclite
47 ] ++ lib.optionals stdenv.isDarwin [
48 darwin.apple_sdk.frameworks.CoreFoundation
49 darwin.apple_sdk.frameworks.Security
50 libiconv
51 ];
52
53 pythonImportsCheck = [ "pysequoia" ];
54
55 meta = with lib; {
56 description = "This library provides OpenPGP facilities in Python through the Sequoia PGP library";
57 downloadPage = "https://codeberg.org/wiktor/pysequoia";
58 homepage = "https://sequoia-pgp.gitlab.io/pysequoia";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ doronbehar ];
61 # Broken since the 0.1.20 update according to ofborg. The errors are not clear...
62 broken = stdenv.isDarwin;
63 };
64}