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